Jelajahi Sumber

#35 - modules pre-installation

Alex Trofimov 12 tahun lalu
induk
melakukan
f02a0b94eb

+ 1 - 1
index.php

@@ -17,7 +17,7 @@ if (!file_exists("./inc/header.inc.php"))
     header("Pragma: no-cache");
 
     echo "It seems to be script is <b>not</b> installed.<br />\n";
-    if ( file_exists( "install/index.php" ) ) {
+    if ( file_exists( "install/index.php" ) ) {        
         echo "Please, wait. Redirecting you to installation form...<br />\n";
         echo "<script language=\"javascript\">location.href = 'install/index.php';</script>\n";
     }

+ 9 - 6
install/classes/BxDolInstallSiteConfig.php

@@ -316,13 +316,15 @@ EOF;
         return array();
     }
 
-    public function processModules ($a) 
+    public function processModules ($a)
     {
         require_once(BX_INSTALL_PATH_HEADER);
+        bx_import('BxDolStudioInstallerUtils');
         bx_import('BxDolLanguages');
-        BxDolLanguages::getInstance();
+        BxDolLanguages::getInstance();        
         $oModulesTools = new BxDolInstallModulesTools();
 
+        $aActions = array ('install', 'enable');
         $aTypes = array (BX_DOL_MODULE_TYPE_LANGUAGE, BX_DOL_MODULE_TYPE_TEMPLATE);
         foreach ($aTypes as $sModuleType) {
             $aModules = $oModulesTools->getModules($sModuleType);
@@ -331,10 +333,11 @@ EOF;
                 if (empty($a[$sModuleType]) || $a[$sModuleType] != $sUri)
                     continue;
 
-                bx_import('BxDolStudioInstallerUtils');
-                $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aConfig['home_dir'], 'install');
-                if ((!isset($aResult['result']) || !$aResult['result']) && !empty($aResult['message']))
-                    return array(BX_INSTALL_ERR_GENERAL => $aResult['message']);
+                foreach ($aActions as $sAction) {
+                    $aResult = BxDolStudioInstallerUtils::getInstance()->perform($aConfig['home_dir'], $sAction);
+                    if ((!isset($aResult['result']) || !$aResult['result']) && !empty($aResult['message']))
+                        return array(BX_INSTALL_ERR_GENERAL => $aResult['message']);
+                }
             }            
         } 
 

+ 0 - 1
install/patterns/header.inc.php

@@ -45,7 +45,6 @@ define('BX_DOL_INT_MAX', 2147483647);
 define('BX_DOL_TRANSCODER_OBJ_ICON_APPLE', 'sys_icon_apple');
 define('BX_DOL_TRANSCODER_OBJ_ICON_FACEBOOK', 'sys_icon_facebook');
 define('BX_DOL_TRANSCODER_OBJ_ICON_FAVICON', 'sys_icon_favicon');
-define('BX_DOL_TRANSCODER_OBJ_CMTS_IMAGE_PREVIEW', 'sys_cmts_images_preview');
 
 //--- Module types ---//
 if (!defined('BX_DOL_MODULE_TYPE_MODULE')) {

+ 0 - 22
install/sql/v70.sql

@@ -3503,25 +3503,3 @@ INSERT INTO `sys_std_widgets`(`page_id`, `module`, `url`, `click`, `icon`, `capt
 (@iIdBuilderPermissions, 'system', '{url_studio}builder_permissions.php', '', 'wi-bld-permissions.png', '_adm_wgt_cpt_builder_permissions', '', '');
 INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES(@iIdHome, LAST_INSERT_ID(), 4);
 
--- --------------------------------------------------------
--- Auto installed modules.
--- --------------------------------------------------------
-
---
--- UNI Template
---
-SET @sName = 'bx_uni';
-
-INSERT INTO `sys_std_pages`(`index`, `name`, `header`, `caption`, `icon`) VALUES
-(3, @sName, '', '', 'bx_uni@modules/boonex/basic/|std-pi.png');
-SET @iPageId = LAST_INSERT_ID();
-
-SET @iParentPageId = (SELECT `id` FROM `sys_std_pages` WHERE `name`='home');
-SET @iParentPageOrder = (SELECT MAX(`order`) FROM `sys_std_pages_widgets` WHERE `page_id`=@iParentPageId);
-INSERT INTO `sys_std_widgets`(`page_id`, `module`, `url`, `click`, `icon`, `caption`, `cnt_notices`, `cnt_actions`) VALUES
-(@iPageId, @sName, CONCAT('{url_studio}design.php?name=', @sName), '', 'bx_uni@modules/boonex/basic/|std-wi.png', '_bx_uni_wgt_cpt', '', 'a:4:{s:6:"module";s:6:"system";s:6:"method";s:11:"get_actions";s:6:"params";a:0:{}s:5:"class";s:18:"TemplStudioDesigns";}');
-INSERT INTO `sys_std_pages_widgets`(`page_id`, `widget_id`, `order`) VALUES
-(@iParentPageId, LAST_INSERT_ID(), @iParentPageOrder + 1);
-
-INSERT INTO `sys_modules` (`type`, `name`, `title`, `vendor`, `version`, `product_url`, `update_url`, `path`, `uri`, `class_prefix`, `db_prefix`, `lang_category`, `dependencies`, `date`, `enabled`) VALUES
-('template', 'bx_uni', 'UNI', 'BoonEx', '8.0.0', '', '', 'boonex/uni/', 'uni', 'BxUni', 'bx_uni_', 'BoonEx UNI', '', 0, 1);

+ 0 - 8
modules/boonex/english/data/langs/system.xml

@@ -3827,12 +3827,4 @@ If you don't know how to do it by yourself you can submit <a target="_blank" hre
     <string name="_sys_inst_refresh"><![CDATA[Refresh]]></string>
     <string name="_sys_inst_continue"><![CDATA[Continue]]></string>
 
-    <!-- ********************** -->
-    <!-- Auto Installed Modules -->
-    <!-- ********************** -->
-
-    <!-- UNI Template -->
-    <string name="_bx_uni_wgt_cpt"><![CDATA[UNI]]></string>
-    <string name="_bx_uni_stg_cpt_type"><![CDATA[UNI]]></string>
-    <string name="_bx_uni_stg_cpt_category_system"><![CDATA[General]]></string>
 </resources>