Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402]

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