forked from danmarsden/moodle_mod_attforblock_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathduration_form.php
48 lines (35 loc) · 1.81 KB
/
duration_form.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php // $Id: duration_form.php,v 1.3.2.2 2009/02/23 19:22:42 dlnsk Exp $
require_once($CFG->libdir.'/formslib.php');
class mod_attforblock_duration_form extends moodleform {
function definition() {
global $CFG;
$mform =& $this->_form;
$course = $this->_customdata['course'];
$cm = $this->_customdata['cm'];
$modcontext = $this->_customdata['modcontext'];
$ids = $this->_customdata['ids'];
$mform->addElement('header', 'general', get_string('changeduration','attforblock'));
$mform->addElement('static', 'count', get_string('countofselected','attforblock'), count(explode('_', $ids)));
for ($i=0; $i<=23; $i++) {
$hours[$i] = sprintf("%02d",$i);
}
for ($i=0; $i<60; $i+=5) {
$minutes[$i] = sprintf("%02d",$i);
}
$durselect[] =& MoodleQuickForm::createElement('select', 'hours', '', $hours);
$durselect[] =& MoodleQuickForm::createElement('select', 'minutes', '', $minutes, false, true);
$mform->addGroup($durselect, 'durtime', get_string('newduration','attforblock'), array(' '), true);
$mform->addElement('hidden', 'ids', $ids);
$mform->addElement('hidden', 'id', $cm->id);
$mform->addElement('hidden', 'action', 'changeduration');
$mform->setDefaults(array('durtime' => array('hours'=>0, 'minutes'=>0)));
//-------------------------------------------------------------------------------
// buttons
$submit_string = get_string('update', 'attforblock');
$this->add_action_buttons(true, $submit_string);
// $mform->addElement('hidden', 'id', $cm->id);
// $mform->addElement('hidden', 'sessionid', $sessionid);
// $mform->addElement('hidden', 'action', 'changeduration');
}
}
?>