X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-adminedit.php;h=1042be5cff6f3072d22a9953316bee24335b7fd6;hp=d418ba4fc90185ba815c51260e87a1e4e7a4a988;hb=e9da1508b2a3ccbf63adc999981674740a47e074;hpb=b24a9509ad55c199645e010f6f419ea40d9b64f3 diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index d418ba4fc9..1042be5cff 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -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 - 2015 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,14 +57,14 @@ 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", + $result = sqlQueryEscaped("SELECT `title`, `action`, `what`, `descr` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Entry found so we load the stuff... - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); // Prepare data for the row template $content = array( @@ -77,7 +77,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() ); // Load row template - $OUT .= loadTemplate('admin_edit_admin_menu_row', true, $content); + $OUT .= loadTemplate('admin_edit_admin_menu_row', TRUE, $content); } else { // Entry not found? $content = array( @@ -85,11 +85,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() ); // Load row template - $OUT .= loadTemplate('admin_menu_404_row', true, $content); + $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content); } // Free result and switch color - SQL_FREERESULT($result); + sqlFreeResult($result); } // END - if } // END - foreach @@ -99,7 +99,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $content['count'] = $count; // Load template - loadTemplate('admin_edit_admin_menu_form', false, $content); + loadTemplate('admin_edit_admin_menu_form', FALSE, $content); } elseif ((isFormSent('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) { // Prepare misc content $content['sub'] = $subMenu; @@ -107,14 +107,14 @@ 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", + $result = sqlQueryEscaped("SELECT `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); - if (SQL_NUMROWS($result) == 1) { + if (sqlNumRows($result) == 1) { // Entry found so we load the stuff... - $content = SQL_FETCHARRAY($result); + $content = sqlFetchArray($result); // Prepare data for the row template $content = array( @@ -122,15 +122,15 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() 'count' => $count, 'sel' => $sel, ); - $OUT .= loadTemplate('admin_delete_admin_menu_row', true, $content); + $OUT .= loadTemplate('admin_delete_admin_menu_row', TRUE, $content); } else { // Entry not found? $content = array( 'sel' => $sel ); - $OUT .= loadTemplate('admin_menu_404_row', true, $content); + $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content); } - SQL_FREERESULT($result); + sqlFreeResult($result); } // END - if } // END - switch @@ -140,17 +140,17 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $content['count'] = $count; // Load template - loadTemplate('admin_delete_admin_menu', false, $content); + 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); // Update entry - SQL_QUERY_ESC("UPDATE + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='%s', @@ -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,8 +175,8 @@ LIMIT 1", break; case 'delete': // Delete menu - foreach (postRequestParameter('sel') as $sel => $menu) { - SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1", + foreach (postRequestElement('sel') as $sel => $menu) { + sqlQueryEscaped("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 { @@ -194,16 +194,16 @@ LIMIT 1", doAdminProcessMenuWeightning('admin', $AND); // Run SQL - $result = SQL_QUERY("SELECT `id`,`action`,`what`,`title`,`sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__); + $result = sqlQuery("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__); - // Do we have entries? - if (!SQL_HASZERONUMS($result)) { + // Are there entries? + if (!ifSqlHasZeroNums($result)) { // Init variables $OUT = ''; $count = '0'; // Process all entries - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Remember sub value $content['sub'] = $subMenu; @@ -215,7 +215,7 @@ LIMIT 1", if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) { // Is highest position $content['navi'] = '{--LOWER--}'; - } elseif ($count == SQL_NUMROWS($result)) { + } elseif (sqlNumRows($result) == $count) { // Is lowest position $content['navi'] = '{--HIGHER--}'; } elseif ($content['sort'] > 0) { @@ -224,10 +224,10 @@ 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); + $OUT .= loadTemplate('admin_menu_overview_row', TRUE, $content); } // END - switch // Remember all rows @@ -235,10 +235,10 @@ LIMIT 1", $content['sub'] = $subMenu; // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Load template - loadTemplate('admin_edit_admin_menu', false, $content); + loadTemplate('admin_edit_admin_menu', FALSE, $content); } else { // Menu entries are missing... (???) displayMessage('{--ADMIN_NO_MENUS_FOUND--}');