Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/blocks/navigation/edit_form.php
Go to the documentation of this file.
00001 <?php
00002 
00003 // This file is part of Moodle - http://moodle.org/
00004 //
00005 // Moodle is free software: you can redistribute it and/or modify
00006 // it under the terms of the GNU General Public License as published by
00007 // the Free Software Foundation, either version 3 of the License, or
00008 // (at your option) any later version.
00009 //
00010 // Moodle is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 // GNU General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU General Public License
00016 // along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
00017 
00034 class block_navigation_edit_form extends block_edit_form {
00038     protected function specific_definition($mform) {
00039         global $CFG;
00040         $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
00041 
00042         $mods = array('enabledock'=>'yes', 'linkcategories'=>'no');
00043         $yesnooptions = array('yes'=>get_string('yes'), 'no'=>get_string('no'));
00044         foreach ($mods as $modname=>$default) {
00045             $mform->addElement('select', 'config_'.$modname, get_string($modname.'desc', $this->block->blockname), $yesnooptions);
00046             $mform->setDefault('config_'.$modname, $default);
00047         }
00048 
00049         $options = array(
00050             block_navigation::TRIM_RIGHT => get_string('trimmoderight', $this->block->blockname),
00051             block_navigation::TRIM_LEFT => get_string('trimmodeleft', $this->block->blockname),
00052             block_navigation::TRIM_CENTER => get_string('trimmodecenter', $this->block->blockname)
00053         );
00054         $mform->addElement('select', 'config_trimmode', get_string('trimmode', $this->block->blockname), $options);
00055         $mform->setType('config_trimmode', PARAM_INT);
00056 
00057         $mform->addElement('text', 'config_trimlength', get_string('trimlength', $this->block->blockname));
00058         $mform->setDefault('config_trimlength', 50);
00059         $mform->setType('config_trimlength', PARAM_INT);
00060 
00061         $options = array(
00062             0 => get_string('everything', $this->block->blockname),
00063             global_navigation::TYPE_COURSE => get_string('courses', $this->block->blockname),
00064             global_navigation::TYPE_SECTION => get_string('coursestructures', $this->block->blockname),
00065             global_navigation::TYPE_ACTIVITY => get_string('courseactivities', $this->block->blockname)
00066         );
00067         $mform->addElement('select', 'config_expansionlimit', get_string('expansionlimit', $this->block->blockname), $options);
00068         $mform->setType('config_expansionlimit', PARAM_INT);
00069 
00070     }
00071 }
 All Data Structures Namespaces Files Functions Variables Enumerations