]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-guestedit.php
Typo fixed :-(
[mailer.git] / inc / modules / admin / what-guestedit.php
index 6e80602f5a921451a8a66c7895465d4a3669a668..78a6d96ffd696807592c44a765ab706c5ca541bb 100644 (file)
@@ -54,12 +54,12 @@ if (isGetRequestParameterSet('sub')) {
 } // END - if
 
 // List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
 
-       $cnt = '0'; $OUT = ''; $SW = 2;
+       $cnt = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -76,7 +76,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $DATA['action']),
                                        'what'   => adminAddMenuSelectionBox('guest', 'what'  , 'sel_what['   . $sel . ']', $DATA['what']),
                                        'menu'   => $DATA['title'],
-                                       'sw'     => $SW,
                                );
 
                                // Load row template
@@ -84,7 +83,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        } else {
                                // Entry not found
                                $DATA = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $DATA);
@@ -92,7 +90,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Free result and switch color
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
                } // END - if
        } // END - foreach
 
@@ -101,14 +98,13 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_gmenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
 
        $cnt = '0';
        $OUT = '';
-       $SW  = 2;
 
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
@@ -122,21 +118,18 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'cnt'  => $cnt,
                                        'menu' => $DATA['title'],
                                        'sel'  => $sel,
-                                       'sw'   => $SW,
                                );
                                $OUT .= loadTemplate('admin_gmenu_delete_row', true, $DATA);
                        } else {
                                // Entry not found?
                                $DATA = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $DATA);
                        }
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
-               }
-       }
+               } // END - if
+       } // END - foreach
        $content['rows'] = $OUT;
        $content['cnt']  = $cnt;
 
@@ -183,13 +176,13 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
                        break;
        } // END - switch
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Change status (visible / locked)
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
 
        // Load template
-       $SW = 2; $cnt = '0'; $OUT = '';
+       $cnt = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $cnt++;
@@ -202,7 +195,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                                        'cnt'     => $cnt,
                                        'menu'    => $data['title'],
                                        'sel'     => $sel,
-                                       'sw'      => $SW,
                                        'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel),
                                        'locked'  => addSelectionBox('yn', $data['locked'] , 'locked' , $sel),
                                );
@@ -212,14 +204,12 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        } else {
                                // Entry not found?
                                $data = array(
-                                       'sw'  => $SW,
                                        'sel' => $sel
                                );
                                $OUT .= loadTemplate('admin_menu_404_row', true, $data);
                        }
 
                        SQL_FREERESULT($result);
-                       $SW = 3 - $SW;
                } // END - if
        } // END - foreach
        $content['cnt']  = $cnt;
@@ -278,7 +268,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                $content['sub'] = $SUB;
 
                // Init variables
-               $SW = 2;
                $cnt = '0';
                $OUT = '';
 
@@ -302,7 +291,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Prepapre content
                        $row = array(
-                               'sw'     => $SW,
                                'id'     => $data['id'],
                                'action' => $data['action'],
                                'what'   => $data['what'],
@@ -313,7 +301,6 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
                        // Load row template
                        $OUT .= loadTemplate('admin_menu_overview_row', true, $row);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Add rows