Преглед изворни кода

Ticket #4847 - Studio: Layout changes. Stage 3.

AntonLV пре 1 година
родитељ
комит
5773405220
2 измењених фајлова са 24 додато и 15 уклоњено
  1. 19 12
      studio/template/scripts/BxBaseStudioMenu.php
  2. 5 3
      studio/template/scripts/BxBaseStudioWidget.php

+ 19 - 12
studio/template/scripts/BxBaseStudioMenu.php

@@ -40,18 +40,25 @@ class BxBaseStudioMenu extends BxDolStudioMenu
 
 
         $aItem['class'] = isset($aItem['class']) ? $aItem['class'] : '';
         $aItem['class'] = isset($aItem['class']) ? $aItem['class'] : '';
         if($this->_bInlineIcons && $aItem['bx_if:image']['condition'] && strpos($aItem['icon'], '.svg') !== false) {
         if($this->_bInlineIcons && $aItem['bx_if:image']['condition'] && strpos($aItem['icon'], '.svg') !== false) {
-            $aItem = array_merge($aItem, array(
-                'bx_if:image' => array (
-                    'condition' => false,
-                    'content' => array(),
-                ),
-                'bx_if:image_inline' => array (
-                    'condition' => true,
-                    'content' => array(
-                        'image' => file_get_contents($this->_oTemplate->getIconPath($aItem['icon']))
-                    ),
-                ),
-            ));
+            $sImage = '';
+            if(($sIconPath = $this->_oTemplate->getIconPath($aItem['icon'])))
+                $sImage = file_get_contents($sIconPath);
+            else 
+                $sImage = bx_file_get_contents($aItem['icon']);
+
+            if($sImage)            
+                $aItem = array_merge($aItem, [
+                    'bx_if:image' => [
+                        'condition' => false,
+                        'content' => [],
+                    ],
+                    'bx_if:image_inline' => [
+                        'condition' => true,
+                        'content' => [
+                            'image' => $sImage
+                        ],
+                    ],
+                ]);
         }
         }
 
 
         if($this->_bMenuSide) {
         if($this->_bMenuSide) {

+ 5 - 3
studio/template/scripts/BxBaseStudioWidget.php

@@ -9,14 +9,16 @@
  */
  */
 
 
 class BxBaseStudioWidget extends BxDolStudioWidget
 class BxBaseStudioWidget extends BxDolStudioWidget
-{    
+{
+    protected $bPageMenuIconsInline;
     protected $aPageCodeNoWrap;
     protected $aPageCodeNoWrap;
 
 
     public function __construct($mixedPageName)
     public function __construct($mixedPageName)
     {
     {
         parent::__construct($mixedPageName);
         parent::__construct($mixedPageName);
 
 
-        $this->aPageCodeNoWrap = array();
+        $this->bPageMenuIconsInline = true;
+        $this->aPageCodeNoWrap = [];
     }
     }
 
 
     public function getPageCss()
     public function getPageCss()
@@ -322,7 +324,7 @@ class BxBaseStudioWidget extends BxDolStudioWidget
     protected function getPageMenuObject($aMenu = array(), $aMarkers = array())
     protected function getPageMenuObject($aMenu = array(), $aMarkers = array())
     {
     {
         $oMenu = parent::getPageMenuObject($aMenu, $aMarkers);
         $oMenu = parent::getPageMenuObject($aMenu, $aMarkers);
-        $oMenu->setInlineIcons(false);
+        $oMenu->setInlineIcons($this->bPageMenuIconsInline);
 
 
         return $oMenu;
         return $oMenu;
     }
     }