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 Dec 25, 2024
1 parent be91725 commit c40231a
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 33 deletions.
4 changes: 3 additions & 1 deletion studio/template/bp_blocks.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<bx_if:show_link>
<a class="text-gray-800 dark:text-gray-200 hover:text-gray-900 dark:hover:text-gray-100" href="javascript:void(0)" onclick="javascript:__onclick__">__title__</a>
</bx_if:show_link>
<bx_if:show_text>__title__</bx_if:show_text>
<bx_if:show_text>
<span class="text-gray-800 dark:text-gray-200">__title__</span>
</bx_if:show_text>
<bx_if:show_api>
<img class="bx-std-api" src="<bx_icon_url:api.svg />" title="<bx_text_attribute:_adm_txt_active_api />" />
</bx_if:show_api>
Expand Down
68 changes: 36 additions & 32 deletions studio/template/scripts/BxBaseStudioBuilderPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -1822,64 +1822,68 @@ protected function getBlockList($sModule)

$oForm = new BxTemplStudioFormView(array());

$aInputCheckbox = array(
$aInputCheckbox = [
'type' => 'checkbox',
'name' => 'blocks[]',
'attrs' => array(
'attrs' => [
'onChange' => 'javascript:' . $sJsObject . '.onSelectBlock(this);'
),
],
'value' => ''
);
];

$aTmplParams = array(
$aTmplParams = [
'html_block_list_id' => $this->aHtmlIds['block_list_id'] . $sModule,
'bx_repeat:blocks' => array()
);
'bx_repeat:blocks' => []
];

$aBlocks = $this->getBlocks($sModule);
foreach($aBlocks as $aBlock) {
list($sIcon, $sIconUrl) = $this->getBlockIcon($aBlock);

$aInputCheckbox['value'] = $aBlock['id'];

$aTmplParams['bx_repeat:blocks'][] = array(
$aTmplParams['bx_repeat:blocks'][] = [
'js_object' => $sJsObject,
'html_id' => $this->aHtmlIds['block_id'] . $aBlock['id'],
'bx_if:is_inactive' => array(
'condition' => false,
'content' => array()
'content' => [true]
),
'bx_if:show_link' => array(
'bx_if:show_link' => [
'condition' => false,
'content' => array()
),
'bx_if:show_text' => array(
'content' => [true]
],
'bx_if:show_text' => [
'condition' => true,
'content' => array(
'content' => [
'title' => _t(!empty($aBlock['title_system']) ? $aBlock['title_system'] : $aBlock['title']),
)
),
'bx_if:image' => array (
'condition' => (bool)$sIconUrl,
'content' => array('icon_url' => $sIconUrl),
),
'bx_if:icon' => array (
'condition' => (bool)$sIcon,
'content' => array('icon' => $sIcon),
),
]
],
'bx_if:show_api' => [
'condition' => false,
'content' => [true]
],
'bx_if:image' => [
'condition' => (bool)$sIconUrl,
'content' => array('icon_url' => $sIconUrl),
],
'bx_if:icon' => [
'condition' => (bool)$sIcon,
'content' => ['icon' => $sIcon],
],
'module' => $this->getModuleTitle($aBlock['module']),
'visible_for' => _t('_adm_bp_txt_visible_for', BxDolStudioUtils::getVisibilityTitle($aBlock['visible_for_levels'])),
'bx_if:show_checkbox' => array(
'bx_if:show_checkbox' => [
'condition' => true,
'content' => array(
'content' => [
'content' => $oForm->genRow($aInputCheckbox)
)
),
'bx_if:show_drag_handle' => array(
]
],
'bx_if:show_drag_handle' => [
'condition' => false,
'content' => array()
)
);
'content' => []
]
];
}

return $oTemplate->parseHtmlByName('bp_blocks_list.html', $aTmplParams);
Expand Down

0 comments on commit c40231a

Please sign in to comment.