Moodle plugin, allowing collaborative annotations in PDF files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

73 lines
2.5 KiB

  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. * @package mod_pdfannotator
  18. * @copyright 2018 RWTH Aachen, Anna Heynkes (see README.md)
  19. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  20. *
  21. */
  22. defined('MOODLE_INTERNAL') || die();
  23. require_once($CFG->libdir . '/formslib.php');
  24. /**
  25. * Description of reportform
  26. *
  27. * @author Admin
  28. */
  29. class pdfannotator_reportform extends moodleform {
  30. public function definition() {
  31. global $CFG;
  32. $mform = $this->_form; // Don't forget the underscore!
  33. // Pass contextual parameters to the form (via set_data() in controller.php)
  34. // Course module id.
  35. $mform->addElement('hidden', 'id');
  36. $mform->setType('id', PARAM_INT);
  37. // Course id.
  38. $mform->addElement('hidden', 'course');
  39. $mform->setType('course', PARAM_INT);
  40. // Pdf id.
  41. $mform->addElement('hidden', 'pdfannotatorid');
  42. $mform->setType('pdfannotatorid', PARAM_INT);
  43. // Pdfname.
  44. $mform->addElement('hidden', 'pdfname');
  45. $mform->setType('pdfname', PARAM_TEXT);
  46. // Comment id.
  47. $mform->addElement('hidden', 'commentid');
  48. $mform->setType('commentid', PARAM_INT);
  49. // Action = 'report'.
  50. $mform->addElement('hidden', 'action');
  51. $mform->setType('action', PARAM_ALPHA);
  52. // Add a headline.
  53. $mform->addElement('header', 'bookwithmessagetitle', get_string('subtitleforreportcommentform', 'pdfannotator'));
  54. // Add a textarea for explaining the reason of complaint.
  55. $mform->addElement('textarea', 'message', get_string('reason', 'pdfannotator'), 'wrap="virtual" rows="5'
  56. . '" cols="109"');
  57. // Add submit and cancel buttons.
  58. $this->add_action_buttons($cancel = true, get_string('reportsendbutton', 'pdfannotator'));
  59. }
  60. public function display() {
  61. $this->_form->display();
  62. }
  63. }