A lot code rewritten:
[mailer.git] / inc / libs / admins_functions.php
index 6c75e6a2d7c3d66ca6142368e29978012080fb6a..e9a5e8a79b5df96b1d141d75075a596efc74a718 100644 (file)
@@ -291,7 +291,7 @@ function adminsEditAdminAccount ($postData) {
        $currMode = getAdminDefaultAcl(getCurrentAdminId());
 
        // Begin the edit loop
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        foreach ($postData['sel'] as $id => $selected) {
                // Secure id number
                $id = bigintval($id);
@@ -305,7 +305,6 @@ function adminsEditAdminAccount ($postData) {
                        SQL_FREERESULT($result);
 
                        // Prepare some more data for the template
-                       $content['sw'] = $SW;
                        $content['id'] = $id;
 
                        // Shall we allow changing default ACL?
@@ -320,9 +319,8 @@ function adminsEditAdminAccount ($postData) {
 
                        // Load row template and switch color
                        $OUT .= loadTemplate('admin_edit_admins_row', true, $content);
-                       $SW = 3 - $SW;
-               }
-       }
+               } // END - if
+       } // END - foreach
 
        // Load template
        loadTemplate('admin_edit_admins', false, $OUT);
@@ -336,7 +334,7 @@ function adminsDeleteAdminAccount ($postData) {
        SQL_FREERESULT($result_main);
        if ($accounts > 1) {
                // Delete accounts
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                foreach ($postData['sel'] as $id => $selected) {
                        // Secure id number
                        $id = bigintval($id);
@@ -352,14 +350,12 @@ function adminsDeleteAdminAccount ($postData) {
                                $content['la_mode'] = '{--ADMINS_' . strtoupper($content['la_mode']) . '_LA_SETTING--}';
 
                                // Prepare some more data
-                               $content['sw'] = $SW;
                                $content['id'] = $id;
 
                                // Load row template and switch color
                                $OUT .= loadTemplate('admin_del_admins_row', true, $content);
-                               $SW = 3 - $SW;
-                       }
-               }
+                       } // END - if
+               } // END - foreach
 
                // Load template
                loadTemplate('admin_del_admins', false, $OUT);
@@ -397,20 +393,18 @@ function adminsRemoveAdminAccount ($postData) {
 function adminsListAdminAccounts() {
        // Select all admin accounts
        $result = SQL_QUERY("SELECT `id`, `login`, `email`, `default_acl` AS mode, `la_mode` FROM `{?_MYSQL_PREFIX?}_admins` ORDER BY `login` ASC", __FUNCTION__, __LINE__);
-       $OUT = ''; $SW = 2;
+       $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
                // Compile some variables
                $content['mode']    = '{--ADMINS_' . strtoupper($content['mode'])    . '_MODE--}';
                $content['la_mode'] = '{--ADMINS_' . strtoupper($content['la_mode']) . '_LA_SETTING--}';
 
                // Prepare some more data
-               $content['sw']         = $SW;
                $content['email_link'] = generateEmailLink($content['id'], 'admins');
 
                // Load row template and switch color
                $OUT .= loadTemplate('admin_list_admins_row', true, $content);
-               $SW = 3 - $SW;
-       }
+       } // END - while
 
        // Free memory
        SQL_FREERESULT($result);