]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-adminedit.php
Some code cosmetics and fixes
[mailer.git] / inc / modules / admin / what-adminedit.php
index b4eb53902fe8d191ccd8eac27443d15b6e4cc457..d6d95ec5a3d29d0a25bfed0500564dd9f5a79ac8 100644 (file)
@@ -53,7 +53,7 @@ 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
        // @TODO Kill all constants in this file
        $content['sub'] = $SUB;
@@ -100,7 +100,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Prepare misc content
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -231,7 +231,7 @@ WHERE ".$AND." AND `id`=%s LIMIT 1",
                $content['sub'] = $SUB;
 
                // Init variables
-               $OUT = ''; $SW  = 2; $cnt = '0';
+               $OUT = ''; $cnt = '0';
 
                // Process all entries
                while ($data = SQL_FETCHARRAY($result)) {
@@ -251,18 +251,11 @@ WHERE ".$AND." AND `id`=%s LIMIT 1",
                                $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>/<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
                        }
 
-                       // Fix empty elements for constant (fixes display bugs in Firefox)
-                       if (empty($data['action'])) $data['action'] = '&nbsp;';
-                       if (empty($data['what']))   $data['what']   = '&nbsp;';
-                       if (empty($data['title']))  $data['title']  = '&nbsp;';
-
                        // Add more data to $data
-                       $data['sw']   = $SW;
                        $data['mode'] = 'admin';
 
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_menu_overview_row', true, $data);
-                       $SW = 3 - $SW;
                } // END - switch
 
                // Remember all rows