]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admins_mails.php
A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / modules / admin / what-admins_mails.php
index c3ad9a63334104a9c662e98e75322b3b9f97b5ea..3d1c1daa58de73a41fab5382ba6f2a9b5927422f 100644 (file)
@@ -47,10 +47,10 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent('edit')) {
        // Check if entires are checked
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
-               $SW = 2; $rows = '';
+               $rows = '';
                foreach (postRequestParameter('sel') as $template => $sel) {
                        // First of all load data from DB
                        $result = SQL_QUERY_ESC("SELECT `admin_id`, `id` FROM `{?_MYSQL_PREFIX?}_admins_mails` WHERE `mail_template`='%s' ORDER BY `id` ASC",
@@ -59,7 +59,7 @@ if (isFormSent('edit')) {
                        $adminId2 = '0'; $id = '0';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // @TODO Can this be rewritten to an API function?
-                               $OUT .= '<select name="admin_id[' . $content['id'] . ']" size="1" class="admin_select">
+                               $OUT .= '<select name="admin_id[' . $content['id'] . ']" size="1" class="form_select">
 <option value="0"';
                                if ($content['admin_id'] == '0') $OUT .= ' selected="selected"';
                                $OUT .= '>{--ADMINS_ALL_ADMINS--}</option>';
@@ -81,7 +81,6 @@ if (isFormSent('edit')) {
 
                        // Prepare content
                        $content['id']            = $id;
-                       $content['sw']            = $SW;
                        $content['mail_template'] = $template;
                        $content['admins']        = $adminsList;
 
@@ -95,8 +94,7 @@ if (isFormSent('edit')) {
 
                        // Start outputing line
                        $rows .= loadTemplate('admin_admins_mails_edit_row', true, $content);
-                       $SW = 3 - $SW;
-               }
+               } // END - foreach
 
                // Edit checked entries
                loadTemplate('admin_admins_mails_edit', false, $rows);
@@ -120,7 +118,7 @@ ORDER BY
        m.admin_id ASC,
        m.mail_template ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Shall I change entries?
                if (isFormSent('change')) {
                        // Init SQLs
@@ -169,15 +167,10 @@ ORDER BY
                } // END - if
 
                // List found entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Prepare content
-                       $content['sw']   = $SW;
-                       $content['alnk'] = generateAdminLink($content['admin_id']);
-
                        // Load row template
                        $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free result