|
@@ -852,24 +852,10 @@ BLAH;
|
|
|
$sClassValue = !empty($aParams['class_value']) ? $aParams['class_value'] : '';
|
|
$sClassValue = !empty($aParams['class_value']) ? $aParams['class_value'] : '';
|
|
|
|
|
|
|
|
$aTmplVarsIcon = [];
|
|
$aTmplVarsIcon = [];
|
|
|
- if(!empty($aInput['icon'])) {
|
|
|
|
|
- list ($sIcon, $sIconUrl, $sIconA, $sIconHtml) = BxTemplFunctions::getInstanceWithTemplate($this->oTemplate)->getIcon($aInput['icon']);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ if(!empty($aInput['icon']))
|
|
|
$aTmplVarsIcon = [
|
|
$aTmplVarsIcon = [
|
|
|
- 'bx_if:icon' => [
|
|
|
|
|
- 'condition' => (bool)$sIcon,
|
|
|
|
|
- 'content' => ['icon' => $sIcon],
|
|
|
|
|
- ],
|
|
|
|
|
- 'bx_if:icon-html' => [
|
|
|
|
|
- 'condition' => (bool)$sIconHtml,
|
|
|
|
|
- 'content' => ['icon' => $sIconHtml],
|
|
|
|
|
- ],
|
|
|
|
|
- 'bx_if:image_inline' => [
|
|
|
|
|
- 'condition' => false,
|
|
|
|
|
- 'content' => ['image' => ''],
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ 'icon' => $this->genIcon($aInput['icon'])
|
|
|
];
|
|
];
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
return $this->oTemplate->parseHtmlByName('form_view_row.html', [
|
|
return $this->oTemplate->parseHtmlByName('form_view_row.html', [
|
|
|
'type' => $aInput['type'],
|
|
'type' => $aInput['type'],
|
|
@@ -1561,8 +1547,16 @@ BLAH;
|
|
|
if($aInput['type'] == 'submit')
|
|
if($aInput['type'] == 'submit')
|
|
|
$sClassAdd .= ' bx-btn-primary';
|
|
$sClassAdd .= ' bx-btn-primary';
|
|
|
|
|
|
|
|
|
|
+ $aTmplVarsIcon = [];
|
|
|
|
|
+ if(isset($aInput['icon']) && ($sIcon = $this->genIcon($aInput['icon'])))
|
|
|
|
|
+ $aTmplVarsIcon = ['icon' => $sIcon];
|
|
|
|
|
+
|
|
|
return $this->oTemplate->parseHtmlByName('form_field_button.html', [
|
|
return $this->oTemplate->parseHtmlByName('form_field_button.html', [
|
|
|
'attrs' => bx_convert_array2attrs($aAttrs, $sClassAdd),
|
|
'attrs' => bx_convert_array2attrs($aAttrs, $sClassAdd),
|
|
|
|
|
+ 'bx_if:show_icon' => [
|
|
|
|
|
+ 'condition' => !empty($aTmplVarsIcon),
|
|
|
|
|
+ 'content' => $aTmplVarsIcon
|
|
|
|
|
+ ],
|
|
|
'value' => $aInput['value']
|
|
'value' => $aInput['value']
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
@@ -2403,6 +2397,29 @@ BLAH;
|
|
|
]);
|
|
]);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function genIcon($sIcon)
|
|
|
|
|
+ {
|
|
|
|
|
+ if(!$sIcon)
|
|
|
|
|
+ return '';
|
|
|
|
|
+
|
|
|
|
|
+ list ($sIcon, $sIconUrl, $sIconA, $sIconHtml) = BxTemplFunctions::getInstanceWithTemplate($this->oTemplate)->getIcon($sIcon);
|
|
|
|
|
+
|
|
|
|
|
+ return $this->oTemplate->parseHtmlByName('form_input_icon.html', [
|
|
|
|
|
+ 'bx_if:icon' => [
|
|
|
|
|
+ 'condition' => (bool)$sIcon,
|
|
|
|
|
+ 'content' => ['icon' => $sIcon],
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'bx_if:icon-html' => [
|
|
|
|
|
+ 'condition' => (bool)$sIconHtml,
|
|
|
|
|
+ 'content' => ['icon' => $sIconHtml],
|
|
|
|
|
+ ],
|
|
|
|
|
+ 'bx_if:image_inline' => [
|
|
|
|
|
+ 'condition' => false,
|
|
|
|
|
+ 'content' => ['image' => ''],
|
|
|
|
|
+ ]
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function genInfoIcon($sInfo)
|
|
function genInfoIcon($sInfo)
|
|
|
{
|
|
{
|
|
|
return '<div class="bx-form-info bx-def-font-grayed bx-def-font-small mt-1">' . bx_process_output($sInfo, BX_DATA_HTML) . '</div>';
|
|
return '<div class="bx-form-info bx-def-font-grayed bx-def-font-small mt-1">' . bx_process_output($sInfo, BX_DATA_HTML) . '</div>';
|