MDL-54708 message: notification popover respects message preferences
[moodle.git] / message / send_form.php
CommitLineData
8bdc9cac 1<?php
6fbd60ef
AD
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.
13//
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/>.
16
17/**
18 * Contains the definition of the form used to send messages
19 *
20 * @package core_message
21 * @copyright 2009 Sam Hemelryk
22 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
23 */
bfebaf64
MD
24if (!defined('MOODLE_INTERNAL')) {
25 die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
26}
27
8bdc9cac
SH
28require_once($CFG->dirroot.'/lib/formslib.php');
29
6fbd60ef
AD
30/**
31 * The form used by users to send instant messages
32 *
33 * @package core_message
34 * @copyright 2009 Sam Hemelryk
35 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
36 */
8bdc9cac
SH
37class send_form extends moodleform {
38
6fbd60ef
AD
39 /**
40 * Define the mform elements required
41 */
8bdc9cac
SH
42 function definition () {
43
44 $mform =& $this->_form;
45
c8621a02
AD
46 $editoroptions = array();
47
48 //width handled by css so cols is empty. Still present so the page validates.
49 $displayoptions = array('rows'=>'4', 'cols'=>'', 'class'=>'messagesendbox');
8bdc9cac
SH
50
51 $mform->addElement('hidden', 'id');
52 $mform->setType('id', PARAM_INT);
8f0137e1
MG
53 $mform->addElement('hidden', 'viewing');
54 $mform->setType('viewing', PARAM_ALPHANUMEXT);
8bdc9cac 55
b71afc0d 56 $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions);
8bdc9cac
SH
57
58 $this->add_action_buttons(false, get_string('sendmessage', 'message'));
8bdc9cac 59 }
8bdc9cac
SH
60}
61
bfebaf64 62?>