Fix for rewritting code
[mailer.git] / inc / modules / admin / what-admins_mails.php
index 16e4a6a3950e0777b4432b4825de5d5399a3f9d7..3f4159727d4e8c36ae765cc537c40ff508b2b7fb 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 08/14/2004 *
- * ================                             Last change: 10/22/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 08/14/2004 *
+ * ===================                          Last change: 10/22/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-admins_mails.php                            *
@@ -46,8 +46,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isPostRequestElementSet('edit')) {
        // Check if entires are checked
-       $SEL = countPostSelection();
-       if ($SEL > 0) {
+       if (countPostSelection() > 0) {
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
                $SW = 2; $rowNameS = '';
@@ -55,7 +54,8 @@ if (isPostRequestElementSet('edit')) {
                        // 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",
                                array($template), __FILE__, __LINE__);
-                       $OUT = ''; $adminId2 = 0;
+                       $OUT = '';
+                       $adminId2 = '0';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // @TODO Can this be rewritten???
                                $OUT .= "<select name=\"admin_id[".$content['id']."]\" size=\"1\" class=\"admin_select\">
@@ -69,20 +69,18 @@ if (isPostRequestElementSet('edit')) {
                                }
                                $OUT .= generateOptionList('admins', 'id', 'login', $content['admin_id'], 'email');
                                $OUT .= "</select>\n<br />\n";
-                               $adminId2 = $content['admin_id']; $id2 = $content['id'];
-                       }
+
+                               // Transfer ids
+                               $adminId2 = $content['admin_id'];
+                               $id2 = $content['id'];
+                       } // END - while
 
                        // Free memory
                        SQL_FREERESULT($result);
 
                        // Prepare content
-                       $content = array(
-                               'sw'      => $SW,
-                               'id'      => $id,
-                               'id2'     => $id2,
-                               'tpl'     => $template,
-                               'admins'  => $adminsList
-                       );
+                       $content['sw']     = $SW;
+                       $content['admins'] = $adminsList;
 
                        if ($adminId2 > 0) {
                                // Add form for an additional admin
@@ -127,7 +125,7 @@ ORDER BY
 
                        // Ok, update database
                        foreach (postRequestElement('admin_id') as $id => $content['admin_id']) {
-                               // Secure IDs
+                               // Secure ids
                                $id  = bigintval($id);
                                $content['admin_id'] = bigintval($content['admin_id']);