Replaced optional_var with optional_param

This commit is contained in:
moodler 2005-12-07 06:21:58 +00:00
parent 3a6b53e80d
commit aa8139414e
18 changed files with 85 additions and 90 deletions

View file

@ -4,21 +4,20 @@
require_once("lib.php");
require_once("$CFG->libdir/rsslib.php");
optional_variable($id); // Course Module ID
optional_variable($g); // Glossary ID
$id = optional_param('id', 0, PARAM_INT); // Course Module ID
$g = optional_param('g', 0, PARAM_INT); // Glossary ID
optional_variable($tab,GLOSSARY_NO_VIEW); // browsing entries by categories?
$tab = optional_param('tab', GLOSSARY_NO_VIEW, PARAM_ALPHA); // browsing entries by categories?
$displayformat = optional_param('displayformat',-1, PARAM_INT); // override of the glossary display format
optional_variable($displayformat,-1); // override of the glossary display format
$mode = optional_param('mode'); // term entry cat date letter search author approval
$hook = optional_param('hook'); // the term, entry, cat, etc... to look for based on mode
$fullsearch = optional_param('fullsearch',0);// full search (concept and definition) when searching?
$sortkey = optional_param('sortkey'); // Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
$sortorder = optional_param('sortorder'); // it defines the order of the sorting (ASC or DESC)
$offset = optional_param('offset',0,PARAM_INT); // entries to bypass (for paging purpouses)
$page = optional_param('page',0,PARAM_INT); // Page to show (for paging purpouses)
$show = optional_param('show'); // [ concept | alias ] => mode=term hook=$show
$mode = optional_param('mode', 'approval', PARAM_ALPHA); // term entry cat date letter search author approval
$hook = optional_param('hook', 'ALL', PARAM_CLEAN); // the term, entry, cat, etc... to look for based on mode
$fullsearch = optional_param('fullsearch', 0,PARAM_INT); // full search (concept and definition) when searching?
$sortkey = optional_param('sortkey', 'CREATION', PARAM_ALPHA);// Sorted view: CREATION | UPDATE | FIRSTNAME | LASTNAME...
$sortorder = optional_param('sortorder', 'ASC', PARAM_ALPHA); // it defines the order of the sorting (ASC or DESC)
$offset = optional_param('offset', 0,PARAM_INT); // entries to bypass (for paging purposes)
$page = optional_param('page', 0,PARAM_INT); // Page to show (for paging purposes)
$show = optional_param('show', '', PARAM_ALPHA); // [ concept | alias ] => mode=term hook=$show
if (!empty($id)) {
if (! $cm = get_record("course_modules", "id", $id)) {
@ -252,7 +251,7 @@
echo '<input type="submit" value="'.$strsearch.'" name="searchbutton" /> ';
if ($mode == 'search') {
echo '<input type="text" name="hook" size="20" value="'.$hook.'" alt="'.$strsearch.'" /> ';
echo '<input type="text" name="hook" size="20" value="'.s($hook).'" alt="'.$strsearch.'" /> ';
} else {
echo '<input type="text" name="hook" size="20" value="" alt="'.$strsearch.'" /> ';
}