-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod_form.php
31 lines (22 loc) · 1004 Bytes
/
mod_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
<?php
defined('MOODLE_INTERNAL') || die();
require_once($CFG->dirroot . '/course/moodleform_mod.php');
class mod_testingdemo_mod_form extends moodleform_mod {
public function definition() {
global $CFG, $COURSE;
$mform = $this->_form;
$mform->addElement('header', 'general', get_string('general', 'form'));
$mform->addElement('text', 'name', get_string('name', 'testingdemo'), array('size'=>'64'));
if (!empty($CFG->formatstringstriptags)) {
$mform->setType('name', PARAM_TEXT);
} else {
$mform->setType('name', PARAM_CLEANHTML);
}
$mform->addRule('name', null, 'required', null, 'client');
$mform->addRule('name', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
$this->add_intro_editor(true, get_string('description', 'testingdemo'));
$this->standard_coursemodule_elements();
$this->apply_admin_defaults();
$this->add_action_buttons();
}
}