From: vinkmar Date: Thu, 28 Sep 2006 04:46:09 +0000 (+0000) Subject: calendar admin page cleaned up X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=3b904bc94fad2124b6f6742ca4b260649da02a47;p=moodle.git calendar admin page cleaned up --- diff --git a/admin/settings/appearance.php b/admin/settings/appearance.php index 3456215c08..9ad0683169 100644 --- a/admin/settings/appearance.php +++ b/admin/settings/appearance.php @@ -41,7 +41,22 @@ $temp->add(new admin_setting_configtext('coursesperpage', get_string('coursesper $ADMIN->add('appearance', $temp); // calendar -$ADMIN->add('appearance', new admin_externalpage('calendar', get_string('calendarsettings', 'admin'), $CFG->wwwroot.'/'.$CFG->admin.'/calendar.php')); +$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin')); +$temp->add(new admin_setting_special_adminseesall()); +$temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0, +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') + ))); +$temp->add(new admin_setting_special_calendar_weekend()); +$temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT)); +$temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT)); +$ADMIN->add('appearance', $temp); // "filtersettings" settingpage $temp = new admin_settingpage('filtersettings', get_string('filtersettings', 'admin')); diff --git a/lang/en_utf8/admin.php b/lang/en_utf8/admin.php index 286f2c99c3..7e32d0c65b 100644 --- a/lang/en_utf8/admin.php +++ b/lang/en_utf8/admin.php @@ -164,7 +164,11 @@ $string['cleanup'] = 'Cleanup'; $string['longtimenosee'] = 'Unsubscribe users from courses after'; $string['deleteunconfirmed'] = 'Delete unconfirmed users after'; $string['loglifetime'] = 'Keep logs for'; - +$string['adminseesall'] = 'Admins See All'; +$string['configstartwday'] = 'Start of Week'; +$string['calendar_weekend'] = 'Weekend Days'; +$string['configlookahead'] = 'Days to Lookahead'; +$string['configmaxevents'] = 'Events to Lookahead'; // end {added with admin cleanup} $string['adminseesallevents'] = 'Administrators see all events'; diff --git a/lib/adminlib.php b/lib/adminlib.php index 3ea4231d5c..cc147fea13 100644 --- a/lib/adminlib.php +++ b/lib/adminlib.php @@ -2264,6 +2264,12 @@ class admin_setting_special_calendar_weekend extends admin_setting { $currentsetting = $this->get_setting(); } + foreach(array('u','m','t','w','r','f','s') as $element) { + if (!isset($currentsetting[$element])) { + $currentsetting[$element] = 0; + } + } + $return = '
  ' . get_string('sunday', 'calendar') . '  
  ' . get_string('monday', 'calendar') . '  
  ' . get_string('tuesday', 'calendar') . '  
  ' . get_string('wednesday', 'calendar') . '  
  ' . get_string('thursday', 'calendar') . '  
  ' .