Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
defined('MOODLE_INTERNAL') || die();
18
 
19
global $CFG;
20
 
21
require_once($CFG->libdir . '/formslib.php');
22
 
23
// Form to select start and end date ranges and session time.
24
class dedication_block_selection_form extends moodleform {
25
 
26
    public function definition() {
27
        $mform = & $this->_form;
28
 
29
        $mform->addElement('header', 'general', get_string('form', 'block_dedication'));
30
        $mform->addHelpButton('general', 'form', 'block_dedication');
31
 
32
        $mform->addElement('html', html_writer::tag('p', get_string('form_text', 'block_dedication')));
33
 
34
        $mform->addElement('date_time_selector', 'mintime', get_string('mintime', 'block_dedication'));
35
        $mform->addHelpButton('mintime', 'mintime', 'block_dedication');
36
 
37
        $mform->addElement('date_time_selector', 'maxtime', get_string('maxtime', 'block_dedication'));
38
        $mform->addHelpButton('maxtime', 'maxtime', 'block_dedication');
39
 
40
        $limitoptions = array();
41
        for ($i = 1; $i <= 150; $i++) {
42
            $limitoptions[$i * 60] = $i;
43
        }
44
        $mform->addElement('select', 'limit', get_string('limit', 'block_dedication'), $limitoptions);
45
        $mform->addHelpButton('limit', 'limit', 'block_dedication');
46
 
47
        // Buttons.
48
        $this->add_action_buttons(false, get_string('submit', 'block_dedication'));
49
    }
50
 
51
}