MDL-22388 Added some checks to kill these scripts dead with an unequivocal notice...
[moodle.git] / mod / wiki / comments_form.php
1 <?php
3 if (!defined('MOODLE_INTERNAL')) {
4     die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
5 }
7 require_once($CFG->dirroot . '/lib/formslib.php');
9 class mod_wiki_comments_form extends moodleform {
10     function definition() {
11         $pageid = optional_param('pageid', 0, PARAM_INT);
12         $mform =& $this->_form;
14         $current = $this->_customdata['current'];
15         $commentoptions = $this->_customdata['commentoptions'];
17         // visible elements
18         $mform->addElement('editor', 'entrycomment_editor', get_string('comment', 'glossary'), null, $commentoptions);
19         $mform->addRule('entrycomment_editor', get_string('required'), 'required', null, 'client');
20         $mform->setType('entrycomment_editor', PARAM_RAW); // processed by trust text or cleaned before the display
22         // hidden optional params
23         $mform->addElement('hidden', 'id', '');
24         $mform->setType('id', PARAM_INT);
26         $mform->addElement('hidden', 'action', '');
27         $mform->setType('action', PARAM_ACTION);
29         //-------------------------------------------------------------------------------
30         // buttons
31         $this->add_action_buttons(false);
33         //-------------------------------------------------------------------------------
34         $this->set_data($current);
35     }
37     public function edit_definition($current, $commentoptions) {
38         $this->set_data($current);
39         $this->set_data($commentoptions);
40     }
41 }