]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-extensions.php
Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / admin / what-extensions.php
index 074cb3db045cfdddf5032a3e924fe7cbd2cc42c1..453e9c6142aadc305a9a865006f27e9afdeec4ae 100644 (file)
@@ -16,7 +16,7 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
  * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -102,7 +102,7 @@ if (isGetRequestElementSet('reg_ext')) {
                                // Update extension's record
                                if (isExtensionInstalledAndNewer('sql_patches', '0.0.6')) {
                                        // Update also CSS column when extensions 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",
+                                       SQL_QUERY_ESC("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
@@ -332,7 +332,7 @@ ORDER BY
                break;
 
        case 'register': // Register new extension
-               // Do we have some tasks?
+               // 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?
@@ -358,6 +358,19 @@ ORDER BY
                                if (!isExtensionDeprecated()) {
                                        // ... so we can finally register and load it in registration mode
                                        if (registerExtension($ext_name, $taskId)) {
+                                               // Do we need to update cache file?
+                                               // @TODO Rewrite this to a filter
+                                               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
+                                                       } // END - foreach
+                                               } // END - if
+
                                                // Errors?
                                                if (!ifFatalErrorsDetected()) {
                                                        // Extension was found and successfully registered
@@ -366,16 +379,6 @@ ORDER BY
                                                        // Errors detected!
                                                        displayMessage('{%message,ADMIN_EXTENSION_NOT_REGISTERED=' . $ext_name . '%}');
                                                }
-
-                                               // Do we need to update cache file?
-                                               // @TODO Rewrite this to a filter
-                                               if (isExtensionActive('cache')) {
-                                                       // Remove cache file (will be auto-created again!)
-                                                       if ($GLOBALS['cache_instance']->loadCacheFile('config'))    $GLOBALS['cache_instance']->removeCacheFile();
-                                                       if ($GLOBALS['cache_instance']->loadCacheFile('extension')) $GLOBALS['cache_instance']->removeCacheFile();
-                                                       if ($GLOBALS['cache_instance']->loadCacheFile('filter'))    $GLOBALS['cache_instance']->removeCacheFile();
-                                                       if ($GLOBALS['cache_instance']->loadCacheFile('modules'))   $GLOBALS['cache_instance']->removeCacheFile();
-                                               } // END - if
                                        } elseif (isExtensionInstalled($ext_name)) {
                                                // Notify the admin that we have a problem here...
                                                displayMessage('{--ADMIN_EXTENSION_REGISTRATION_FAILED_ALREADY--}');