Procházet zdrojové kódy

#5147 NEO APP: blocks/navigation activation

Alex Trofimov před 1 rokem
rodič
revize
cd9a00548b

+ 17 - 0
install/classes/BxDolInstallSiteConfig.php

@@ -353,6 +353,23 @@ EOF;
         if (true !== $mixedRes)
             return $this->dbErrors2ErrorFields($mixedRes);
 
+        $sSqlDir = BX_INSTALL_DIR . 'sql/';
+        if (is_dir($sSqlDir)) {
+            $aFiles = scandir($sSqlDir);
+            foreach ($aFiles as $sFile) {
+                if ($sFile[0] === '.' || $sFile === 'system.sql' || $sFile === 'addon.sql') {
+                    continue;
+                }
+                $sFilePath = $sSqlDir . $sFile;
+                if (is_file($sFilePath)) {
+                    $mixedRes = $oDb->executeSQL($sFilePath, $this->getMarkersForDb($a, $oDb));
+                    if (true !== $mixedRes) {
+                        return $this->dbErrors2ErrorFields($mixedRes);
+                    }
+                }
+            }
+        }
+        
         return array();
     }
 

+ 7 - 0
install/sql/app-nav-blocks.sql

@@ -0,0 +1,7 @@
+--
+-- NEO APP: blocks
+---
+
+UPDATE `sys_pages_blocks` SET `active_api` = 1 WHERE `object` = 'sys_about' AND `title` IN('_sys_page_block_title_about');
+UPDATE `sys_pages_blocks` SET `active_api` = 1 WHERE `object` = 'sys_terms' AND `title` IN('_sys_page_block_title_terms');
+UPDATE `sys_pages_blocks` SET `active_api` = 1 WHERE `object` = 'sys_privacy' AND `title` IN('_sys_page_block_title_privacy');