PageRenderTime 40ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/mod/lesson/view_form.php

https://bitbucket.org/synergylearning/campusconnect
PHP | 72 lines | 24 code | 17 blank | 31 comment | 3 complexity | c83bcfd29d07d007e3e74b61e6af5ba9 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, LGPL-3.0, GPL-3.0, LGPL-2.1, Apache-2.0, BSD-3-Clause, AGPL-3.0
  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. * Lesson page without answers
  18. *
  19. * @package mod
  20. * @subpackage lesson
  21. * @copyright 2009 Sam Hemelryk
  22. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23. **/
  24. defined('MOODLE_INTERNAL') || die();
  25. /**
  26. * Include formslib if it has not already been included
  27. */
  28. require_once($CFG->libdir.'/formslib.php');
  29. /**
  30. * Lesson page without answers
  31. *
  32. * @copyright 2009 Sam Hemelryk
  33. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  34. **/
  35. class lesson_page_without_answers extends moodleform {
  36. public function definition() {
  37. global $OUTPUT;
  38. $mform = $this->_form;
  39. $title = $this->_customdata['title'];
  40. $contents = $this->_customdata['contents'];
  41. if (!empty($title)) {
  42. $mform->addElement('header', 'pageheader', $title);
  43. }
  44. if (!empty($contents)) {
  45. $mform->addElement('html', $OUTPUT->box($contents, 'contents'));
  46. }
  47. $mform->addElement('hidden', 'id');
  48. $mform->setType('id', PARAM_INT);
  49. $mform->addElement('hidden', 'pageid');
  50. $mform->setType('pageid', PARAM_INT);
  51. $mform->addElement('hidden', 'newpageid');
  52. $mform->setType('newpageid', PARAM_INT);
  53. $this->add_action_buttons(null, get_string("continue", "lesson"));
  54. }
  55. }