]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-adminedit.php
A lot naming conventions applied, TODOs.txt updated
[mailer.git] / inc / modules / admin / what-adminedit.php
index b4eb53902fe8d191ccd8eac27443d15b6e4cc457..f86cb0a68771c35e18288b7ce01082dbf6056c4e 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();
@@ -182,9 +182,9 @@ WHERE ".$AND." AND `id`=%s LIMIT 1",
                        break;
        }
 } else {
-       if ((isGetRequestParameterSet(('act'))) && (isGetRequestParameterSet(('tid'))) && (isGetRequestParameterSet(('fid')))) {
+       if ((isGetRequestParameterSet('act')) && (isGetRequestParameterSet('tid')) && (isGetRequestParameterSet('fid'))) {
                // Get ids
-               if (isGetRequestParameterSet(('w'))) {
+               if (isGetRequestParameterSet('w')) {
                        // Sub menus selected
                        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `sort`='%s' LIMIT 1",
                        array(getRequestParameter('act'), bigintval(getRequestParameter('tid'))), __FILE__, __LINE__);
@@ -212,8 +212,8 @@ WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval(getRequestParameter('tid')), bigintval($fid)), __FILE__, __LINE__);
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='%s' WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval(getRequestParameter('fid')), bigintval($tid)), __FILE__, __LINE__);
-               }
-       }
+               } // END - if
+       } // END - if
 
        // By default list menus
        if (!empty($SUB)) {
@@ -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