]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_cats.php
Code style changed, ext-user continued:
[mailer.git] / inc / modules / admin / what-config_cats.php
index 924be5cb3e5b203c43088a4437748e61b0d6bc7a..2f50fa4f883388ca981c9b9b64b926e76f496b80 100644 (file)
@@ -17,7 +17,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -53,7 +53,7 @@ if (isFormSent('add')) {
                array(postRequestElement('catname')), __FILE__, __LINE__);
        if (SQL_HASZERONUMS($result)) {
                // Category does not exists, we simply add it...
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`,`visible`,`sort`) VALUES ('%s','%s','%s')",
+               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
                        array(
                                postRequestElement('catname'),
                                postRequestElement('visible'),
@@ -62,7 +62,7 @@ if (isFormSent('add')) {
                $content = '{--CATEGORY_ADDED--}';
        } else {
                // Category does already exists
-               $content = '<span class="notice">{--CATEGORY_ALREADY_EXISTS--}</span>';
+               $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
        }
 
        // Free memory
@@ -70,7 +70,7 @@ if (isFormSent('add')) {
 
        // Display message
        displayMessage($content);
-} elseif ((isFormSent()) && (isPostRequestElementSet('id')) && (is_array(postRequestElement('id')))) {
+} elseif ((isFormSent()) && (ifPostContainsSelections('id'))) {
        // Change or delete categories...
        $TEXT = '';
        foreach (postRequestElement('id') as $id => $cat) {
@@ -81,7 +81,7 @@ if (isFormSent('add')) {
                if (!empty($cat)) {
                        switch (getRequestElement('do')) {
                                case 'edit': // Change categories
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_cats` SET `cat`='%s', `visible`='%s', `sort`=%s WHERE `id`=%s LIMIT 1",
+                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_cats` SET `cat`='%s',`visible`='%s',`sort`=%s WHERE `id`=%s LIMIT 1",
                                                array(
                                                        $cat,
                                                        postRequestElement('visible', $id),
@@ -114,17 +114,17 @@ if (isFormSent('add')) {
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
                // Load row template and switch colors
-               $OUT .= loadTemplate('admin_delete_cats_row', true, $id);
+               $OUT .= loadTemplate('admin_delete_cats_row', TRUE, $id);
        } // END - foreach
 
        // Load main template
-       loadTemplate('admin_delete_cats', false, $OUT);
+       loadTemplate('admin_delete_cats', FALSE, $OUT);
 } elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit categories
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
                // Load data from the category
-               $result = SQL_QUERY_ESC("SELECT `id`,`visible`,`sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+               $result = SQL_QUERY_ESC("SELECT `id`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                $content = SQL_FETCHARRAY($result);
 
@@ -135,17 +135,17 @@ if (isFormSent('add')) {
                $content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id']);
 
                // Load row template and switch colors
-               $OUT .= loadTemplate('admin_edit_cats_row', true, $content);
+               $OUT .= loadTemplate('admin_edit_cats_row', TRUE, $content);
        } // END - foreach
 
        // Load main template
-       loadTemplate('admin_edit_cats', false, $OUT);
+       loadTemplate('admin_edit_cats', FALSE, $OUT);
 } else {
        // Init variable here
        $CATS = '';
 
        // Load all categories
-       $result = SQL_QUERY("SELECT `id`,`cat`,`visible`,`sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
        if (!SQL_HASZERONUMS($result)) {
                // Init variables
                $OUT = '';
@@ -158,21 +158,21 @@ if (isFormSent('add')) {
                        $CATS .= '<option value="' . $content['sort'] . '">' . $cat . '</option>';
 
                        // Load row template and switch color
-                       $OUT .= loadTemplate('admin_list_cats_row', true, $content);
+                       $OUT .= loadTemplate('admin_list_cats_row', TRUE, $content);
                } // END - while
 
                // Free memory
                SQL_FREERESULT($result);
 
                // Load main template
-               loadTemplate('admin_list_cats', false, $OUT);
+               loadTemplate('admin_list_cats', FALSE, $OUT);
        } // END - if
 
        // Remember in array
        $content['cats'] = $CATS;
 
        // Form to add a new category
-       loadTemplate('admin_add_cat', false, $content);
+       loadTemplate('admin_add_cat', FALSE, $content);
 }
 
 // [EOF]