Merge branch 'MDL-27675_master' of git://github.com/grabs/moodle
[moodle.git] / mod / feedback / item / label / label_form.php
CommitLineData
6ee09cfe 1<?php
9c5bc7a5
AG
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/>.
6ee09cfe 16
a627a9c1 17require_once($CFG->dirroot.'/mod/feedback/item/feedback_item_form_class.php');
6ee09cfe 18
a627a9c1 19class feedback_label_form extends feedback_item_form {
9c5bc7a5
AG
20 protected $type = "label";
21 private $area;
1adbd2c3 22
9c5bc7a5 23 public function definition() {
a59ff6b0 24 global $CFG;
9c5bc7a5 25
a59ff6b0
AG
26 $item = $this->_customdata['item'];
27 $common = $this->_customdata['common'];
28 $presentationoptions = $this->_customdata['presentationoptions'];
29 $positionlist = $this->_customdata['positionlist'];
30 $position = $this->_customdata['position'];
9c5bc7a5 31
a59ff6b0
AG
32 $context = get_context_instance(CONTEXT_MODULE, $common['cmid']);
33
6ee09cfe 34 $mform =& $this->_form;
1adbd2c3 35
a59ff6b0
AG
36 $mform->addElement('hidden', 'required', 0);
37 $mform->setType('required', PARAM_INT);
38 $mform->addElement('hidden', 'name', 'label');
39 $mform->setType('template', PARAM_ALPHA);
40 $mform->addElement('hidden', 'label', '-');
41 $mform->setType('label', PARAM_ALPHA);
9c5bc7a5 42
6ee09cfe 43 $mform->addElement('header', 'general', get_string($this->type, 'feedback'));
a59ff6b0 44 $mform->addElement('editor', 'presentation_editor', '', null, $presentationoptions);
bf4fb3b3 45 $mform->setType('presentation_editor', PARAM_RAW);
9c5bc7a5 46
5e97c34d 47 parent::definition();
a59ff6b0 48 $this->set_data($item);
51859310 49
d185ff44
SH
50 }
51
6ee09cfe 52}
1adbd2c3 53