Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/admin/tool/qeupgradehelper/cronsetup_form.php
Go to the documentation of this file.
00001 <?php
00002 // This file is part of Moodle - http://moodle.org/
00003 //
00004 // Moodle is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // Moodle is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00016 
00027 defined('MOODLE_INTERNAL') || die();
00028 
00029 require_once($CFG->libdir . '/formslib.php');
00030 
00031 
00037 class tool_qeupgradehelper_cron_setup_form extends moodleform {
00038     public function definition() {
00039         $mform = $this->_form;
00040 
00041         $mform->addElement('selectyesno', 'cronenabled',
00042                 get_string('cronenabled', 'tool_qeupgradehelper'));
00043 
00044         $mform->addElement('select', 'starthour',
00045                 get_string('cronstarthour', 'tool_qeupgradehelper'), range(0, 23));
00046 
00047         $mform->addElement('select', 'stophour',
00048                 get_string('cronstophour', 'tool_qeupgradehelper'),
00049                 array_combine(range(1, 24), range(1, 24)));
00050         $mform->setDefault('stophour', 24);
00051 
00052         $mform->addElement('duration', 'procesingtime',
00053                 get_string('cronprocesingtime', 'tool_qeupgradehelper'));
00054         $mform->setDefault('procesingtime', 60);
00055 
00056         $mform->disabledIf('starthour', 'cronenabled', 'eq', 0);
00057         $mform->disabledIf('stophour', 'cronenabled', 'eq', 0);
00058         $mform->disabledIf('procesingtime', 'cronenabled', 'eq', 0);
00059 
00060         $this->add_action_buttons();
00061     }
00062 }
 All Data Structures Namespaces Files Functions Variables Enumerations