Merged branch 's9_MDL-26392_wiki_files_master' from git://github.com/dongsheng/moodle...
[moodle.git] / question / move_form.php
CommitLineData
aeb15530 1<?php
d1b7e03d
TH
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
d1b7e03d
TH
17/**
18 * Form for moving questions between categories.
19 *
017bc1d9 20 * @package moodlecore
d1b7e03d 21 * @subpackage questionbank
017bc1d9
TH
22 * @copyright 2008 The Open University
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
d1b7e03d
TH
24 */
25
017bc1d9 26
a17b297d 27defined('MOODLE_INTERNAL') || die();
bfebaf64 28
017bc1d9 29require_once($CFG->libdir . '/formslib.php');
515ed4c3 30
017bc1d9
TH
31
32/**
33 * Form for moving questions between categories.
34 *
35 * @copyright 2008 The Open University
36 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
37 */
515ed4c3 38class question_move_form extends moodleform {
c7df5006 39 protected function definition() {
d1b7e03d 40 $mform = $this->_form;
515ed4c3 41
d1b7e03d
TH
42 $currentcat = $this->_customdata['currentcat'];
43 $contexts = $this->_customdata['contexts'];
515ed4c3 44
5e8a85aa 45 $mform->addElement('questioncategory', 'category', get_string('category', 'question'), compact('contexts', 'currentcat'));
515ed4c3 46
5e8a85aa 47 $this->add_action_buttons(true, get_string('categorymoveto', 'question'));
d1b7e03d 48
515ed4c3 49 $mform->addElement('hidden', 'delete', $currentcat);
d18e0fe6 50 $mform->setType('delete', PARAM_INT);
515ed4c3 51 }
52}