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] [Versions 400 and 402] [Versions 401 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  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      /** @var object Form element. */
  23      protected $infotype;
  24  
  25      public function definition() {
  26  
  27          $item = $this->_customdata['item'];
  28          $common = $this->_customdata['common'];
  29          $positionlist = $this->_customdata['positionlist'];
  30          $position = $this->_customdata['position'];
  31          $presentationoptions = $this->_customdata['presentationoptions'];
  32  
  33          $mform =& $this->_form;
  34  
  35          $mform->addElement('header', 'general', get_string($this->type, 'feedback'));
  36          $mform->addElement('hidden', 'required', 0);
  37          $mform->setType('required', PARAM_INT);
  38  
  39          $mform->addElement('text',
  40                              'name',
  41                              get_string('item_name', 'feedback'),
  42                              array('size'=>FEEDBACK_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255));
  43          $mform->addElement('text',
  44                              'label',
  45                              get_string('item_label', 'feedback'),
  46                              array('size'=>FEEDBACK_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255));
  47  
  48          $this->infotype = &$mform->addElement('select',
  49                                                'presentation',
  50                                                get_string('infotype', 'feedback'),
  51                                                $presentationoptions);
  52  
  53          parent::definition();
  54          $this->set_data($item);
  55  
  56      }
  57  }
  58