Merge branch 'wip-MDL-40700-m24' of git://github.com/samhemelryk/moodle into MOODLE_2...
[moodle.git] / message / send_form.php
blobc08aaa328783c8635a7fd7e7dbd21b121e7bc851
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.
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/>.
17 /**
18 * Contains the definition of the form used to send messages
20 * @package core_message
21 * @copyright 2009 Sam Hemelryk
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24 if (!defined('MOODLE_INTERNAL')) {
25 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
28 require_once($CFG->dirroot.'/lib/formslib.php');
30 /**
31 * The form used by users to send instant messages
33 * @package core_message
34 * @copyright 2009 Sam Hemelryk
35 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 class send_form extends moodleform {
39 /**
40 * Define the mform elements required
42 function definition () {
44 $mform =& $this->_form;
46 $editoroptions = array();
48 //width handled by css so cols is empty. Still present so the page validates.
49 $displayoptions = array('rows'=>'4', 'cols'=>'', 'class'=>'messagesendbox');
51 $mform->addElement('hidden', 'id');
52 $mform->setType('id', PARAM_INT);
54 $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions);
56 $this->add_action_buttons(false, get_string('sendmessage', 'message'));