]> git.mjollnir.org Git - moodle.git/commitdiff
calendar admin page cleaned up
authorvinkmar <vinkmar>
Thu, 28 Sep 2006 04:46:09 +0000 (04:46 +0000)
committervinkmar <vinkmar>
Thu, 28 Sep 2006 04:46:09 +0000 (04:46 +0000)
admin/settings/appearance.php
lang/en_utf8/admin.php
lib/adminlib.php

index 3456215c08daeca33227b381f51f13d73b3c7498..9ad068316928ac7e3fb38bfabe9f576bb0973168 100644 (file)
@@ -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'));
index 286f2c99c32799a6cf701a9c95bbf77099b54f1f..7e32d0c65b548e2f6c207c7784191828ac8b5db9 100644 (file)
@@ -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';
index 3ea4231d5c6cded68dbf043069affbdfcead58dc..cc147fea1387039758b7f430b366828c20206ea8 100644 (file)
@@ -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 = '<table><tr><td><div align="center">&nbsp;&nbsp;' . get_string('sunday', 'calendar') . '&nbsp;&nbsp;</div></td><td><div align="center">&nbsp;&nbsp;' .
         get_string('monday', 'calendar') . '&nbsp;&nbsp;</div></td><td><div align="center">&nbsp;&nbsp;' . get_string('tuesday', 'calendar') . '&nbsp;&nbsp;</div></td><td><div align="center">&nbsp;&nbsp;' .
         get_string('wednesday', 'calendar') . '&nbsp;&nbsp;</div></td><td><div align="center">&nbsp;&nbsp;' . get_string('thursday', 'calendar') . '&nbsp;&nbsp;</div></td><td><div align="center">&nbsp;&nbsp;' .