Moodle  2.2.1
http://www.collinsharper.com
C:/xampp/htdocs/moodle/blocks/glossary_random/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 
00032 class block_glossary_random_edit_form extends block_edit_form {
00033     protected function specific_definition($mform) {
00034         global $DB;
00035 
00036         // Fields for editing HTML block title and contents.
00037         $mform->addElement('header', 'configheader', get_string('blocksettings', 'block'));
00038 
00039         $mform->addElement('text', 'config_title', get_string('title', 'block_glossary_random'));
00040         $mform->setDefault('config_title', get_string('pluginname','block_glossary_random'));
00041         $mform->setType('config_title', PARAM_MULTILANG);
00042 
00043         // Select glossaries to put in dropdown box ...
00044         $glossaries = $DB->get_records_menu('glossary', array('course' => $this->block->course->id), 'name', 'id,name');
00045         foreach($glossaries as $key => $value) {
00046             $glossaries[$key] = strip_tags(format_string($value, true));
00047         }
00048         $mform->addElement('select', 'config_glossary', get_string('select_glossary', 'block_glossary_random'), $glossaries);
00049 
00050         $mform->addElement('text', 'config_refresh', get_string('refresh', 'block_glossary_random'), array('size' => 5));
00051         $mform->setDefault('config_refresh', 0);
00052         $mform->setType('config_refresh', PARAM_INTEGER);
00053 
00054         // and select quotetypes to put in dropdown box
00055         $types = array(
00056             0 => get_string('random','block_glossary_random'),
00057             1 => get_string('lastmodified','block_glossary_random'),
00058             2 => get_string('nextone','block_glossary_random')
00059         );
00060         $mform->addElement('select', 'config_type', get_string('type', 'block_glossary_random'), $types);
00061 
00062         $mform->addElement('selectyesno', 'config_showconcept', get_string('showconcept', 'block_glossary_random'));
00063         $mform->setDefault('config_showconcept', 1);
00064 
00065         $mform->addElement('static', 'footerdescription', '', get_string('whichfooter', 'block_glossary_random'));
00066 
00067         $mform->addElement('text', 'config_addentry', get_string('askaddentry', 'block_glossary_random'));
00068         $mform->setDefault('config_addentry', get_string('addentry', 'block_glossary_random'));
00069         $mform->setType('config_addentry', PARAM_NOTAGS);
00070 
00071         $mform->addElement('text', 'config_viewglossary', get_string('askviewglossary', 'block_glossary_random'));
00072         $mform->setDefault('config_viewglossary', get_string('viewglossary', 'block_glossary_random'));
00073         $mform->setType('config_viewglossary', PARAM_NOTAGS);
00074 
00075         $mform->addElement('text', 'config_invisible', get_string('askinvisible', 'block_glossary_random'));
00076         $mform->setDefault('config_invisible', get_string('invisible', 'block_glossary_random'));
00077         $mform->setType('config_invisible', PARAM_NOTAGS);
00078     }
00079 }
 All Data Structures Namespaces Files Functions Variables Enumerations