Skip to content

Commit

Permalink
Ticket #4847 - Studio: Layout changes. Stage 3.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Nov 26, 2024
1 parent f5e0d2e commit 5773405
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
31 changes: 19 additions & 12 deletions studio/template/scripts/BxBaseStudioMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,25 @@ protected function _getMenuItem ($aItem)

$aItem['class'] = isset($aItem['class']) ? $aItem['class'] : '';
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) {
Expand Down
8 changes: 5 additions & 3 deletions studio/template/scripts/BxBaseStudioWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,16 @@
*/

class BxBaseStudioWidget extends BxDolStudioWidget
{
{
protected $bPageMenuIconsInline;
protected $aPageCodeNoWrap;

public function __construct($mixedPageName)
{
parent::__construct($mixedPageName);

$this->aPageCodeNoWrap = array();
$this->bPageMenuIconsInline = true;
$this->aPageCodeNoWrap = [];
}

public function getPageCss()
Expand Down Expand Up @@ -322,7 +324,7 @@ protected function getPageActions($iWidgetId = 0)
protected function getPageMenuObject($aMenu = array(), $aMarkers = array())
{
$oMenu = parent::getPageMenuObject($aMenu, $aMarkers);
$oMenu->setInlineIcons(false);
$oMenu->setInlineIcons($this->bPageMenuIconsInline);

return $oMenu;
}
Expand Down

0 comments on commit 5773405

Please sign in to comment.