PageRenderTime 48ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 0ms

/message/send_form.php

https://bitbucket.org/andrewdavidson/sl-clone
PHP | 60 lines | 17 code | 11 blank | 32 comment | 1 complexity | b4a5fe4c4290385f54cbd4486db3b992 MD5 | raw file
Possible License(s): AGPL-3.0, MPL-2.0-no-copyleft-exception, LGPL-3.0, Apache-2.0, GPL-3.0, BSD-3-Clause, LGPL-2.1
  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.
  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. * Contains the definition of the form used to send messages
  18. *
  19. * @package core_message
  20. * @copyright 2009 Sam Hemelryk
  21. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  22. */
  23. if (!defined('MOODLE_INTERNAL')) {
  24. die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
  25. }
  26. require_once($CFG->dirroot.'/lib/formslib.php');
  27. /**
  28. * The form used by users to send instant messages
  29. *
  30. * @package core_message
  31. * @copyright 2009 Sam Hemelryk
  32. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  33. */
  34. class send_form extends moodleform {
  35. /**
  36. * Define the mform elements required
  37. */
  38. function definition () {
  39. $mform =& $this->_form;
  40. $editoroptions = array();
  41. //width handled by css so cols is empty. Still present so the page validates.
  42. $displayoptions = array('rows'=>'4', 'cols'=>'', 'class'=>'messagesendbox');
  43. $mform->addElement('hidden', 'id');
  44. $mform->setType('id', PARAM_INT);
  45. $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions);
  46. $this->add_action_buttons(false, get_string('sendmessage', 'message'));
  47. }
  48. }
  49. ?>