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

/mod/feedback/use_templ_form.php

https://bitbucket.org/moodle/moodle
PHP | 121 lines | 45 code | 14 blank | 62 comment | 1 complexity | 4222caec0714c28ff67ed41c82efd542 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. /**
  17. * prints the form to confirm use template
  18. *
  19. * @author Andreas Grabs
  20. * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
  21. * @package mod_feedback
  22. */
  23. if (!defined('MOODLE_INTERNAL')) {
  24. die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
  25. }
  26. require_once($CFG->libdir.'/formslib.php');
  27. /**
  28. * The mod_feedback_use_templ_form
  29. *
  30. * @deprecated since 4.0. New dynamic forms have been created instead.
  31. */
  32. class mod_feedback_use_templ_form extends moodleform {
  33. public function __construct($action = null, $customdata = null, $method = 'post', $target = '',
  34. $attributes = null, $editable = true, $ajaxformdata = null) {
  35. debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
  36. parent::__construct($action, $customdata, $method, $target, $attributes, $editable, $ajaxformdata);
  37. }
  38. public function definition() {
  39. $mform =& $this->_form;
  40. // visible elements
  41. $mform->addElement('radio', 'deleteolditems', '', get_string('delete_old_items', 'feedback'), 1);
  42. $mform->addElement('radio', 'deleteolditems', '', get_string('append_new_items', 'feedback'), 0);
  43. $mform->setType('deleteolditems', PARAM_INT);
  44. $mform->setDefault('deleteolditems', 1);
  45. // hidden elements
  46. $mform->addElement('hidden', 'id');
  47. $mform->setType('id', PARAM_INT);
  48. $mform->addElement('hidden', 'templateid');
  49. $mform->setType('templateid', PARAM_INT);
  50. $mform->addElement('hidden', 'do_show');
  51. $mform->setType('do_show', PARAM_INT);
  52. $mform->setConstant('do_show', 'edit');
  53. //-------------------------------------------------------------------------------
  54. // buttons
  55. $this->add_action_buttons();
  56. }
  57. /**
  58. * Overrides parent static method for deprecation purposes.
  59. *
  60. * @deprecated since 4.0
  61. * @return array
  62. */
  63. public static function get_js_module() {
  64. debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
  65. return parent::get_js_module();
  66. }
  67. /**
  68. * Overrides parent static method for deprecation purposes.
  69. *
  70. * @deprecated since 4.0
  71. * @param array $simulatedsubmitteddata
  72. * @param array $simulatedsubmittedfiles
  73. * @param string $method
  74. * @param null $formidentifier
  75. * @return array
  76. */
  77. public static function mock_ajax_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(),
  78. $method = 'post', $formidentifier = null) {
  79. debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
  80. return parent::mock_ajax_submit($simulatedsubmitteddata, $simulatedsubmittedfiles, $method, $formidentifier);
  81. }
  82. /**
  83. * Overrides parent static method for deprecation purposes.
  84. *
  85. * @deprecated since 4.0
  86. * @param array $data
  87. * @return array
  88. */
  89. public static function mock_generate_submit_keys($data = []) {
  90. debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
  91. return parent::mock_generate_submit_keys($data);
  92. }
  93. /**
  94. * Overrides parent static method for deprecation purposes.
  95. *
  96. * @deprecated since 4.0
  97. * @param array $simulatedsubmitteddata
  98. * @param array $simulatedsubmittedfiles
  99. * @param string $method
  100. * @param null $formidentifier
  101. */
  102. public static function mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles = array(),
  103. $method = 'post', $formidentifier = null) {
  104. debugging('Class mod_feedback_use_templ_form is deprecated. Replaced with dynamic forms.', DEBUG_DEVELOPER);
  105. parent::mock_submit($simulatedsubmitteddata, $simulatedsubmittedfiles, $method, $formidentifier);
  106. }
  107. }