PageRenderTime 37ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/deletepost_form.php

https://github.com/NigelCunningham/moodle-mod_forumng
PHP | 53 lines | 16 code | 11 blank | 26 comment | 0 complexity | eb341a0393d10fab6bec6b57a1a32c7a MD5 | raw file
  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. require_once($CFG->libdir.'/formslib.php');
  17. /**
  18. * Form for sending an email to the author of a post when deleting
  19. * @package mod
  20. * @subpackage forumng
  21. * @copyright 2012 The Open University
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23. */
  24. class mod_forumng_deletepost_form extends moodleform {
  25. public function definition() {
  26. $mform =& $this->_form;
  27. $expand = $this->_customdata['expand'];
  28. //header
  29. $mform->addElement('header', 'general', get_string('deleteandemail', 'forumng'));
  30. //Message box
  31. $mform->addElement('editor', 'message',
  32. get_string('emailmessage', 'forumng'), array('size'=>'64', 'id' => 'id_forumng_delete_msg'));
  33. $mform->setType('message', PARAM_RAW);
  34. $mform->addRule('message', null, 'required', null, 'client');
  35. //Send a copy to self
  36. $mform->addElement('checkbox', 'copyself', get_string('copytoself', 'forumng'));
  37. //keep the expand status
  38. $mform->addElement('hidden', 'expand', $expand);
  39. // add some buttons
  40. $this->add_action_buttons(true, get_string('sendanddelete', 'forumng'));
  41. }
  42. }