]> git.mxchange.org Git - mailer.git/commitdiff
Fixes for old-lost code
authorRoland Häder <roland@mxchange.org>
Thu, 28 Jul 2011 23:04:49 +0000 (23:04 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 28 Jul 2011 23:04:49 +0000 (23:04 +0000)
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-memedit.php

index 32d08b012bf61baebccd427feaaa48cd50158ff9..d418ba4fc90185ba815c51260e87a1e4e7a4a988 100644 (file)
@@ -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'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $content['action'] . '&amp;w=' . $content['what'] . '&amp;tid=' . ($content['sort']+1) . '&amp;fid=' . $content['sort'] . '%}">{--LOWER--}</a>';
                        } 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);
index e68e84df12eeb9b2dc3432e6d29c3fe6a28523d0..db713cff501284672a38901bb7840e20310309c1 100644 (file)
@@ -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);
index 34dc56c0c8d50d6c62195880eac16ffe0ba91f38..64e8edaa99d4582df0885f54abdf9d191497f919 100644 (file)
@@ -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);