Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

   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  require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_form_class.php');
  18  
  19  class feedback_info_form extends feedback_item_form {
  20      protected $type = "info";
  21  
  22      public function definition() {
  23  
  24          $item = $this->_customdata['item'];
  25          $common = $this->_customdata['common'];
  26          $positionlist = $this->_customdata['positionlist'];
  27          $position = $this->_customdata['position'];
  28          $presentationoptions = $this->_customdata['presentationoptions'];
  29  
  30          $mform =& $this->_form;
  31  
  32          $mform->addElement('header', 'general', get_string($this->type, 'feedback'));
  33          $mform->addElement('hidden', 'required', 0);
  34          $mform->setType('required', PARAM_INT);
  35  
  36          $mform->addElement('text',
  37                              'name',
  38                              get_string('item_name', 'feedback'),
  39                              array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
  40          $mform->addElement('text',
  41                              'label',
  42                              get_string('item_label', 'feedback'),
  43                              array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));
  44  
  45          $this->infotype = &$mform->addElement('select',
  46                                                'presentation',
  47                                                get_string('infotype', 'feedback'),
  48                                                $presentationoptions);
  49  
  50          parent::definition();
  51          $this->set_data($item);
  52  
  53      }
  54  }
  55