MDL-38373 Use correct PEAR->loadExtension()
[moodle.git] / mod / lesson / editpage_form.php
blob94064d1a362a2ba714532bc7a870bc81bb093d85
1 <?php
3 // This file is part of Moodle - http://moodle.org/
4 //
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 /**
19 * Generic forms used for page selection
21 * @package mod
22 * @subpackage lesson
23 * @copyright 2009 Sam Hemelryk
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 **/
27 defined('MOODLE_INTERNAL') || die();
29 /**
30 * Question selection form
32 * @copyright 2009 Sam Hemelryk
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 **/
35 class lesson_add_page_form_selection extends lesson_add_page_form_base {
37 public $qtype = 'questiontype';
38 public $qtypestring = 'selectaqtype';
39 protected $standard = false;
40 protected $manager = null;
42 public function __construct($arg1, $arg2) {
43 $this->manager = lesson_page_type_manager::get($arg2['lesson']);
44 parent::__construct($arg1, $arg2);
47 public function custom_definition() {
48 $mform = $this->_form;
49 $types = $this->manager->get_page_type_strings(lesson_page::TYPE_QUESTION);
50 asort($types);
51 $mform->addElement('select', 'qtype', get_string('selectaqtype', 'lesson'), $types);
52 $mform->setDefault('qtype', LESSON_PAGE_MULTICHOICE); // preselect the most common type
56 /**
57 * Dummy class to represent an unknown question type and direct to the selection
58 * form.
60 final class lesson_add_page_form_unknown extends lesson_add_page_form_base {}