diff --git a/application/views/themeOptions/options_core.php b/application/views/themeOptions/options_core.php index 22ecb3874f7..18a0f90c98d 100644 --- a/application/views/themeOptions/options_core.php +++ b/application/views/themeOptions/options_core.php @@ -4,13 +4,9 @@ $dropdown_options['font'] = ($bInherit ? '' : ''); - - // background file $backgroundImageFile = ''; - $backgroundfileOptionsInherit = ''; - $backgroundfileInheritPreview = ''; - $backgroundfileInheritFilename = ''; + $backgroundfileInheritPreview = ''; $optgroup = ''; foreach($aTemplateConfiguration['imageFileList'] as $image){ if ($image['group'] != $optgroup){ @@ -22,10 +18,12 @@ } $backgroundImageFile .= ''; - if (isset($oParentOptions['backgroundimagefile']) && $oParentOptions['backgroundimagefile'] == $image['filepath']){ - $backgroundfileInheritPreview = $backgroundfileInheritPreview . $image['preview']; - $backgroundfileInheritFilename = $backgroundfileInheritFilename . $image['filename']; + + if (isset($oParentOptions['backgroundimagefile']) && ($oParentOptions['backgroundimagefile'] == $image['filepath'] || $oParentOptions['backgroundimagefile'] == $image['filepathOptions'])) { + + $backgroundfileInheritPreview = $image['preview']; } + $backgroundImageFile .= ''; } @@ -33,9 +31,7 @@ // brand logo file $brandlogo = ''; - $logofileOptionsInherit = ''; $logofileInheritPreview = ''; - $logofileInheritFilename = ''; $optgroup = ''; foreach($aTemplateConfiguration['imageFileList'] as $image){ if ($image['group'] != $optgroup){ @@ -47,10 +43,12 @@ } $brandlogo .= ''; - if ($oParentOptions['brandlogo'] == $image['filepath']){ - $logofileInheritPreview = $logofileInheritPreview . $image['preview']; - $logofileInheritFilename = $logofileInheritFilename . $image['filename']; + + if (isset($oParentOptions['brandlogofile']) && ($oParentOptions['brandlogofile'] == $image['filepath'] || $oParentOptions['brandlogofile'] == $image['filepathOptions'])) { + + $logofileInheritPreview = $image['preview']; } + $brandlogo .= ''; } @@ -158,23 +156,39 @@ // TODO: $aParentOptions is not loaded properly, it seems. $sParentOption = 'N/A'; } + $classes = [ + 'form-control', + 'selector_option_value_field', + 'selector_radio_childfield', + ]; + if ($category === 'Images') { + $classes[] = 'selector_image_selector'; + } + $classValue = implode(' ', $classes); echo '
- '; if ($bInherit){ - if ($attributeKey == 'backgroundimagefile'){ - $inheritedValue = isset($backgroundfileInheritPreview) ? $backgroundfileInheritPreview : ''; - } elseif ($attributeKey == 'backgroundimagefile'){ - $inheritedValue = isset($logofileInheritPreview) ? $logofileInheritPreview : ''; - } else { - $inheritedValue = isset($sParentOption) ? $sParentOption : ''; + + $dataAttributes = ''; + $lightboxSrc = ''; + $inheritedValue = isset($sParentOption) ? $sParentOption : ''; + + if ($attributeKey == 'backgroundimagefile' && !empty($backgroundfileInheritPreview)){ + $lightboxSrc = $backgroundfileInheritPreview; + } elseif ($attributeKey == 'brandlogofile' && !empty($logofileInheritPreview)) { + $lightboxSrc = $logofileInheritPreview; } - echo ''; + + if ($category === 'Images') { + $dataAttributes = 'data-lightbox-src="' . $lightboxSrc . '"'; + } + + echo ''; } // dropdown options from config.xml file echo $aOptionAttributes['optionAttributes'][$attributeKey]['dropdownoptions']; echo '
'; - } elseif ($attribute['type'] == 'icon'){ echo '