Merge branch 'MDL-63739-master' of git://github.com/jleyva/moodle
[moodle.git] / blocks / navigation / edit_form.php
blob9db482af6f9a49280638881b73bdb54096cd40dc
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.
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/>.
17 /**
18 * Form for editing global navigation instances.
20 * @since Moodle 2.0
21 * @package block_navigation
22 * @copyright 2009 Sam Hemelryk
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 /**
27 * Form for editing global navigation instances.
29 * @package block_navigation
30 * @category navigation
31 * @copyright 2009 Sam Hemelryk
32 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
34 class block_navigation_edit_form extends block_edit_form {
35 /**
36 * @param MoodleQuickForm $mform
38 protected function specific_definition($mform) {
39 global $CFG;
40 $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
42 $mods = array('enabledock'=>'yes', 'linkcategories'=>'no');
43 $yesnooptions = array('yes'=>get_string('yes'), 'no'=>get_string('no'));
44 foreach ($mods as $modname=>$default) {
45 $mform->addElement('select', 'config_'.$modname, get_string($modname.'desc', $this->block->blockname), $yesnooptions);
46 $mform->setDefault('config_'.$modname, $default);
49 $options = array(
50 block_navigation::TRIM_RIGHT => get_string('trimmoderight', $this->block->blockname),
51 block_navigation::TRIM_LEFT => get_string('trimmodeleft', $this->block->blockname),
52 block_navigation::TRIM_CENTER => get_string('trimmodecenter', $this->block->blockname)
54 $mform->addElement('select', 'config_trimmode', get_string('trimmode', $this->block->blockname), $options);
55 $mform->setType('config_trimmode', PARAM_INT);
57 $mform->addElement('text', 'config_trimlength', get_string('trimlength', $this->block->blockname));
58 $mform->setDefault('config_trimlength', 50);
59 $mform->setType('config_trimlength', PARAM_INT);
61 $options = array(
62 0 => get_string('everything', $this->block->blockname),
63 global_navigation::TYPE_COURSE => get_string('courses', $this->block->blockname),
64 global_navigation::TYPE_SECTION => get_string('coursestructures', $this->block->blockname),
65 global_navigation::TYPE_ACTIVITY => get_string('courseactivities', $this->block->blockname)
67 $mform->addElement('select', 'config_expansionlimit', get_string('expansionlimit', $this->block->blockname), $options);
68 $mform->setType('config_expansionlimit', PARAM_INT);