- switch ($_POST['ok'])
- {
- case "edit": // Edit menu
- foreach ($_POST['sel'] as $sel => $menu)
- {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_guest_menu` SET title='%s', action='%s', what='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array($menu, $_POST['sel_action'][$sel], $_POST['sel_what'][$sel], $sel),__FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
- break;
-
- case "del": // Delete menu
- foreach ($_POST['sel'] as $sel => $menu)
- {
- // Delete enty
- $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
- array(bigintval($sel)), __FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
- break;
-
- case "status": // Change access levels
- foreach ($_POST['sel'] as $sel => $menu)
- {
- // Secure selector
- $sel = bigintval($sel);
-
- // Update entry
- $result = SQL_QUERY_ESC("UPDATE `"._MYSQL_PREFIX."_guest_menu` SET visible='%s', locked='%s' WHERE ".$AND." AND id=%s LIMIT 1",
- array($_POST['visible'][$sel], $_POST['locked'][$sel], $sel), __FILE__, __LINE__);
- }
- LOAD_TEMPLATE("admin_settings_saved", false, SAVING_DONE);
- break;
-
- default: // Unexpected action
- define('__OK_VALUE', $_POST['ok']);
- DEBUG_LOG(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", $_POST['ok']));
- LOAD_TEMPLATE("admin_menu_unknown_okay");
- break;
- }
-}
- elseif ((isset($_POST['status'])) && ($chk > 0) && (!IS_DEMO()))
-{
+ switch (postRequestElement('ok')) {
+ case 'edit': // Edit menu
+ foreach (postRequestElement('sel') as $sel => $menu) {
+ // Secure selector
+ $sel = bigintval($sel);
+
+ // Update entry
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ array($menu, postRequestElement('sel_action', $sel), postRequestElement('sel_what', $sel), $sel),__FILE__, __LINE__);
+ } // END - foreach
+ loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ break;
+
+ case 'del': // Delete menu
+ foreach (postRequestElement('sel') as $sel => $menu) {
+ // Delete enty
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND id=%s LIMIT 1",
+ array(bigintval($sel)), __FILE__, __LINE__);
+ } // END - foreach
+ loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ break;
+
+ case 'status': // Change access levels
+ foreach (postRequestElement('sel') as $sel => $menu) {
+ // Secure selector
+ $sel = bigintval($sel);
+
+ // Update entry
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND id=%s LIMIT 1",
+ array(postRequestElement('visible', $sel), postRequestElement('locked', $sel), $sel), __FILE__, __LINE__);
+ } // END - foreach
+ loadTemplate('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ break;
+
+ default: // Unexpected action
+ logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+ loadTemplate('admin_menu_unknown_okay', false, postRequestElement('ok'));
+ break;
+ } // END - switch
+} elseif ((isPostRequestElementSet('status')) && ($chk > 0) && (!isDemoModeActive())) {