|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 // This file is part of Moodle - http://moodle.org/ 00003 // 00004 // Moodle is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // Moodle is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00016 00024 defined('MOODLE_INTERNAL') || die(); 00025 00026 require_once($CFG->dirroot . '/lib/formslib.php'); 00027 00031 class tool_customlang_filter_form extends moodleform { 00032 00033 function definition() { 00034 $mform = $this->_form; 00035 $current = $this->_customdata['current']; 00036 00037 $mform->addElement('header', 'filtersettings', get_string('filter', 'tool_customlang')); 00038 00039 // Component 00040 $options = array(); 00041 foreach (tool_customlang_utils::list_components() as $component => $normalized) { 00042 list($type, $plugin) = normalize_component($normalized); 00043 if ($type == 'core' and is_null($plugin)) { 00044 $plugin = 'moodle'; 00045 } 00046 $options[$type][$normalized] = $component.'.php'; 00047 } 00048 $mform->addElement('selectgroups', 'component', get_string('filtercomponent', 'tool_customlang'), $options, 00049 array('multiple'=>'multiple', 'size'=>7)); 00050 00051 // Customized only 00052 $mform->addElement('advcheckbox', 'customized', get_string('filtercustomized', 'tool_customlang')); 00053 $mform->setType('customized', PARAM_BOOL); 00054 $mform->setDefault('customized', 0); 00055 00056 // Only helps 00057 $mform->addElement('advcheckbox', 'helps', get_string('filteronlyhelps', 'tool_customlang')); 00058 $mform->setType('helps', PARAM_BOOL); 00059 $mform->setDefault('helps', 0); 00060 00061 // Modified only 00062 $mform->addElement('advcheckbox', 'modified', get_string('filtermodified', 'tool_customlang')); 00063 $mform->setType('filtermodified', PARAM_BOOL); 00064 $mform->setDefault('filtermodified', 0); 00065 00066 // Substring 00067 $mform->addElement('text', 'substring', get_string('filtersubstring', 'tool_customlang')); 00068 $mform->setType('substring', PARAM_RAW); 00069 00070 // String identifier 00071 $mform->addElement('text', 'stringid', get_string('filterstringid', 'tool_customlang')); 00072 $mform->setType('stringid', PARAM_STRINGID); 00073 00074 // Show strings - submit button 00075 $mform->addElement('submit', 'submit', get_string('filtershowstrings', 'tool_customlang')); 00076 } 00077 } 00078