X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-extensions.php;h=e9e8af84444012350c4640eb3985efb3c726dcad;hb=754861aaacc51a871b8b91f382c3e0b57726f692;hp=e1b95e3f593283ad11bd965b3aa14723ab965868;hpb=d6bbcf951f45052d6888da6ec83a02eb215058df;p=mailer.git diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index e1b95e3f59..e9e8af8444 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.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 * @@ -48,7 +48,7 @@ $do = 'overview'; if (isGetRequestElementSet('register_ext')) { // We are about to register a new extension - $do = 'register'; + $do = 'setup'; $taskId = determineExtensionTaskId(getRequestElement('register_ext')); // The id comes from task management and it is - of course - *not* the extension's name! @@ -72,7 +72,7 @@ if (isGetRequestElementSet('register_ext')) { } // END - if // Update database - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1", array( $active, bigintval($ext_id), @@ -86,9 +86,9 @@ if (isGetRequestElementSet('register_ext')) { // Redirect to prevent missing cache in js.php redirectToUrl('modules.php?module=admin&what=extensions&changed=' . countPostSelection()); -} elseif (((isFormSent('edit')) || (isPostRequestElementSet('modify'))) && (ifPostContainsSelections()) && (!isDemoModeActive())) { +} elseif (((isFormSent('edit')) || (isPostRequestElementSet('do_edit'))) && (ifPostContainsSelections()) && (!isDemoModeActive())) { // Change settings like CSS file load - if (isPostRequestElementSet('modify')) { + if (isPostRequestElementSet('do_edit')) { // Change entries $cache_update = '0'; foreach (postRequestElement('sel') as $ext_id => $sel) { @@ -106,11 +106,11 @@ if (isGetRequestElementSet('register_ext')) { // Update extension's record if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { // Update also CSS column when extensions ext-sql_patches is newer or exact v0.0.6 - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s',`ext_active`='%s' WHERE `id`=%s LIMIT 1", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='%s',`ext_active`='%s' WHERE `id`=%s LIMIT 1", array(postRequestElement('css', $ext_id), $active, $ext_id), __FILE__, __LINE__); } else { // When extension is older than v0.0.6 there is no column for the CSS information - SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1", + sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s LIMIT 1", array($active, $ext_id), __FILE__, __LINE__); } @@ -138,15 +138,15 @@ if (isGetRequestElementSet('register_ext')) { // Load required data if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { - $result = SQL_QUERY_ESC("SELECT `ext_has_css`, `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `ext_has_css`, `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); - list($css, $active) = SQL_FETCHROW($result); - SQL_FREERESULT($result); + list($css, $active) = sqlFetchRow($result); + sqlFreeResult($result); } else { - $result = SQL_QUERY_ESC("SELECT `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `ext_active` FROM `{?_MYSQL_PREFIX?}_extensions` WHERE `id`=%s LIMIT 1", array(bigintval($ext_id)), __FILE__, __LINE__); - list($active) = SQL_FETCHROW($result); - SQL_FREERESULT($result); + list($active) = sqlFetchRow($result); + sqlFreeResult($result); $css = 'X'; } @@ -273,7 +273,7 @@ if (isGetRequestElementSet('register_ext')) { // Shall we display active/inactive extensions? $where = ''; if (isGetRequestElementSet('active')) { - $where = sprintf("WHERE `ext_active`='%s'", SQL_ESCAPE(getRequestElement('active'))); + $where = sprintf("WHERE `ext_active`='%s'", sqlEscapeString(getRequestElement('active'))); } // END - if // Case selection @@ -281,7 +281,7 @@ switch ($do) { case 'overview': // List all registered extensions if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { // Load extension data with CSS informations - $result = SQL_QUERY('SELECT + $result = sqlQuery('SELECT `id` AS `ext_id`, `ext_name`, `ext_active`, @@ -294,7 +294,7 @@ ORDER BY `ext_name` ASC', __FILE__, __LINE__); } else { // Load extension data without CSS informations - $result = SQL_QUERY('SELECT + $result = sqlQuery('SELECT `id` AS `ext_id`, `ext_name`, `ext_active`, @@ -307,10 +307,10 @@ ORDER BY } // Are there some entries? - if (!SQL_HASZERONUMS($result)) { + if (!ifSqlHasZeroNums($result)) { // Extensions are registered $OUT = ''; - while ($content = SQL_FETCHARRAY($result)) { + while ($content = sqlFetchArray($result)) { // Prepare CSS selection output $cssSelection = '---'; if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { @@ -325,7 +325,7 @@ ORDER BY } // END - while // Free memory - SQL_FREERESULT($result); + sqlFreeResult($result); // Load template loadTemplate('admin_list_extensions', FALSE, $OUT); @@ -335,19 +335,19 @@ ORDER BY } break; - case 'register': // Register new extension + case 'setup': // Setup new extension // Are there some tasks? $numTasks = countSumTotalData(getCurrentAdminId(), 'task_system', 'id', 'assigned_admin', TRUE, "AND `task_type`='EXTENSION'"); // Is the id number valid and the task was found? - if (($taskId > 0) && ($numTasks > 0)) { + if ((isValidId($taskId)) && ($numTasks > 0)) { // id is valid so begin with registration, we first want to it's real name from task management (subject column) - $result = SQL_QUERY_ESC("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1", + $result = sqlQueryEscaped("SELECT `subject` FROM `{?_MYSQL_PREFIX?}_task_system` WHERE `id`=%s LIMIT 1", array(bigintval($taskId)), __FILE__, __LINE__); - list($subject) = SQL_FETCHROW($result); + list($subject) = sqlFetchRow($result); // Free result - SQL_FREERESULT($result); + sqlFreeResult($result); // Disable cache update by default $cache_update = '0'; @@ -367,11 +367,8 @@ ORDER BY if (isExtensionActive('cache')) { // Remove cache file (will be auto-created again!) foreach (array('config', 'extension', 'filter', 'modules') as $cache) { - // Is the cache file there? - if ($GLOBALS['cache_instance']->loadCacheFile($cache)) { - // Remove cache file - $GLOBALS['cache_instance']->removeCacheFile(); - } // END - if + // Rebuild cache file + rebuildCache($cache); } // END - foreach } // END - if