- LOAD_TEMPLATE('admin_mmenu_status');
-} elseif ((isFormSent()) && (!IS_DEMO())) {
- // An act is done...
- foreach (REQUEST_POST('sel') as $sel => $menu) {
- $AND = "(`what` = '' OR `what` IS NULL)";
- $sel = bigintval($sel);
- if (!empty($SUB)) $AND = "`action`='".$SUB."'";
- switch (REQUEST_POST('ok')) {
- case 'edit': // Edit menu
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `title`='%s', `action`='%s', `what`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($menu, REQUEST_POST('sel_act', $sel), REQUEST_POST('sel_what', $sel), $sel), __FILE__, __LINE__);
- break;
-
- case 'del': // Delete menu
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
- array($sel), __FILE__, __LINE__);
- break;
-
- case 'status': // Change status of menus
- SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='%s', `locked`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
- array(REQUEST_POST('visible', $sel), REQUEST_POST('locked', $sel), $sel), __FILE__, __LINE__);
- break;
- } // END - switch
- break;
- } // END - foreach
-
- // Load template
- LOAD_TEMPLATE('admin_settings_saved', false, getMessage('SETTINGS_SAVED'));
+ loadTemplate('admin_member_menu_status', false, $content);
+} elseif ((isFormSent()) && (!isDemoModeActive())) {
+ // Process menu editing form
+ adminProcessMenuEditForm('member', $subMenu);