Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/calendar/preferences_form.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00029 if (!defined('MOODLE_INTERNAL')) {
00030     die('Direct access to this script is forbidden.');    
00031 }
00032 
00033 require_once($CFG->dirroot.'/lib/formslib.php');
00034 
00041 class calendar_preferences_form extends moodleform {
00042 
00043     function definition() {
00044         $mform = $this->_form;
00045 
00046         $options = array(
00047             '0'  =>             get_string('default', 'calendar'),
00048             CALENDAR_TF_12 =>   get_string('timeformat_12', 'calendar'),
00049             CALENDAR_TF_24 =>   get_string('timeformat_24', 'calendar')
00050         );
00051         $mform->addElement('select', 'timeformat', get_string('pref_timeformat', 'calendar'), $options);
00052         $mform->addHelpButton('timeformat', 'pref_timeformat', 'calendar');
00053 
00054         $options = array(
00055             0 => get_string('sunday', 'calendar'),
00056             1 => get_string('monday', 'calendar'),
00057             2 => get_string('tuesday', 'calendar'),
00058             3 => get_string('wednesday', 'calendar'),
00059             4 => get_string('thursday', 'calendar'),
00060             5 => get_string('friday', 'calendar'),
00061             6 => get_string('saturday', 'calendar')
00062         );
00063         $mform->addElement('select', 'startwday', get_string('pref_startwday', 'calendar'), $options);
00064         $mform->addHelpButton('startwday', 'pref_startwday', 'calendar');
00065 
00066         $options = array();
00067         for ($i=1; $i<=20; $i++) {
00068             $options[$i] = $i;
00069         }
00070         $mform->addElement('select', 'maxevents', get_string('pref_maxevents', 'calendar'), $options);
00071         $mform->addHelpButton('maxevents', 'pref_maxevents', 'calendar');
00072 
00073         $options = array();
00074         for ($i=1; $i<=99; $i++) {
00075             $options[$i] = $i;
00076         }
00077         $mform->addElement('select', 'lookahead', get_string('pref_lookahead', 'calendar'), $options);
00078         $mform->addHelpButton('lookahead', 'pref_lookahead', 'calendar');
00079 
00080         $options = array(
00081             0 => get_string('no'),
00082             1 => get_string('yes')
00083         );
00084         $mform->addElement('select', 'persistflt', get_string('pref_persistflt', 'calendar'), $options);
00085         $mform->addHelpButton('persistflt', 'pref_persistflt', 'calendar');
00086 
00087         $this->add_action_buttons(false, get_string('savechanges'));
00088     }
00089 
00090 }
 All Data Structures Namespaces Files Functions Variables Enumerations