X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-adminedit.php;h=28b590b0cce6440047aa62893861c7568c0300f6;hb=754861aaacc51a871b8b91f382c3e0b57726f692;hp=dbb7740b9c1a48ec18870dab7df2417aac82be7e;hpb=63f159414369b5ea19a8ca75d8cd8033c45d8341;p=mailer.git diff --git a/inc/modules/admin/what-adminedit.php b/inc/modules/admin/what-adminedit.php index dbb7740b9c..28b590b0cc 100644 --- a/inc/modules/admin/what-adminedit.php +++ b/inc/modules/admin/what-adminedit.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -60,11 +60,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() 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; @@ -110,11 +110,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() 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,7 +140,7 @@ 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 (postRequestElement('ok')) { @@ -150,7 +150,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive() $sel = bigintval($sel); // Update entry - SQL_QUERY_ESC("UPDATE + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='%s', @@ -176,7 +176,7 @@ LIMIT 1", case 'delete': // Delete 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", + sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1", array(bigintval($sel)), __FILE__, __LINE__); } // END - foreach @@ -185,7 +185,7 @@ LIMIT 1", break; default: // Unexpected action - logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok'))); + logDebugMessage(__FILE__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok'))); displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}'); break; } // END - switch @@ -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 (SQL_NUMROWS($result) == $count) { + } elseif (sqlNumRows($result) == $count) { // Is lowest position $content['navi'] = '{--HIGHER--}'; } elseif ($content['sort'] > 0) { @@ -227,7 +227,7 @@ LIMIT 1", $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--}');