[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/message/ -> send_form.php (source)

   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  /**
  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   */
  24  if (!defined('MOODLE_INTERNAL')) {
  25      die('Direct access to this script is forbidden.');    ///  It must be included from a Moodle page
  26  }
  27  
  28  require_once($CFG->dirroot.'/lib/formslib.php');
  29  
  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   */
  37  class send_form extends moodleform {
  38  
  39      /**
  40       * Define the mform elements required
  41       */
  42      function definition () {
  43  
  44          $mform =& $this->_form;
  45  
  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');
  50  
  51          $mform->addElement('hidden', 'id');
  52          $mform->setType('id', PARAM_INT);
  53          $mform->addElement('hidden', 'viewing');
  54          $mform->setType('viewing', PARAM_ALPHANUMEXT);
  55  
  56          $mform->addElement('textarea', 'message', get_string('message', 'message'), $displayoptions, $editoroptions);
  57  
  58          $this->add_action_buttons(false, get_string('sendmessage', 'message'));
  59      }
  60  }
  61  
  62  ?>


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1