AntonLV 10 ani în urmă
părinte
comite
f20bc81dd0

+ 1 - 1
inc/classes/BxDolModuleQuery.php

@@ -185,7 +185,7 @@ class BxDolModuleQuery extends BxDolDb implements iBxDolSingleton
 
     function getDependent($sUri)
     {
-        $sSql = "SELECT `id`, `title` FROM `sys_modules` WHERE `dependencies` LIKE " . $this->escape('%' . $sUri . '%');
+        $sSql = "SELECT `id`, `title`, `enabled` FROM `sys_modules` WHERE `dependencies` LIKE " . $this->escape('%' . $sUri . '%') . " AND `enabled`='1'";
         return $this->getAll($sSql);
     }
 

+ 2 - 2
modules/boonex/english/data/langs/system/en.xml

@@ -616,8 +616,8 @@
 	<string name="_adm_err_modules_pending_uninstall"><![CDATA[Module uninstall was postponed. Module will be uninstalled automatically after all its files are deleted.]]></string>
 	<string name="_adm_err_modules_pending_uninstall_already"><![CDATA[Module is pending uninstall already.]]></string>
 	<string name="_adm_err_modules_process_action_failed"><![CDATA[An error occurred. Contact with module's vendor]]></string>
-	<string name="_adm_err_modules_wrong_dependency_disable"><![CDATA[Failed to disable. The module has the following dependent modules. You need to disable them first.]]></string>
-	<string name="_adm_err_modules_wrong_dependency_install"><![CDATA[The following modules should be installed first:]]></string>
+	<string name="_adm_err_modules_wrong_dependency_disable"><![CDATA[Failed to disable. The module has the following dependent modules. At least you need to disable them first.]]></string>
+	<string name="_adm_err_modules_wrong_dependency_install"><![CDATA[The following modules should be installed and activated first:]]></string>
 	<string name="_adm_err_modules_wrong_dependency_uninstall"><![CDATA[Failed to uninstall. The module has the following dependent modules. You need to uninstall them first.]]></string>
 	<string name="_adm_err_modules_wrong_mysql_query"><![CDATA[There are errors in the following MySQL queries:]]></string>
 	<string name="_adm_err_modules_wrong_mysql_query_msg"><![CDATA[Error: {0}]]></string>

+ 2 - 2
modules/boonex/russian/data/langs/system/ru.xml

@@ -616,8 +616,8 @@
 	<string name="_adm_err_modules_pending_uninstall"><![CDATA[Удаление модуль отложено. Модуль будет удалён автоматически после удаления всех его файлов.]]></string>
 	<string name="_adm_err_modules_pending_uninstall_already"><![CDATA[Модуль уже находится в ожидании удаления.]]></string>
 	<string name="_adm_err_modules_process_action_failed"><![CDATA[Произошла ошибка. Свяжитесь с продавцом модуля]]></string>
-	<string name="_adm_err_modules_wrong_dependency_disable"><![CDATA[Невозможно отменить. У модуля есть следующие зависимые модули. Нужно сначала отменить их.]]></string>
-	<string name="_adm_err_modules_wrong_dependency_install"><![CDATA[Сначала нужно установить следующие модули:]]></string>
+	<string name="_adm_err_modules_wrong_dependency_disable"><![CDATA[Невозможно деативировать. У модуля есть следующие зависимые модули. Нужно сначала как минимум деативировать их.]]></string>
+	<string name="_adm_err_modules_wrong_dependency_install"><![CDATA[Сначала нужно установить и активировать следующие модули:]]></string>
 	<string name="_adm_err_modules_wrong_dependency_uninstall"><![CDATA[Невозможно удалить. У модуля есть следующие зависимые модули. Нужно сначала удалить их.]]></string>
 	<string name="_adm_err_modules_wrong_mysql_query"><![CDATA[В следующих MySQL-запросах имеются ошибки:]]></string>
 	<string name="_adm_err_modules_wrong_mysql_query_msg"><![CDATA[Ошибка: {0}]]></string>

+ 8 - 1
studio/classes/BxDolStudioInstaller.php

@@ -143,6 +143,10 @@ class BxDolStudioInstaller extends BxDolInstallerUtils
 
     public function install($aParams, $bAutoEnable = false)
     {
+    	//--- Auto uninstall before install ---//
+    	$this->disable($aParams);
+    	$this->uninstall($aParams);
+
     	$bAutoEnable = $bAutoEnable || (isset($aParams['auto_enable']) && (bool)$aParams['auto_enable']);
     	$bHtmlResponce = isset($aParams['html_response']) && (bool)$aParams['html_response'];
 
@@ -351,6 +355,9 @@ class BxDolStudioInstaller extends BxDolInstallerUtils
 
     public function enable($aParams)
     {
+    	//--- Auto disable before enable ---//
+    	$this->disable($aParams);
+
         $aModule = $this->oDb->getModuleByUri($this->_aConfig['home_uri']);
 
         //--- Check whether the module is installed ---//
@@ -496,7 +503,7 @@ class BxDolStudioInstaller extends BxDolInstallerUtils
                 return BX_DOL_STUDIO_INSTALLER_SUCCESS;
 
             foreach($this->_aConfig['dependencies'] as $sModuleUri => $sModuleTitle)
-                if(!$this->oDb->isModule($sModuleUri))
+                if(!$this->oDb->isModule($sModuleUri) || !$this->oDb->isEnabled($sModuleUri))
                     $sContent .= $sModuleTitle . '<br />';
 
             if(!empty($sContent))

+ 1 - 1
studio/classes/BxDolStudioInstallerQuery.php

@@ -61,7 +61,7 @@ class BxDolStudioInstallerQuery extends BxDolModuleQuery
 
         $sDependencies = '';
         if(isset($aConfig['dependencies']) && is_array($aConfig['dependencies']))
-            $sDependencies = implode(',', $aConfig['dependencies']);
+            $sDependencies = implode(',', array_keys($aConfig['dependencies']));
 
         $sQuery = $this->prepare("INSERT IGNORE INTO `sys_modules`(`type`, `name`, `title`, `vendor`, `version`, `help_url`, `path`, `uri`, `class_prefix`, `db_prefix`, `lang_category`, `dependencies`, `date`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, UNIX_TIMESTAMP())", $aConfig['type'], $aConfig['name'], $aConfig['title'], $aConfig['vendor'], $aConfig['version'], $sHelpUrl, $aConfig['home_dir'], $aConfig['home_uri'], $aConfig['class_prefix'], $aConfig['db_prefix'], $aConfig['language_category'], $sDependencies);
         $iResult = (int)$this->query($sQuery);

+ 1 - 1
studio/js/design.js

@@ -8,7 +8,7 @@
 function BxDolStudioDesign(oOptions) {
 	this.sActionsUrl = oOptions.sActionUrl;
     this.sObjName = oOptions.sObjName == undefined ? 'oBxDolStudioDesign' : oOptions.sObjName;
-    this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
+    this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
     this.iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
 }
 BxDolStudioDesign.prototype.activate = function(sTemplateName, oChecbox) {

+ 1 - 1
studio/js/language.js

@@ -8,7 +8,7 @@
 function BxDolStudioLanguage(oOptions) {
 	this.sActionsUrl = oOptions.sActionUrl;
     this.sObjName = oOptions.sObjName == undefined ? 'oBxDolStudioLanguage' : oOptions.sObjName;
-    this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'slide' : oOptions.sAnimationEffect;
+    this.sAnimationEffect = oOptions.sAnimationEffect == undefined ? 'fade' : oOptions.sAnimationEffect;
     this.iAnimationSpeed = oOptions.iAnimationSpeed == undefined ? 'slow' : oOptions.iAnimationSpeed;
 }
 BxDolStudioLanguage.prototype.activate = function(sLanguageName, oChecbox) {