Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/mod/wiki/comments_form.php
Go to the documentation of this file.
00001 <?php
00002 
00003 if (!defined('MOODLE_INTERNAL')) {
00004     die('Direct access to this script is forbidden.');    
00005 }
00006 
00007 require_once($CFG->dirroot . '/lib/formslib.php');
00008 
00009 class mod_wiki_comments_form extends moodleform {
00010     function definition() {
00011         $pageid = optional_param('pageid', 0, PARAM_INT);
00012         $mform =& $this->_form;
00013 
00014         $current = $this->_customdata['current'];
00015         $commentoptions = $this->_customdata['commentoptions'];
00016 
00017         // visible elements
00018         $mform->addElement('editor', 'entrycomment_editor', get_string('comment', 'glossary'), null, $commentoptions);
00019         $mform->addRule('entrycomment_editor', get_string('required'), 'required', null, 'client');
00020         $mform->setType('entrycomment_editor', PARAM_RAW); // processed by trust text or cleaned before the display
00021 
00022         // hidden optional params
00023         $mform->addElement('hidden', 'id', '');
00024         $mform->setType('id', PARAM_INT);
00025 
00026         $mform->addElement('hidden', 'action', '');
00027         $mform->setType('action', PARAM_ACTION);
00028 
00029         //-------------------------------------------------------------------------------
00030         // buttons
00031         $this->add_action_buttons(false);
00032 
00033         //-------------------------------------------------------------------------------
00034         $this->set_data($current);
00035     }
00036 
00037     public function edit_definition($current, $commentoptions) {
00038         $this->set_data($current);
00039         $this->set_data($commentoptions);
00040     }
00041 }
00042 
 All Data Structures Namespaces Files Functions Variables Enumerations