AntonLV 6 years ago
parent
commit
920182112f
2 changed files with 22 additions and 18 deletions
  1. 21 17
      inc/classes/BxDolDesigns.php
  2. 1 1
      modules/boonex/protean/install/sql/install.sql

+ 21 - 17
inc/classes/BxDolDesigns.php

@@ -50,40 +50,44 @@ class BxDolDesigns extends BxDolFactory implements iBxDolSingleton
 
 
     	$aDesign = BxDolModuleQuery::getInstance()->getModuleByUri($this->sDesign);
     	$aDesign = BxDolModuleQuery::getInstance()->getModuleByUri($this->sDesign);
     	if(!empty($aDesign) && is_array($aDesign))
     	if(!empty($aDesign) && is_array($aDesign))
-    		$this->oDesign = BxDolModule::getInstance($aDesign['name']);
+            $this->oDesign = BxDolModule::getInstance($aDesign['name']);
 
 
     	//--- Init site's logo params.
     	//--- Init site's logo params.
     	if($this->oDesign instanceof BxDolModule && method_exists($this->oDesign->_oConfig, 'getLogoParams'))
     	if($this->oDesign instanceof BxDolModule && method_exists($this->oDesign->_oConfig, 'getLogoParams'))
-    		list(
-    			$this->aParams['logo'], 
-    			$this->aParams['logo_alt'], 
-    			$this->aParams['logo_width'], 
-    			$this->aParams['logo_height']
-    		) = $this->oDesign->_oConfig->getLogoParams();
+            list(
+                $this->aParams['logo'], 
+                $this->aParams['logo_alt'], 
+                $this->aParams['logo_width'], 
+                $this->aParams['logo_height']
+            ) = $this->oDesign->_oConfig->getLogoParams();
     }
     }
 
 
     public function getSiteLogo()
     public function getSiteLogo()
     {
     {
     	return $this->getSiteLogoParam('logo');
     	return $this->getSiteLogoParam('logo');
     }
     }
-	public function getSiteLogoAlt()
+
+    public function getSiteLogoAlt()
     {
     {
     	return $this->getSiteLogoParam('logo_alt');
     	return $this->getSiteLogoParam('logo_alt');
     }
     }
-	public function getSiteLogoWidth()
+
+    public function getSiteLogoWidth()
     {
     {
-    	return $this->getSiteLogoParam('logo_width');
+    	return $this->getSiteLogoParam('logo_width', !$this->oDesign->_oConfig->getLogo());
     }
     }
-	public function getSiteLogoHeight()
+
+    public function getSiteLogoHeight()
     {
     {
-    	return $this->getSiteLogoParam('logo_height');
+    	return $this->getSiteLogoParam('logo_height', !$this->oDesign->_oConfig->getLogo());
     }
     }
-    protected function getSiteLogoParam($sName)
+
+    protected function getSiteLogoParam($sName, $bGetSystem = false)
     {
     {
-    	if(!empty($this->aParams[$sName])) {
-    		$sResult = getParam($this->aParams[$sName]);
-    		if(!empty($sResult))
-    			return $sResult;
+    	if(!empty($this->aParams[$sName]) && !$bGetSystem) {
+            $sResult = getParam($this->aParams[$sName]);
+            if(!empty($sResult))
+                return $sResult;
     	}
     	}
 
 
     	return getParam('sys_site_' . $sName);
     	return getParam('sys_site_' . $sName);

+ 1 - 1
modules/boonex/protean/install/sql/install.sql

@@ -42,7 +42,7 @@ INSERT INTO `sys_options`(`category_id`, `name`, `caption`, `value`, `type`, `ex
 (@iCategoryId, CONCAT(@sName, '_header_bg_image_size'), '_bx_protean_stg_cpt_option_header_bg_image_size', 'cover', 'select', 'auto,cover,contain', '', '', 7),
 (@iCategoryId, CONCAT(@sName, '_header_bg_image_size'), '_bx_protean_stg_cpt_option_header_bg_image_size', 'cover', 'select', 'auto,cover,contain', '', '', 7),
 (@iCategoryId, CONCAT(@sName, '_site_logo'), '_bx_protean_stg_cpt_option_site_logo', '', 'image', '', '', '', 8),
 (@iCategoryId, CONCAT(@sName, '_site_logo'), '_bx_protean_stg_cpt_option_site_logo', '', 'image', '', '', '', 8),
 (@iCategoryId, CONCAT(@sName, '_site_logo_alt'), '_bx_protean_stg_cpt_option_site_logo_alt', '', 'text', '', '', '', 9),
 (@iCategoryId, CONCAT(@sName, '_site_logo_alt'), '_bx_protean_stg_cpt_option_site_logo_alt', '', 'text', '', '', '', 9),
-(@iCategoryId, CONCAT(@sName, '_site_logo_width'), '_bx_protean_stg_cpt_option_site_logo_width', '240', 'digit', '', '', '', 0),
+(@iCategoryId, CONCAT(@sName, '_site_logo_width'), '_bx_protean_stg_cpt_option_site_logo_width', '240', 'digit', '', '', '', 10),
 (@iCategoryId, CONCAT(@sName, '_site_logo_height'), '_bx_protean_stg_cpt_option_site_logo_height', '48', 'digit', '', '', '', 11),
 (@iCategoryId, CONCAT(@sName, '_site_logo_height'), '_bx_protean_stg_cpt_option_site_logo_height', '48', 'digit', '', '', '', 11),
 (@iCategoryId, CONCAT(@sName, '_header_border_color'), '_bx_protean_stg_cpt_option_header_border_color', 'rgba(0, 0, 0, 0.2)', 'rgba', '', '', '', 12),
 (@iCategoryId, CONCAT(@sName, '_header_border_color'), '_bx_protean_stg_cpt_option_header_border_color', 'rgba(0, 0, 0, 0.2)', 'rgba', '', '', '', 12),
 (@iCategoryId, CONCAT(@sName, '_header_border_size'), '_bx_protean_stg_cpt_option_header_border_size', '1px', 'digit', '', '', '', 13),
 (@iCategoryId, CONCAT(@sName, '_header_border_size'), '_bx_protean_stg_cpt_option_header_border_size', '1px', 'digit', '', '', '', 13),