]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions-functions.php
More complete rewrite to use wrapper function isExtensionInstalledAndNewer(), some...
[mailer.git] / inc / extensions-functions.php
index ed0c0e8baee9c538350c195d1b82fd7cbfb8f093..23c4d68bb00c6163fb4c14c0d750a303ef39f2c1 100644 (file)
@@ -18,6 +18,7 @@
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -281,7 +282,7 @@ function registerExtension ($ext_name, $task_id, $dry_run = false, $logout = tru
                } // END - for
 
                // Is there no update?
-               if (countExtensionUpdateDependencies(getCurrentExtensionName()) == '0') {
+               if (countExtensionUpdateDependencies(getCurrentExtensionName()) == 0) {
                        // Then test is passed!
                        $test = true;
                } // END - if
@@ -938,7 +939,7 @@ function createExtensionDeactivationTask ($ext) {
        $subject = sprintf("[%s:] %s", $ext, getMessage('TASK_SUBJ_EXTENSION_DEACTIVATED'));
 
        // Not installed and do we have created a task for the admin?
-       if ((determineTaskIdBySubject($subject) == '0') && (getExtensionVersion($ext) != '')) {
+       if ((determineTaskIdBySubject($subject) == '0') && (isExtensionInstalled($ext))) {
                // Task not created so add it
                createNewTask($subject, SQL_ESCAPE(loadTemplate('task_ext_deactivated', true, $ext)), 'EXTENSION_DEACTIVATION');
        } // END - if
@@ -964,7 +965,7 @@ function ifModuleHasMenu ($mod, $forceDb = false) {
                        // Admin/guest/member/sponsor modules have always a menu!
                        $ret = in_array($mod, array('admin', 'index', 'login', 'sponsor'));
                }
-       } elseif ((isExtensionInstalled('sql_patches')) && (getExtensionVersion('sql_patches') >= '0.3.6') && ((!isExtensionActive('cache')) || ($forceDb === true))) {
+       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.3.6')) && ((!isExtensionActive('cache')) || ($forceDb === true))) {
                // Check database for entry
                $result = SQL_QUERY_ESC("SELECT `has_menu` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `module`='%s' LIMIT 1",
                        array($mod), __FUNCTION__, __LINE__);