From b24a9509ad55c199645e010f6f419ea40d9b64f3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 28 Jul 2011 23:04:49 +0000 Subject: [PATCH] Fixes for old-lost code --- inc/modules/admin/what-adminedit.php | 26 ++++++++++++++++---------- inc/modules/admin/what-guestedit.php | 24 +++++++++++++++++------- inc/modules/admin/what-memedit.php | 19 +++++++++++++------ 3 files changed, 46 insertions(+), 23 deletions(-) diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index 32d08b012b..d418ba4fc9 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -44,17 +44,17 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { addYouAreHereLink('admin', __FILE__); // Do we edit/delete/change main menus or sub menus? -$AND = "(`what` = '' OR `what` IS NULL)"; $SUB = ''; +$AND = "(`what` = '' OR `what` IS NULL)"; $subMenu = ''; if (isGetRequestParameterSet('sub')) { $AND = sprintf("`action`='%s' AND `what` != '' AND `what` IS NOT NULL", getRequestParameter('sub')); - $SUB = getRequestParameter('sub'); + $subMenu = getRequestParameter('sub'); } // END - if // List all menu points and make them editable if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) { // Edit menu entries // @TODO Kill all constants in this file - $content['sub'] = $SUB; + $content['sub'] = $subMenu; $content['chk'] = countPostSelection(); $count = '0'; $OUT = ''; foreach (postRequestParameter('sel') as $sel => $confirm) { @@ -93,14 +93,16 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // END - if } // END - foreach - $content['rows'] = $OUT; + $content['rows'] = $OUT; + $content['sub'] = $subMenu; + $content['chk'] = countPostSelection(); $content['count'] = $count; // Load template loadTemplate('admin_edit_admin_menu_form', false, $content); } elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) { // Prepare misc content - $content['sub'] = $SUB; + $content['sub'] = $subMenu; $content['chk'] = countPostSelection(); // Del menu entries with or without confirmation @@ -131,7 +133,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() SQL_FREERESULT($result); } // END - if } // END - switch - $content['rows'] = $OUT; + + $content['rows'] = $OUT; + $content['sub'] = $subMenu; + $content['chk'] = countPostSelection(); $content['count'] = $count; // Load template @@ -193,21 +198,21 @@ LIMIT 1", // Do we have entries? if (!SQL_HASZERONUMS($result)) { - // Remember sub value - $content['sub'] = $SUB; - // Init variables $OUT = ''; $count = '0'; // Process all entries while ($content = SQL_FETCHARRAY($result)) { + // Remember sub value + $content['sub'] = $subMenu; + // Count this entry $count++; // Init navigation variable $content['navi'] = ''; - if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($SUB)))) { + if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) { // Is highest position $content['navi'] = '{--LOWER--}'; } elseif ($count == SQL_NUMROWS($result)) { @@ -227,6 +232,7 @@ LIMIT 1", // Remember all rows $content['rows'] = $OUT; + $content['sub'] = $subMenu; // Free memory SQL_FREERESULT($result); diff --git a/inc/modules/admin/what-guestedit.php b/inc/modules/admin/what-guestedit.php index e68e84df12..db713cff50 100644 --- a/inc/modules/admin/what-guestedit.php +++ b/inc/modules/admin/what-guestedit.php @@ -74,6 +74,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() 'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $content['action']), 'what' => adminAddMenuSelectionBox('guest', 'what' , 'sel_what[' . $sel . ']', $content['what']), 'menu' => $content['title'], + 'sub' => $subMenu ); // Load row template @@ -91,7 +92,9 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() } // END - if } // END - foreach - $content['rows'] = $OUT; + $content['rows'] = $OUT; + $content['chk'] = countPostSelection(); + $content['sub'] = $subMenu; $content['count'] = $count; // Load template @@ -128,7 +131,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() SQL_FREERESULT($result); } // END - if } // END - foreach - $content['rows'] = $OUT; + + $content['rows'] = $OUT; + $content['chk'] = countPostSelection(); + $content['sub'] = $subMenu; $content['count'] = $count; // Load template @@ -169,8 +175,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() SQL_FREERESULT($result); } // END - if } // END - foreach + + $content['rows'] = $OUT; + $content['chk'] = countPostSelection(); + $content['sub'] = $subMenu; $content['count'] = $count; - $content['rows'] = $OUT; // Load template loadTemplate('admin_guest_menu_status', false, $content); @@ -193,15 +202,15 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() // Do we have entries? if (!SQL_HASZERONUMS($result)) { - // Set sub value - $content['sub'] = $subMenu; - // Init variables $count = '0'; $OUT = ''; // Process all menu entries while ($content = SQL_FETCHARRAY($result)) { + // Set sub value + $content['sub'] = $subMenu; + $count++; if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) { // Is highest position @@ -228,8 +237,9 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $OUT .= loadTemplate('admin_menu_overview_row', true, $content); } // END - while - // Add rows + // Add rows/sub $content['rows'] = $OUT; + $content['sub'] = $subMenu; // Free memory SQL_FREERESULT($result); diff --git a/inc/modules/admin/what-memedit.php b/inc/modules/admin/what-memedit.php index 34dc56c0c8..64e8edaa99 100644 --- a/inc/modules/admin/what-memedit.php +++ b/inc/modules/admin/what-memedit.php @@ -127,7 +127,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() SQL_FREERESULT($result); } // END - if } // END - foreach - $content['rows'] = $OUT; + + $content['rows'] = $OUT; + $content['chk'] = countPostSelection(); + $content['sub'] = $subMenu; $content['count'] = $count; // Load template @@ -167,7 +170,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() SQL_FREERESULT($result); } // END - if } // END - foreach - $content['rows'] = $OUT; + + $content['rows'] = $OUT; + $content['chk'] = countPostSelection(); + $content['sub'] = $subMenu; $content['count'] = $count; // Load template @@ -189,11 +195,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() // Some are there? if (!SQL_HASZERONUMS($result)) { - // Set sub value - $content['sub'] = $subMenu; - $count = '0'; $OUT = ''; while ($content = SQL_FETCHARRAY($result)) { + // Set sub value + $content['sub'] = $subMenu; + // Init navigation $content['navi'] = ''; $count++; @@ -218,8 +224,9 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() // Free memory SQL_FREERESULT($result); - // Remember rows in array + // Remember rows/sub in array $content['rows'] = $OUT; + $content['sub'] = $subMenu; // Load main template loadTemplate('admin_member_menu_overview', false, $content); -- 2.39.5