]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-admins_mails.php
'NO-ACL' is more clear that we don't have an ACL for the given admin than three aster...
[mailer.git] / inc / modules / admin / what-admins_mails.php
index 753cf83265543dfc205822623dde27ff731d399c..f697968d7d488cf235c8e08bd51630d0edee1ff6 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -43,14 +41,14 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('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,14 +57,14 @@ 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>';
+                               $OUT .= '>{--ADMIN_TO_ALL_ADMINS--}</option>';
                                if (isExtensionActive('events')) {
                                        $OUT .= '<option value="-1"';
                                        if ($content['admin_id'] == '-1') $OUT .= ' selected="selected"';
-                                       $OUT .= '>{--ADMINS_TO_USER_EVENTS--}</option>';
+                                       $OUT .= '>{--ADMIN_ADMINS_TO_USER_EVENTS--}</option>';
                                }
                                $OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email');
                                $OUT .= '</select>';
@@ -81,7 +79,6 @@ if (isFormSent('edit')) {
 
                        // Prepare content
                        $content['id']            = $id;
-                       $content['sw']            = $SW;
                        $content['mail_template'] = $template;
                        $content['admins']        = $adminsList;
 
@@ -95,14 +92,13 @@ 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);
        } else {
                // Nothing selected
-               loadTemplate('admin_settings_saved', false, '{--ADMINS_NO_MAIL_CHECKED--}');
+               displayMessage('{--ADMINS_NO_MAIL_CHECKED--}');
        }
 } else {
        // Load all assigned mails
@@ -120,7 +116,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,14 +165,10 @@ ORDER BY
                } // END - if
 
                // List found entries
-               $OUT = ''; $SW = 2;
+               $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
-                       // Prepare content
-                       $content['sw']   = $SW;
-
                        // Load row template
                        $OUT .= loadTemplate('admin_admins_mails_list_row', true, $content);
-                       $SW = 3 - $SW;
                } // END - while
 
                // Free result
@@ -186,7 +178,7 @@ ORDER BY
                loadTemplate('admin_admins_mails_list', false, $OUT);
        } else {
                // No entries found
-               loadTemplate('admin_settings_saved', false, '{--ADMINS_MAILS_NO_ENTRIES--}');
+               displayMessage('{--ADMIN_ADMINS_MAILS_NO_ENTRIES--}');
        }
 }