. /** * Settings form for cronsetup.php. * * @package tool * @subpackage qeupgradehelper * @copyright 2011 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once($CFG->libdir . '/formslib.php'); /** * Cron setup form. * @copyright 2011 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class tool_qeupgradehelper_cron_setup_form extends moodleform { public function definition() { $mform = $this->_form; $mform->addElement('selectyesno', 'cronenabled', get_string('cronenabled', 'tool_qeupgradehelper')); $mform->addElement('select', 'starthour', get_string('cronstarthour', 'tool_qeupgradehelper'), range(0, 23)); $mform->addElement('select', 'stophour', get_string('cronstophour', 'tool_qeupgradehelper'), array_combine(range(1, 24), range(1, 24))); $mform->setDefault('stophour', 24); $mform->addElement('duration', 'procesingtime', get_string('cronprocesingtime', 'tool_qeupgradehelper')); $mform->setDefault('procesingtime', 60); $mform->disabledIf('starthour', 'cronenabled', 'eq', 0); $mform->disabledIf('stophour', 'cronenabled', 'eq', 0); $mform->disabledIf('procesingtime', 'cronenabled', 'eq', 0); $this->add_action_buttons(); } }