general cleanup of xxx_parameter() functions + fixed logic of edit button - now interconnected with category.php

This commit is contained in:
skodak 2006-04-11 20:39:30 +00:00
parent ea8faba9dc
commit 9d6a11f8ff

View file

@ -5,11 +5,11 @@
require_once("../config.php");
require_once("lib.php");
$edit = optional_param( 'edit','',PARAM_ALPHA );
$edit = optional_param('edit', -1,PARAM_BOOL);
$delete = optional_param('delete',0,PARAM_INT);
$hide = optional_param('hide',0,PARAM_INT);
$show = optional_param('show',0,PARAM_INT);
$sure = optional_param( 'sure','',PARAM_CLEAN );
$sure = optional_param('sure','',PARAM_ALPHANUM);
$move = optional_param('move',0,PARAM_INT);
$moveto = optional_param('moveto',-1,PARAM_INT);
$moveup = optional_param('moveup',0,PARAM_INT);
@ -24,16 +24,13 @@
}
if (isadmin()) {
if (!empty($edit) and confirm_sesskey()) {
if ($edit == "on") {
$USER->categoriesediting = true;
} else if ($edit == "off") {
$USER->categoriesediting = false;
if ($edit !== -1) {
$USER->categoryediting = $edit;
}
$adminediting = !empty($USER->categoryediting);
} else {
$adminediting = false;
}
}
$adminediting = (isadmin() and !empty($USER->categoriesediting));
/// Unless it's an editing admin, just print the regular listing of courses/categories