X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fmodules%2Fadmin%2Fwhat-extensions.php;h=88811b38b0c92c8625b64c2e1bb32385d4a08f98;hb=9afd6ec5878544a7982c50ed9c0dd7de37606d5b;hp=5c5ca685c361ae03f7462bc45bd873ffff19050f;hpb=64c8349613addc3da2242c5cd6b99d64e3fb5f8e;p=mailer.git diff --git a/inc/modules/admin/what-extensions.php b/inc/modules/admin/what-extensions.php index 5c5ca685c3..88811b38b0 100644 --- a/inc/modules/admin/what-extensions.php +++ b/inc/modules/admin/what-extensions.php @@ -46,7 +46,7 @@ addMenuDescription('admin', __FILE__); // Normally we want the overview of all registered extensions $do = 'overview'; -$SEL = 0; +$SEL = '0'; // Are some extensions submitted? if (isPostRequestElementSet('sel')) { @@ -57,7 +57,7 @@ if (isPostRequestElementSet('sel')) { if (isGetRequestElementSet('reg_ext')) { // We are about to register a new extension $do = 'register'; $ext_id = bigintval(getRequestElement('reg_ext')); - // The ID comes from task management and it is - of course - *not* the extension's name! + // The id comes from task management and it is - of course - *not* the extension's name! } elseif ((isPostRequestElementSet('change')) && ($SEL > 0) && (!isDemoModeActive())) { // De-/activate extensions foreach (postRequestElement('sel') as $ext_id => $active) { @@ -66,10 +66,10 @@ if (isGetRequestElementSet('reg_ext')) { // Keep this extension active! } else { // De/activate extension - $ACT = 'N'; getExtensionMode('deactivate'); + $ACT = 'N'; setExtensionMode('deactivate'); if ($active != 'Y') { $ACT = 'Y'; setExtensionMode('activate'); } SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='".$ACT."' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1", - array(bigintval($ext_id), $active), __FILE__, __LINE__); + array(bigintval($ext_id), $active), __FILE__, __LINE__); // Run embeded SQL commands doExtensionSqls($ext_id, getExtensionMode()); @@ -79,15 +79,15 @@ if (isGetRequestElementSet('reg_ext')) { // Change settings like CSS file load if (isPostRequestElementSet(('modify'))) { // Change entries - $cache_update = 0; + $cache_update = '0'; foreach (postRequestElement('sel') as $ext_id => $sel) { - // Secure ID + // Secure id $ext_id = bigintval($ext_id); // Change this extension? if ($sel == 1) { // Load mode is modify - getExtensionMode('modify'); + setExtensionMode('modify'); // Get entry for 'active' $active = postRequestElement('active', $ext_id); @@ -105,8 +105,8 @@ if (isGetRequestElementSet('reg_ext')) { // Run SQLs on activation / deactivation switch ($active) { - case 'Y': getExtensionMode('activate'); break; - case 'N': getExtensionMode('deactivate'); break; + case 'Y': setExtensionMode('activate'); break; + case 'N': setExtensionMode('deactivate'); break; } // END - if // Run embeded SQL commands @@ -215,9 +215,9 @@ if (isGetRequestElementSet('reg_ext')) { $do = 'delete'; } elseif ((isPostRequestElementSet('remove')) && ($SEL > 0) && (!isDemoModeActive())) { // Remove extensions from DB (you have to delete all files manually!) - $cache_update = 0; + $cache_update = '0'; foreach (postRequestElement('sel') as $ext_id => $active) { - // Secure ID number + // Secure id number $ext_id = bigintval($ext_id); // Is this extension selected and id valid? @@ -246,7 +246,7 @@ if (isGetRequestElementSet(('active'))) { // Case selection switch ($do) { case 'overview': // List all registered extensions - if (getExtensionVersion('sql_patches') >= '0.0.6') { + if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) { // Load extension data with CSS informations $result = SQL_QUERY("SELECT `id` AS ext_id, `ext_name`, `ext_active`, `ext_has_css` AS ext_css, `ext_version` FROM `{?_MYSQL_PREFIX?}_extensions` @@ -304,16 +304,16 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__); // Free result SQL_FREERESULT($result); - // Is the ID number valid and the task was found? + // Is the id number valid and the task was found? if (($ext_id > 0) && ($task_found == 1)) { - // ID is valid so begin with registration, we first want to it's real name from task management (subject column) + // 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($ext_id)), __FILE__, __LINE__); list($subj) = SQL_FETCHROW($result); SQL_FREERESULT($result); // Disable cache update by default - $cache_update = 0; + $cache_update = '0'; if (!empty($subj)) { // Extract extension's name from subject... $ext_name = trim(substr($subj, 1, strpos($subj, ':') - 1)); @@ -326,7 +326,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__); // ... so we can finally register and load it in registration mode if (registerExtension($ext_name, $ext_id)) { // Errors? - if (getTotalFatalErrors() == 0) { + if (getTotalFatalErrors() == '0') { // Extension was found and successfully registered loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_EXTENSION_REGISTERED'), $ext_name)); @@ -374,7 +374,7 @@ ORDER BY `ext_name` ASC", __FILE__, __LINE__); // No longer assigned or old task loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_ASSIGED')); } else { - // ID is invalid + // id is invalid loadTemplate('admin_settings_saved', false, getMessage('ADMIN_REG_FAILED_INVALID')); } break;