|
Moodle
2.2.1
http://www.collinsharper.com
|
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 send_form extends moodleform { 00010 00011 function definition () { 00012 00013 $mform =& $this->_form; 00014 00015 //$editoroptions = array('maxfiles'=>0, 'maxbytes'=>0, 'trusttext'=>false); 00016 $editoroptions = array(); 00017 00018 //width handled by css so cols is empty. Still present so the page validates. 00019 $displayoptions = array('rows'=>'4', 'cols'=>'', 'class'=>'messagesendbox'); 00020 00021 $mform->addElement('hidden', 'id'); 00022 $mform->setType('id', PARAM_INT); 00023 00024 //$mform->addElement('html', '<div class="message-send-box">'); 00025 $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions); 00026 //$mform->addElement('editor', 'message_editor', get_string('message', 'message'), null, $editoroptions); 00027 //$mform->addElement('html', '</div>'); 00028 00029 $this->add_action_buttons(false, get_string('sendmessage', 'message')); 00030 } 00031 00037 function set_data($data) { 00038 00039 //$data->message = array('text'=>$data->message, 'format'=>$data->messageformat); 00040 00041 parent::set_data($data); 00042 } 00043 00049 function get_data() { 00050 $data = parent::get_data(); 00051 00052 /*if ($data !== null) { 00053 //$data->messageformat = $data->message_editor['format']; 00054 //$data->message = clean_text($data->message_editor['text'], $data->messageformat); 00055 }*/ 00056 00057 return $data; 00058 } 00059 00067 //function reset_message() { 00068 //$this->_form->_elements[$this->_form->_elementIndex['message']]->setValue(array('text'=>'')); 00069 //} 00070 00071 } 00072 00073 ?>