* $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 *
// 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!
// 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());
// 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) {
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`,
`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?
}
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__);
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