MDL-42737 ActionMenu: Close the menu after selecting actions
[moodle.git] / message / send_form.php
blob11780dacc756367675dff5a0d48eaf81eff9ac5c
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);
53 $mform->addElement('hidden', 'viewing');
54 $mform->setType('viewing', PARAM_ALPHANUMEXT);
56 $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions);
58 $this->add_action_buttons(false, get_string('sendmessage', 'message'));