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

/mod/feedback/item/label/label_form.php

https://bitbucket.org/moodle/moodle
PHP | 51 lines | 26 code | 11 blank | 14 comment | 0 complexity | d5082426244e0bcf5384479b143ebca3 MD5 | raw file
Possible License(s): Apache-2.0, LGPL-2.1, BSD-3-Clause, MIT, GPL-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. require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_form_class.php');
  17. class feedback_label_form extends feedback_item_form {
  18. protected $type = "label";
  19. private $area;
  20. public function definition() {
  21. global $CFG;
  22. $item = $this->_customdata['item'];
  23. $common = $this->_customdata['common'];
  24. $presentationoptions = $this->_customdata['presentationoptions'];
  25. $positionlist = $this->_customdata['positionlist'];
  26. $position = $this->_customdata['position'];
  27. $mform =& $this->_form;
  28. $mform->addElement('hidden', 'required', 0);
  29. $mform->setType('required', PARAM_INT);
  30. $mform->addElement('hidden', 'name', 'label');
  31. $mform->setType('template', PARAM_ALPHA);
  32. $mform->addElement('hidden', 'label', '');
  33. $mform->setType('label', PARAM_ALPHA);
  34. $mform->addElement('header', 'general', get_string($this->type, 'feedback'));
  35. $mform->addElement('editor', 'presentation_editor', get_string('labelcontents', 'feedback'), null, $presentationoptions);
  36. $mform->setType('presentation_editor', PARAM_RAW);
  37. parent::definition();
  38. $this->set_data($item);
  39. }
  40. }