### Eclipse Workspace Patch 1.0
#P contrib
Index: plugins/blocks/mrbs/settings.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/settings.php,v
retrieving revision 1.5
diff -u -r1.5 settings.php
--- plugins/blocks/mrbs/settings.php	1 Aug 2008 04:02:12 -0000	1.5
+++ plugins/blocks/mrbs/settings.php	3 Aug 2008 02:50:46 -0000
@@ -1,57 +1,56 @@
-<?php  //$Id: settings.php,v 1.5 2008/08/01 04:02:12 arborrow Exp $
+<?php  //$Id: settings.php,v 1.3 2008/07/30 17:28:42 arborrow Exp $
 
-
-$settings->add(new admin_setting_configtext('block_mrbs_serverpath', get_string('serverpath', 'block_mrbs'),
+$settings->add(new admin_setting_configtext('serverpath', get_string('serverpath', 'block_mrbs'),
 get_string('adminview', 'block_mrbs'), $CFG->wwwroot.'/blocks/mrbs/web', PARAM_URL));
-$settings->settings->block_mrbs_serverpath->plugin='block/mrbs';
+$settings->settings->serverpath->plugin='block/mrbs';
 
-$settings->add(new admin_setting_configtext('block_mrbs_admin', get_string('config_admin', 'block_mrbs'), get_string('config_admin2', 'block_mrbs'), $CFG->supportname, PARAM_TEXT));
-$settings->settings->block_mrbs_admin->plugin='block/mrbs';
+$settings->add(new admin_setting_configtext('admin', get_string('config_admin', 'block_mrbs'), get_string('config_admin2', 'block_mrbs'), $CFG->supportname, PARAM_TEXT));
+$settings->settings->admin->plugin='block/mrbs';
 
-$settings->add(new admin_setting_configtext('block_mrbs_admin_email', get_string('config_admin_email', 'block_mrbs'),get_string('config_admin_email2', 'block_mrbs'), $CFG->supportemail, PARAM_TEXT));
-$settings->settings->block_mrbs_admin_email->plugin='block/mrbs';
+$settings->add(new admin_setting_configtext('admin_email', get_string('config_admin_email', 'block_mrbs'),get_string('config_admin_email2', 'block_mrbs'), $CFG->supportemail, PARAM_TEXT));
+$settings->settings->admin_email->plugin='block/mrbs';
 
 $options = array(0 => get_string('no'), 1=> get_string('yes'));
-$settings->add(new admin_setting_configselect('block_mrbs_enable_periods', get_string('config_enable_periods', 'block_mrbs'),get_string('config_enable_periods2', 'block_mrbs'), 1, $options));
-$settings->settings->block_mrbs_enable_periods->plugin='block/mrbs';
+$settings->add(new admin_setting_configselect('enable_periods', get_string('config_enable_periods', 'block_mrbs'),get_string('config_enable_periods2', 'block_mrbs'), 1, $options));
+$settings->settings->enable_periods->plugin='block/mrbs';
 
-if (isset($CFG->block_mrbs_enable_periods)) {
-    if($CFG->block_mrbs_enable_periods ==0) {
+if (isset($CFG->enable_periods)) {
+    if($CFG->enable_periods ==0) {
 
         // Resolution
 
         unset($options);
         $strunits = get_string('resolution_units', 'block_mrbs');
         $options = array('900' => '15' .$strunits , '1800'=> '30' . $strunits, '2700'=> '45' . $strunits, '3600'=> '60' . $strunits, '4500'=> '75' . $strunits, '5400'=> '90' . $strunits, '6300'=> '105' . $strunits, '7200'=> '120' . $strunits);
-        $settings->add(new admin_setting_configselect('block_mrbs_resolution', get_string('config_resolution', 'block_mrbs'),get_string('config_resolution2', 'block_mrbs'), '1800', $options));
-        $settings->settings->block_mrbs_resolution->plugin='block/mrbs';
+        $settings->add(new admin_setting_configselect('resolution', get_string('config_resolution', 'block_mrbs'),get_string('config_resolution2', 'block_mrbs'), '1800', $options));
+        $settings->settings->resolution->plugin='block/mrbs';
 
         // Start Time (Hours)
         unset($options);
         $options = array(1 => '01', 2=> '02', 3=> '03', 4=> '04', 5=> '05', 6=> '06', 7=> '07', 8=> '08', 9=> '09', 10=> '10', 11=> '11', 12=> '12', 13=> '13', 14=> '14', 15=> '15', 16=> '16', 17=> '17', 18=> '18', 19=> '19', 20=> '20', 21=> '21', 22=> '22', 23=> '23');
-        $settings->add(new admin_setting_configselect('block_mrbs_morningstarts', get_string('config_morningstarts', 'block_mrbs'),get_string('config_morningstarts2', 'block_mrbs'), 7, $options));
-        $settings->settings->block_mrbs_morningstarts->plugin='block/mrbs';
+        $settings->add(new admin_setting_configselect('morningstarts', get_string('config_morningstarts', 'block_mrbs'),get_string('config_morningstarts2', 'block_mrbs'), 7, $options));
+        $settings->settings->morningstarts->plugin='block/mrbs';
 
         // Start Time (Min)
         unset($options);
         $options = array(0 => '00', 5=> '05', 10=> '10', 15=> '15', 20=> '20', 25=> '25', 30=> '30', 35=> '35', 40=> '40', 45=> '45', 50=> '50', 55=> '55');
-        $settings->add(new admin_setting_configselect('block_mrbs_morningstarts_min', get_string('config_morningstarts_min', 'block_mrbs'),get_string('config_morningstarts_min2', 'block_mrbs'), 0, $options));
-        $settings->settings->block_mrbs_morningstarts_min->plugin='block/mrbs';
+        $settings->add(new admin_setting_configselect('morningstarts_min', get_string('config_morningstarts_min', 'block_mrbs'),get_string('config_morningstarts_min2', 'block_mrbs'), 0, $options));
+        $settings->settings->morningstarts_min->plugin='block/mrbs';
         // End Time (Hours)
         unset($options);
         $options = array(1 => '01', 2=> '02', 3=> '03', 4=> '04', 5=> '05', 6=> '06', 7=> '07', 8=> '08', 9=> '09', 10=> '10', 11=> '11', 12=> '12', 13=> '13', 14=> '14', 15=> '15', 16=> '16', 17=> '17', 18=> '18', 19=> '19', 20=> '20', 21=> '21', 22=> '22', 23=> '23'     );
-        $settings->add(new admin_setting_configselect('block_mrbs_eveningends', get_string('config_eveningends', 'block_mrbs'),get_string('config_eveningends2', 'block_mrbs'), 19, $options));
-        $settings->settings->block_mrbs_eveningends->plugin='block/mrbs';
+        $settings->add(new admin_setting_configselect('eveningends', get_string('config_eveningends', 'block_mrbs'),get_string('config_eveningends2', 'block_mrbs'), 19, $options));
+        $settings->settings->eveningends->plugin='block/mrbs';
         // End Time Time (Min)
         unset($options);
         $options = array(0 => '00', 5=> '05', 10=> '10', 15=> '15', 20=> '20', 25=> '25', 30=> '30', 35=> '35', 40=> '40', 45=> '45', 50=> '50', 55=> '55');
-        $settings->add(new admin_setting_configselect('block_mrbs_eveningends_min', get_string('config_eveningends_min', 'block_mrbs'),get_string('config_eveningends_min2', 'block_mrbs'), 0, $options));
-        $settings->settings->block_mrbs_eveningends_min->plugin='block/mrbs';
+        $settings->add(new admin_setting_configselect('eveningends_min', get_string('config_eveningends_min', 'block_mrbs'),get_string('config_eveningends_min2', 'block_mrbs'), 0, $options));
+        $settings->settings->eveningends_min->plugin='block/mrbs';
     }
     else {  //Use Custom Periods
     
-        $settings->add(new admin_setting_configtextarea('block_mrbs_periods', get_string('config_periods', 'block_mrbs'),get_string('config_periods2', 'block_mrbs'),''));
-        $settings->settings->block_mrbs_periods->plugin='block/mrbs';
+        $settings->add(new admin_setting_configtextarea('periods', get_string('config_periods', 'block_mrbs'),get_string('config_periods2', 'block_mrbs'),''));
+        $settings->settings->periods->plugin='block/mrbs';
     }
 }
 
@@ -60,18 +59,91 @@
 //Start of Week
 unset($options);
 $options = array(0 => get_string('sunday', 'calendar'),1 => get_string('monday', 'calendar'),2 => get_string('tuesday', 'calendar'),3 => get_string('wednesday', 'calendar'),4 => get_string('thursday', 'calendar'),5 => get_string('friday', 'calendar'),6 => get_string('saturday', 'calendar'));
-
-$settings->add(new admin_setting_configselect('block_mrbs_weekstarts', get_string('config_weekstarts', 'block_mrbs'),get_string('config_weekstarts2', 'block_mrbs'), 0, $options));
-$settings->settings->block_mrbs_weekstarts->plugin='block/mrbs';
+$settings->add(new admin_setting_configselect('weekstarts', get_string('config_weekstarts', 'block_mrbs'),get_string('config_weekstarts2', 'block_mrbs'), 0, $options));
+$settings->settings->weekstarts->plugin='block/mrbs';
 //Date Format
 unset($options);
 $options = array(0 => get_string('config_date_mmddyy', 'block_mrbs'),1 => get_string('config_date_ddmmyy', 'block_mrbs'));
-
-$settings->add(new admin_setting_configselect('block_mrbs_dateformat', get_string('config_dateformat', 'block_mrbs'),get_string('config_dateformat2', 'block_mrbs'), 0, $options));
-$settings->settings->block_mrbs_dateformat->plugin='block/mrbs';
+$settings->add(new admin_setting_configselect('dateformat', get_string('config_dateformat', 'block_mrbs'),get_string('config_dateformat2', 'block_mrbs'), 0, $options));
+$settings->settings->dateformat->plugin='block/mrbs';
 //Time format
 unset($options);
 $options = array(0 => get_string('timeformat_12', 'calendar'),1 => get_string('timeformat_24', 'calendar'));
-$settings->add(new admin_setting_configselect('block_mrbs_timeformat', get_string('config_timeformat', 'block_mrbs'),get_string('config_timeformat2', 'block_mrbs'), 1, $options));
-$settings->settings->block_mrbs_timeformat->plugin='block/mrbs';
+$settings->add(new admin_setting_configselect('timeformat', get_string('config_timeformat', 'block_mrbs'),get_string('config_timeformat2', 'block_mrbs'), 1, $options));
+$settings->settings->timeformat->plugin='block/mrbs';
+
+// $settings = new admin_settingpage('block_mrbs_misc', get_string('block_mrbs_misc','block_mrbs')); // it would be good to be able to break this page up somehow
+// Misc Settings
+$settings->add(new admin_setting_configtext('max_rep_entrys', get_string('config_max_rep_entrys', 'block_mrbs'), get_string('config_max_rep_entrys2', 'block_mrbs'), 365, PARAM_INT));
+$settings->settings->max_rep_entrys->plugin='block/mrbs';
+
+$settings->add(new admin_setting_configtext('default_report_days', get_string('config_default_report_days', 'block_mrbs'), get_string('config_default_report_days2', 'block_mrbs'), 60, PARAM_INT));
+$settings->settings->default_report_days->plugin='block/mrbs';
+
+$settings->add(new admin_setting_configtext('search_count', get_string('config_search_count', 'block_mrbs'), get_string('config_search_count2', 'block_mrbs'), 20, PARAM_INT));
+$settings->settings->search_count->plugin='block/mrbs';
+
+$settings->add(new admin_setting_configtext('refresh_rate', get_string('config_refresh_rate', 'block_mrbs'), get_string('config_refresh_rate2', 'block_mrbs'), 0, PARAM_INT));
+$settings->settings->refresh_rate->plugin='block/mrbs';
+
+$options = array('list' => get_string('list'),'select' => get_string('select'));
+$settings->add(new admin_setting_configselect('area_list_format', get_string('config_area_list_format', 'block_mrbs'), get_string('config_area_list_format2', 'block_mrbs'), 'list', $options));
+$settings->settings->area_list_format->plugin='block/mrbs';
+
+$options = array('both' => get_string('both', 'block_mrbs'),'description' => get_string('description'), 'slot' => get_string('slot', 'block_mrbs'));
+$settings->add(new admin_setting_configselect('monthly_view_entries_details', get_string('config_monthly_view_entries_details', 'block_mrbs'), get_string('config_monthly_view_entries_details2', 'block_mrbs'), 'both', $options));
+$settings->settings->monthly_view_entries_details->plugin='block/mrbs';
+
+$options = array(0 => get_string('no'), 1=> get_string('yes'));
+$settings->add(new admin_setting_configselect('view_week_number', get_string('config_view_week_number', 'block_mrbs'), get_string('config_view_week_number2', 'block_mrbs'), 0, $options));
+$settings->settings->view_week_number->plugin='block/mrbs';
+
+$options = array(0 => get_string('no'), 1=> get_string('yes'));
+$settings->add(new admin_setting_configselect('times_right_side', get_string('config_times_right_side', 'block_mrbs'), get_string('config_times_right_side2', 'block_mrbs'), 0, $options));
+$settings->settings->times_right_side->plugin='block/mrbs';
+
+$options = array(0 => get_string('no'), 1=> get_string('yes'));
+$settings->add(new admin_setting_configselect('javascript_cursor', get_string('config_javascript_cursor', 'block_mrbs'), get_string('config_javascript_cursor2', 'block_mrbs'), 1, $options));
+$settings->settings->javascript_cursor->plugin='block/mrbs';
+
+$options = array(0 => get_string('no'), 1=> get_string('yes'));
+$settings->add(new admin_setting_configselect('show_plus_link', get_string('config_show_plus_link', 'block_mrbs'), get_string('config_show_plus_link2', 'block_mrbs'), 1, $options));
+$settings->settings->show_plus_link->plugin='block/mrbs';
+
+$options = array('bgcolor' => get_string('bgcolor', 'block_mrbs'), 'class' => get_string('class', 'block_mrbs'), 'hybrid' => get_string('hybrid', 'block_mrbs'));
+$settings->add(new admin_setting_configselect('highlight_method', get_string('config_highlight_method', 'block_mrbs'), get_string('config_highlight_method2', 'block_mrbs'), 'hybrid', $options));
+$settings->settings->highlight_method->plugin='block/mrbs';
+
+$options = array('day' => get_string('day'), 'month' => get_string('month','block_mrbs'), 'week' => get_string('week'));
+$settings->add(new admin_setting_configselect('default_view', get_string('config_default_view', 'block_mrbs'), get_string('config_default_view2', 'block_mrbs'), 'day', $options));
+$settings->settings->default_view->plugin='block/mrbs';
+
+$settings->add(new admin_setting_configtext('default_room', get_string('config_default_room', 'block_mrbs'), get_string('config_default_room2', 'block_mrbs'), 0, PARAM_INT));
+$settings->settings->default_room->plugin='block/mrbs';
+
+// should this be the same as the Moodle Site cookie path?
+// $settings->add(new admin_setting_configtext('cookie_path_override', get_string('config_cookie_path_override', 'block_mrbs'), get_string('config_cookie_path_override2', 'block_mrbs'), '', PARAM_LOCALURL));
+// $settings->settings->cookie_path_override->plugin='block/mrbs';
+
+/*
+
+//select
+$options = array('' => get_string('', 'block_mrbs'), '' => get_string('', 'block_mrbs'));
+$settings->add(new admin_setting_configselect('', get_string('config_', 'block_mrbs'), get_string('config_2', 'block_mrbs'), '', $options));
+$settings->settings->->plugin='block/mrbs';
+
+//text or int
+$settings->add(new admin_setting_configtext('', get_string('config_', 'block_mrbs'), get_string('config_2', 'block_mrbs'), 0, PARAM_INT));
+$settings->settings->->plugin='block/mrbs';
+*/
+
+
+
+
+
+
+
+
+
+
 ?>
\ No newline at end of file
Index: plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php,v
retrieving revision 1.6
diff -u -r1.6 block_mrbs.php
--- plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php	2 Aug 2008 20:25:21 -0000	1.6
+++ plugins/blocks/mrbs/lang/en_utf8/block_mrbs.php	3 Aug 2008 02:50:46 -0000
@@ -1,4 +1,4 @@
-<?php // $Id: block_mrbs.php,v 1.6 2008/08/02 20:25:21 arborrow Exp $
+<?php // $Id: block_mrbs.php,v 1.3 2008/07/30 17:28:42 arborrow Exp $
 $string['about_mrbs']         = 'About MRBS';
 $string['accessdenied']       = 'Access Denied';
 $string['accessmrbs'] = 'Schedule a Resource (Computer Room)';
@@ -11,41 +11,71 @@
 $string['area_admin_email']   = 'Area admin email:';
 $string['areas']              = 'Areas';
 $string['backadmin']          = 'Back to Admin';
+$string['bgcolor']            = 'bgcolor';
 $string['blockname'] = 'Resource Scheduling';
 $string['bookingsfor']        = 'Bookings for';
 $string['bookingsforpost']    = ''; # Goes after the date
+$string['both']            = 'Both';
 $string['brief_description']  = 'Brief Description.';
 $string['browserlang']        = 'Your browser is set to use';
 $string['capacity']           = 'Capacity';
 $string['charset']            = 'UTF-8';
+$string['class']            = 'class';
 $string['click_to_reserve']   = 'Click on the cell to make a reservation.';
 $string['config_admin_email'] = 'MRBS admin email';
 $string['config_admin_email2'] = 'Email address of the MRBS administrator';
 $string['config_admin'] = 'MRBS Admin';
 $string['config_admin2'] = 'Name of the MRBS administrator';
+$string['config_area_list_format'] = 'Show area list';
+$string['config_area_list_format2'] = 'Should areas be shown as a list or a drop-down select box?';
+$string['config_cookie_path_override'] = 'Cookie path override';
+$string['config_cookie_path_override2'] = 'If this value is set it will be used by the \'php\' session scheme to override the default behaviour of automatically determining the cookie path to use.';
 $string['config_date_ddmmyy']  = '10 July';
 $string['config_date_mmddyy'] = 'July 10';
 $string['config_dateformat'] = 'Date format';
 $string['config_dateformat2']  = 'Date format to be used by MRBS.';
+$string['config_default_report_days'] = 'Report span (days)';
+$string['config_default_report_days2'] = 'Default report span in days';
+$string['config_default_room'] = 'Default room';
+$string['config_default_room2'] = 'Define default room to start with (used by index.php). Room numbers can be determined by looking at the Edit or Delete URL for a room on the admin page.';
+$string['config_default_view'] = 'Default view';
+$string['config_default_view2'] = 'Define default starting view (month, week or day)';
 $string['config_enable_periods'] = 'Use Periods';
 $string['config_enable_periods2'] = 'Use custom periods for MRBS scheduling.  If this is set to no then MRBS will schedule using time blocks';
 $string['config_eveningends_min'] = 'End Minutes';
 $string['config_eveningends_min2']  = 'End time (Minutes) for the day, Periods must be disabled to use this option.';
 $string['config_eveningends'] = 'End Hour';
 $string['config_eveningends2']  = 'End time (Hour) for the day, Periods must be disabled to use this option.';
+$string['config_highlight_method'] = 'Highlight method';
+$string['config_highlight_method2'] = 'Choose one of the highlight methods: bgcolor, class, or hybrid.';
+$string['config_javascript_cursor'] = 'Javascript cursor';
+$string['config_javascript_cursor2'] = 'Change to false if clients have old browsers incompatible with JavaScript.';
+$string['config_max_rep_entrys'] = 'Max. Rep Entries';
+$string['config_max_rep_entrys2'] = 'Maximum repeating entrys (max needed +1)';
+$string['config_monthly_view_entries_details'] = 'View monthly details';
+$string['config_monthly_view_entries_details2'] = 'Entries in monthly view can be shown as start/end slot, brief description or both. Set to \'description\' for brief description, \'slot\' for time slot and \'both\' for both. Default is \'both\', but 6 entries per day are shown instead of 12.';
 $string['config_morningstarts_min'] = 'Start Minutes';
 $string['config_morningstarts_min2']  = 'Start time (Minutes) for the day, Periods must be disabled to use this option.';
 $string['config_morningstarts'] = 'Start Hour';
 $string['config_morningstarts2']  = 'Start time (Hour) for the day, Periods must be disabled to use this option.';
 $string['config_periods'] = 'Custom Periods';
 $string['config_periods2']  = 'Define the name or description for your periods in chronological order.  One entry per line.';
+$string['config_refresh_rate'] = 'Page refresh time';
+$string['config_refresh_rate2'] = 'Page refresh time (in seconds). Set to 0 to disable';
 $string['config_resolution'] = 'Time blocks';
 $string['config_resolution2']  = 'Time blocks to be scheduled, Periods must be disabled to use this option.';
+$string['config_search_count'] = 'Search results per page';
+$string['config_search_count2'] = 'Results per page for searching';
+$string['config_show_plus_link'] = 'Show plus link';
+$string['config_show_plus_link2'] = 'Change to true to always show the (+) link';
 $string['config_timeformat'] = 'Time format';
 $string['config_timeformat2']  = 'Time format to be used by MRBS.';
+$string['config_times_right_side'] = 'Time right side';
+$string['config_times_right_side2'] = 'To display times on right side in day and week view, set to Yes';
+$string['config_view_week_number'] = 'View week number';
+$string['config_view_week_number2'] = 'To view weeks in the bottom (trailer.php) as week numbers (42) instead of \'first day of the week\' (13 Oct), set this to TRUE';
 $string['config_weekstarts'] = 'Start of Week';
-$string['config_weekstarts2']  = 'Select the start of week.';
-$string['confirmdel']         = 'Are you sure\\nyou want to\\ndelete this entry?\\n\\n';
+$string['config_weekstarts2']  = 'Select the start of week.';$string['confirmdel']         = 'Are you sure\\nyou want to\\ndelete this entry?\\n\\n';
 $string['conflict']           = 'The new booking will conflict with the following entry(s):';
 $string['createdby']          = 'Created By:';
 $string['ctrl_click_type']    = 'Use Control-Click to select more than one type';
@@ -83,6 +113,7 @@
 $string['gototoday']          = 'Go To Today';
 $string['highlight_line']     = 'Highlight this line';
 $string['hours']              = 'hours';
+$string['hybrid']            = 'hybrid';
 $string['in']                 = 'in';
 $string['include']            = 'Include:';
 $string['internal']           = 'Class';
@@ -99,6 +130,7 @@
 $string['match_entry']        = 'Match brief description:';
 $string['match_room']         = 'Match room:';
 $string['match_type']         = 'Match type:';
+$string['month']            = 'Month';
 $string['monthafter']         = 'Go To Month After';
 $string['monthbefore']        = 'Go To Month Before';
 $string['mrbs:administermrbs'] = 'Access MRBS (Read / Write / Admin)';
@@ -160,6 +192,7 @@
 $string['seconds']            = 'seconds';
 $string['serverpath'] = 'MRBS Installation path';
 $string['show_my_entries']    = 'Click to display all my upcoming entries';
+$string['slot']            = 'Slot';
 $string['sort_rep_time']      = 'Start Date/Time';
 $string['sort_rep']           = 'Sort Report by:';
 $string['start_date']         = 'Start Time:';
@@ -190,4 +223,5 @@
 $string['you_are']            = 'You are';
 $string['you_have_not_entered'] = 'You have not entered a';
 $string['you_have_not_selected'] = 'You have not selected a';
+
 ?>
Index: plugins/blocks/mrbs/web/config.inc.php
===================================================================
RCS file: /cvsroot/moodle/contrib/plugins/blocks/mrbs/web/config.inc.php,v
retrieving revision 1.9
diff -u -r1.9 config.inc.php
--- plugins/blocks/mrbs/web/config.inc.php	2 Aug 2008 21:30:47 -0000	1.9
+++ plugins/blocks/mrbs/web/config.inc.php	3 Aug 2008 02:50:46 -0000
@@ -1,20 +1,21 @@
 <?php
 
-# $Id: config.inc.php,v 1.9 2008/08/02 21:30:47 arborrow Exp $
+# $Id: config.inc.php,v 1.7 2008/08/02 04:44:17 arborrow Exp $
 
 ###########################################################################
 #   MRBS Configuration File
-#   You shouldn't have to modify this file as all options can be set via Moode - see CONTRIB-422
+#   Configure this file for your site.
+#   You shouldn't have to modify anything outside this file.
 ###########################################################################
 
 //For integration with Moodle
 require_once("../../../config.php");
-$cfg_mrbs = get_config('block/mrbs'); //get Moodle config settings for the MRBS block
+$cfg_mrbs = get_config('block/mrbs');
 ###################
 # Database settings
 ###################
 # Which database system: "pgsql"=PostgreSQL, "mysql"=MySQL, "mysqli"=MySQL via the mysqli PHP extension
-$dbsys = $CFG->dbtype; //"mysql"
+$dbsys = $CFG->dbtype; //"mysql", "pgsql", or "mysqli"
 # Hostname of database server. For pgsql, can use "" instead of localhost
 # to use Unix Domain Sockets instead of TCP/IP.
 $db_host = $CFG->dbhost; //"localhost";
@@ -29,12 +30,17 @@
 $db_tbl_prefix = $CFG->prefix.'mrbs_';
 # Uncomment this to NOT use PHP persistent (pooled) database connections:
 # $db_nopersist = 1;
+$tbl_area   = $db_tbl_prefix . "area";
+$tbl_entry  = $db_tbl_prefix . "entry";
+$tbl_repeat = $db_tbl_prefix . "repeat";
+$tbl_room   = $db_tbl_prefix . "room";
+$tbl_users  = $db_tbl_prefix . "users";
 
 ################################
 # Site identification information
 #################################
-$mrbs_admin = $cfg_mrbs->block_mrbs_admin;  //moodle username of the mrbs administrator
-$mrbs_admin_email = $cfg_mrbs->block_mrbs_admin_email; // "admin@MyMoodleSite.com";
+$mrbs_admin = $cfg_mrbs->admin;  //moodle username of the mrbs administrator
+$mrbs_admin_email = $cfg_mrbs->admin_email; // "admin@MyMoodleSite.com";
 
 # This is the text displayed in the upper left corner of every page. Either
 # type the name of your organization, or you can put your logo like this :
@@ -50,7 +56,7 @@
 # It is also recommended that you set this if you intend to use email
 # notifications, to ensure that the correct URL is displayed in the
 # notification.
-$url_base = $cfg_mrbs->block_mrbs_serverpath;
+$url_base = $cfg_mrbs->serverpath;
 
 
 ###################
@@ -63,17 +69,17 @@
 # the default) or user defined periods (TRUE).  If user-defined periods
 # are used then $resolution, $morningstarts, $eveningends,
 # $eveningends_minutes and $twentyfourhour_format are ignored.
-$enable_periods = $cfg_mrbs->block_mrbs_enable_periods;
+$enable_periods = $cfg_mrbs->enable_periods;
 
 if ($enable_periods == 0) { //if we are not using periods then set the following values, prevents error of unset variables
 # Resolution - what blocks can be booked, in seconds.
 # Default is half an hour: 1800 seconds.
-    $resolution = $cfg_mrbs->block_mrbs_resolution;
+    $resolution = $cfg_mrbs->resolution;
 
 # Start and end of day, NOTE: These are integer hours only, 0-23, and
 # morningstarts must be < eveningends. See also eveningends_minutes.
-    $morningstarts = $cfg_mrbs->block_mrbs_morningstarts;
-    $eveningends   =$cfg_mrbs->block_mrbs_eveningends;
+    $morningstarts = $cfg_mrbs->morningstarts;
+    $eveningends   =$cfg_mrbs->eveningends;
 
 # Minutes to add to $morningstarts to get to the real start of the day.
 # Be sure to consider the value of $eveningends_minutes if you change
@@ -82,14 +88,14 @@
 # morningstarts = 8 and morningstarts_minutes = 30 then for the last
 # period to start at say 4:30pm you would need to set eveningends = 16
 # and eveningends_minutes = 30
-    $morningstarts_minutes = $cfg_mrbs->block_mrbs_morningstarts_min;
+    $morningstarts_minutes = $cfg_mrbs->morningstarts_min;
 
 # Minutes to add to $eveningends hours to get the real end of the day.
 # Examples: To get the last slot on the calendar to be 16:30-17:00, set
 # eveningends=16 and eveningends_minutes=30. To get a full 24 hour display
 # with 15-minute steps, set morningstarts=0; eveningends=23;
 # eveningends_minutes=45; and resolution=900.
-    $eveningends_minutes = $cfg_mrbs->block_mrbs_eveningends_min;
+    $eveningends_minutes = $cfg_mrbs->eveningends_min;
 }
 
 # Define the name or description for your periods in chronological order
@@ -107,7 +113,7 @@
 
 // Moodle HACK
 
-if(!isset($cfg_mrbs->block_mrbs_periods) or empty($cfg_mrbs->block_mrbs_periods)) {
+if(!isset($cfg_mrbs->periods) or empty($cfg_mrbs->periods)) {
 $periods[] = "Period&nbsp;1";
 $periods[] = "Period&nbsp;2";
     $periods[] = "Period&nbsp;3";
@@ -122,7 +128,7 @@
     $periods[] = "Period&nbsp;12";
 }
 else {
-    $pds = explode("\n", $cfg_mrbs->block_mrbs_periods);
+    $pds = explode("\n", $cfg_mrbs->periods);
     foreach ($pds as $pd) {
         $pd = trim($pd);
         $periods[] = $pd;
@@ -130,64 +136,63 @@
 }
 
 # Start of week: 0 for Sunday, 1 for Monday, etc.
-$weekstarts = $cfg_mrbs->block_mrbs_weekstarts;
+$weekstarts = $cfg_mrbs->weekstarts;
 
 # Trailer date format: 0 to show dates as "Jul 10", 1 for "10 Jul"
-$dateformat = $cfg_mrbs->block_mrbs_dateformat;
+$dateformat = $cfg_mrbs->dateformat;
 
 # Time format in pages. 0 to show dates in 12 hour format, 1 to show them
 # in 24 hour format
-$twentyfourhour_format = $cfg_mrbs->block_mrbs_timeformat;
+$twentyfourhour_format = $cfg_mrbs->timeformat;
 
 ########################
 # Miscellaneous settings
 ########################
 
 # Maximum repeating entrys (max needed +1):
-$max_rep_entrys = 365 + 1;
+$max_rep_entrys = $cfg_mrbs->max_rep_entrys + 1;
 
 # Default report span in days:
-$default_report_days = 60;
+$default_report_days = $cfg_mrbs->default_report_days;
 
 # Results per page for searching:
-$search["count"] = 20;
+$search["count"] = $cfg_mrbs->search_count;
 
 # Page refresh time (in seconds). Set to 0 to disable
-$refresh_rate = 0;
+$refresh_rate = $cfg_mrbs->refresh_rate;
 
 # should areas be shown as a list or a drop-down select box?
-$area_list_format = "list";
-#$area_list_format = "select";
+$area_list_format = $cfg_mrbs->area_list_format;
 
 # Entries in monthly view can be shown as start/end slot, brief description or
 # both. Set to "description" for brief description, "slot" for time slot and
 # "both" for both. Default is "both", but 6 entries per day are shown instead
 # of 12.
-$monthly_view_entries_details = "both";
+$monthly_view_entries_details = $cfg_mrbs->monthly_view_entries_details;
 
 # To view weeks in the bottom (trailer.php) as week numbers (42) instead of
 # 'first day of the week' (13 Oct), set this to TRUE
-$view_week_number = FALSE;
+$view_week_number = $cfg_mrbs->view_week_number;
 
 # To display times on right side in day and week view, set to TRUE;
-$times_right_side = FALSE;
+$times_right_side = $cfg_mrbs->times_right_side;
 
 # Control the active cursor in day/week/month views.
-$javascript_cursor = true; # Change to false if clients have old browsers
+$javascript_cursor = $cfg_mrbs->javascript_cursor; # Change to false if clients have old browsers
                            # incompatible with JavaScript.
-$show_plus_link = true; # Change to true to always show the (+) link as in
+$show_plus_link = $cfg_mrbs->show_plus_link; # Change to true to always show the (+) link as in
                         # MRBS 1.1.
-$highlight_method = "hybrid"; # One of "bgcolor", "class", "hybrid".
+$highlight_method = $cfg_mrbs->highlight_method; # One of "bgcolor", "class", "hybrid".
 
 # Define default starting view (month, week or day)
 # Default is day
-$default_view = "day";
+$default_view = $cfg_mrbs->default_view;
 
 # Define default room to start with (used by index.php)
 # Room numbers can be determined by looking at the Edit or Delete URL for a
 # room on the admin page.
 # Default is 0
-$default_room = 0;
+$default_room = $cfg_mrbs->default_room;
 
 ###############################################
 # Authentication settings - read AUTHENTICATION
@@ -196,14 +201,7 @@
 			  # "http" "php" "cookie" "ip" "host" "nt" "omni".
 			  # "remote_user"
 $auth["type"] = "moodle";
-#$auth["type"] = "db_ext"; # How to validate the user/password. One of "none"
-                          # "config" "db" "db_ext" "pop3" "imap" "ldap" "nis"
-                          # "nw" "ext".
-
-# Cookie path override. If this value is set it will be used by the
-# 'php' and 'cookie' session schemes to override the default behaviour
-# of automatically determining the cookie path to use
-$cookie_path_override = '';
+$cookie_path_override = ''; //is this even needed with the moodle auth type?
 
 
 ###############################################
@@ -256,6 +254,35 @@
 # "smtp" or "sendmail". Default is 'mail'. See INSTALL for more details.
 define ("MAIL_ADMIN_BACKEND", "mail");
 
+#*******************
+# Sendmail settings
+
+# Set the path of the Sendmail program (only used with "sendmail" backend).
+# Default is "/usr/bin/sendmail"
+define ("SENDMAIL_PATH", "/usr/bin/sendmail");
+
+# Set additional Sendmail parameters (only used with "sendmail" backend).
+# (example "-t -i"). Default is ""
+define ("SENDMAIL_ARGS", '');
+
+#*******************
+# SMTP settings
+
+# Set smtp server to connect. Default is 'localhost' (only used with "smtp"
+# backend).
+define ("SMTP_HOST", "localhost");
+
+# Set smtp port to connect. Default is '25' (only used with "smtp" backend).
+define ("SMTP_PORT", 25);
+
+# Set whether or not to use SMTP authentication. Default is 'FALSE'
+define ("SMTP_AUTH", FALSE);
+
+# Set the username to use for SMTP authentication. Default is ""
+define ("SMTP_USERNAME", '');
+
+# Set the password to use for SMTP authentication. Default is ""
+define ("SMTP_PASSWORD", '');
 
 #****************************
 # Miscellaneous settings
@@ -338,33 +365,17 @@
 # be shown in the day view color-key, and not offered in the type selector
 # for new or edited entries.
 
-# $typel["A"] = "A";
-# $typel["B"] = "B";
-# $typel["C"] = "C";
-# $typel["D"] = "D";
+$typel["A"] = NULL;
+$typel["B"] = NULL;
+$typel["C"] = NULL;
+$typel["D"] = NULL;
 $typel["E"] = get_string('external','block_mrbs');
-# $typel["F"] = "F";
-# $typel["G"] = "G";
-# $typel["H"] = "H";
+$typel["F"] = NULL;
+$typel["G"] = NULL;
+$typel["H"] = NULL;
 $typel["I"] = get_string('internal','block_mrbs');
-# $typel["J"] = "J";
+$typel["J"] = NULL;
 
-##########################################
-# PHP System Configuration - internal use, do not change
-##########################################
-# Disable magic quoting on database returns:
-set_magic_quotes_runtime(0);
 
-# Make sure notice errors are not reported, they can break mrbs code:
 error_reporting (E_ALL ^ E_NOTICE);
-
-# These variables specify the names of the tables in the database
-# These should not need to be changed.  Please change $db_tbl_prefix
-# in the database section above.
-$tbl_area   = $db_tbl_prefix . "area";
-$tbl_entry  = $db_tbl_prefix . "entry";
-$tbl_repeat = $db_tbl_prefix . "repeat";
-$tbl_room   = $db_tbl_prefix . "room";
-$tbl_users  = $db_tbl_prefix . "users";
-
 ?>

