Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / admin / what-adminedit.php
index d418ba4fc90185ba815c51260e87a1e4e7a4a988..84ccdcfe2b04d73214c6094612b11c49e4100314 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * 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 *
  * it under the terms of the GNU General Public License as published by *
@@ -45,9 +45,9 @@ addYouAreHereLink('admin', __FILE__);
 
 // Do we edit/delete/change main menus or sub menus?
 $AND = "(`what` = '' OR `what` IS NULL)"; $subMenu = '';
-if (isGetRequestParameterSet('sub')) {
-       $AND = sprintf("`action`='%s' AND `what` != '' AND `what` IS NOT NULL", getRequestParameter('sub'));
-       $subMenu = getRequestParameter('sub');
+if (isGetRequestElementSet('sub')) {
+       $AND = sprintf("`action`='%s' AND `what` != '' AND `what` IS NOT NULL", getRequestElement('sub'));
+       $subMenu = getRequestElement('sub');
 } // END - if
 
 // List all menu points and make them editable
@@ -57,7 +57,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
        $count = '0'; $OUT = '';
-       foreach (postRequestParameter('sel') as $sel => $confirm) {
+       foreach (postRequestElement('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`,`action`,`what`,`descr` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
@@ -107,7 +107,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
 
        // Del menu entries with or without confirmation
        $count = '0'; $OUT = '';
-       foreach (postRequestParameter('sel') as $sel => $confirm) {
+       foreach (postRequestElement('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $count++;
                        $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
@@ -143,9 +143,9 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        loadTemplate('admin_delete_admin_menu', false, $content);
 } elseif ((isFormSent()) && (!isDemoModeActive())) {
        // An action is done...
-       switch (postRequestParameter('ok')) {
+       switch (postRequestElement('ok')) {
                case 'edit': // Edit menu
-                       foreach (postRequestParameter('sel') as $sel => $menu) {
+                       foreach (postRequestElement('sel') as $sel => $menu) {
                                // Secure id
                                $sel = bigintval($sel);
 
@@ -163,9 +163,9 @@ WHERE
 LIMIT 1",
                                array(
                                        $menu,
-                                       postRequestParameter('sel_action', $sel),
-                                       postRequestParameter('sel_what', $sel),
-                                       postRequestParameter('sel_desc', $sel),
+                                       postRequestElement('sel_action', $sel),
+                                       postRequestElement('sel_what', $sel),
+                                       postRequestElement('sel_desc', $sel),
                                        $sel,
                                ), __FILE__, __LINE__);
                        }
@@ -175,7 +175,7 @@ LIMIT 1",
                        break;
 
                case 'delete': // Delete menu
-                       foreach (postRequestParameter('sel') as $sel => $menu) {
+                       foreach (postRequestElement('sel') as $sel => $menu) {
                                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                        array(bigintval($sel)), __FILE__, __LINE__);
                        } // END - foreach
@@ -185,8 +185,8 @@ LIMIT 1",
                        break;
 
                default: // Unexpected action
-                       logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestParameter('ok')));
-                       displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestParameter('ok') . '%}');
+                       logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+                       displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
                        break;
        } // END - switch
 } else {
@@ -196,7 +196,7 @@ LIMIT 1",
        // Run SQL
        $result = SQL_QUERY("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
 
-       // Do we have entries?
+       // Are there entries?
        if (!SQL_HASZERONUMS($result)) {
                // Init variables
                $OUT = '';
@@ -215,7 +215,7 @@ LIMIT 1",
                        if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) {
                                // Is highest position
                                $content['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $content['action'] . '&amp;w=' . $content['what'] . '&amp;tid=' . ($content['sort']+1) . '&amp;fid=' . $content['sort'] . '%}">{--LOWER--}</a>';
-                       } elseif ($count == SQL_NUMROWS($result)) {
+                       } elseif (SQL_NUMROWS($result) == $count) {
                                // Is lowest position
                                $content['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $content['action'] . '&amp;w=' . $content['what'] . '&amp;tid=' . ($content['sort']-1) . '&amp;fid=' . $content['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($content['sort'] > 0) {
@@ -224,7 +224,7 @@ LIMIT 1",
                        }
 
                        // Add more data to $content
-                       $content['mode'] = 'admin';
+                       $content['do'] = 'admin';
 
                        // Load row template and switch colors
                        $OUT .= loadTemplate('admin_menu_overview_row', true, $content);