X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fadmin%2Fwhat-extensions.php;h=233e9de414648a26a6e0a17cf15a5cb0d7fa0862;hb=865d8f7670c976d59d5699d72958c8c00f6af70e;hp=52e243e51ddc8138fdaa9356a04828cf670b9436;hpb=06e24098eb8296f63f7d647c6a630a55ca0fdb94;p=mailer.git diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index 52e243e51d..233e9de414 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -43,12 +43,12 @@ if ((!defined('__SECURITY')) || (!isAdmin())) { // Add description as navigation point addYouAreHereLink('admin', __FILE__); -// Normally we want the overview of all registered extensions +// By default generate overview of all installed extensions $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! @@ -73,7 +73,11 @@ if (isGetRequestElementSet('register_ext')) { // Update database SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1", - array($active, bigintval($ext_id), $ext_active), __FILE__, __LINE__); + array( + $active, + bigintval($ext_id), + $ext_active + ), __FILE__, __LINE__); // Run embeded SQL commands doExtensionSqls($ext_id, getExtensionMode()); @@ -82,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) { @@ -277,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 = SQL_QUERY('SELECT `id` AS `ext_id`, `ext_name`, `ext_active`, @@ -285,21 +289,21 @@ switch ($do) { `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` -".$where." +' . $where . ' ORDER BY - `ext_name` ASC", __FILE__, __LINE__); + `ext_name` ASC', __FILE__, __LINE__); } else { // Load extension data without CSS informations - $result = SQL_QUERY("SELECT + $result = SQL_QUERY('SELECT `id` AS `ext_id`, `ext_name`, `ext_active`, `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` -".$where." +' . $where . ' ORDER BY - `ext_name` ASC", __FILE__, __LINE__); + `ext_name` ASC', __FILE__, __LINE__); } // Are there some entries? @@ -331,12 +335,12 @@ 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", array(bigintval($taskId)), __FILE__, __LINE__);