11<?php
2+
23/**
34 * @package Astroid Framework
45 * @author JoomDev https://www.joomdev.com
2526$ params = new JRegistry ();
2627$ params ->loadString ($ item ->params );
2728
28- $ astroid_banner_visibility = $ params ->get ('astroid_banner_visibility ' ,"currentPage " );
29- if ($ astroid_banner_visibility =="currentPage " ){
29+ $ astroid_banner_visibility = $ params ->get ('astroid_banner_visibility ' , "currentPage " );
30+ if ($ astroid_banner_visibility == "currentPage " ) {
3031 if ((isset ($ item ->query ['option ' ]) && $ item ->query ['option ' ] != $ jinput ->get ('option ' , '' )) || (isset ($ item ->query ['view ' ]) && $ item ->query ['view ' ] != $ jinput ->get ('view ' , '' )) || (isset ($ item ->query ['layout ' ]) && $ item ->query ['layout ' ] != $ jinput ->get ('layout ' , '' ))) {
3132 return ;
3233 }
3334}
35+ $ style = [];
3436
3537$ astroid_banner_enabled = $ params ->get ('astroid_banner_enabled ' );
3638if ($ astroid_banner_enabled ) {
4244 $ astroid_banner_title_tag = $ params ->get ('astroid_banner_title_tag ' , 'h3 ' );
4345 }
4446 $ astroid_banner_bgcolor = $ params ->get ('astroid_banner_bgcolor ' , '' );
47+
4548 $ astroid_banner_bgimage = $ params ->get ('astroid_banner_bgimage ' , '' );
49+ $ astroid_banner_bgimage_position = $ params ->get ('astroid_banner_bgimage_position ' , '' );
50+ if ($ astroid_banner_bgimage_position == 'custom ' ) {
51+ $ astroid_banner_bgimage_position_x = $ params ->get ('astroid_banner_bgimage_position_x ' , '' );
52+ $ astroid_banner_bgimage_position_y = $ params ->get ('astroid_banner_bgimage_position_y ' , '' );
53+ if (!empty ($ astroid_banner_bgimage_position_x )) {
54+ $ style [] = 'background-position-x: ' . $ astroid_banner_bgimage_position_x ;
55+ }
56+ if (!empty ($ astroid_banner_bgimage_position_y )) {
57+ $ style [] = 'background-position-y: ' . $ astroid_banner_bgimage_position_y ;
58+ }
59+ } elseif (!empty ($ astroid_banner_bgimage_position )) {
60+ $ style [] = 'background-position: ' . $ astroid_banner_bgimage_position ;
61+ }
62+ $ astroid_banner_bgimage_repeat = $ params ->get ('astroid_banner_bgimage_repeat ' , '' );
63+ if (!empty ($ astroid_banner_bgimage_repeat )) {
64+ $ style [] = 'background-repeat: ' . $ astroid_banner_bgimage_repeat ;
65+ }
66+ $ astroid_banner_bgimage_size = $ params ->get ('astroid_banner_bgimage_size ' , '' );
67+ if ($ astroid_banner_bgimage_size == 'custom ' ) {
68+ $ astroid_banner_bgimage_width = $ params ->get ('astroid_banner_bgimage_width ' , '' );
69+ if (!empty ($ astroid_banner_bgimage_width )) {
70+ $ style [] = 'background-size: ' . $ astroid_banner_bgimage_width ;
71+ }
72+ } elseif (!empty ($ astroid_banner_bgimage_size )) {
73+ $ style [] = 'background-size: ' . $ astroid_banner_bgimage_size ;
74+ }
75+
76+ $ astroid_banner_bgimage_attachment = $ params ->get ('astroid_banner_bgimage_attachment ' , '' );
77+ if (!empty ($ astroid_banner_bgimage_attachment )) {
78+ $ style [] = 'background-attachment: ' . $ astroid_banner_bgimage_attachment ;
79+ }
80+
4681 $ astroid_banner_class = $ params ->get ('astroid_banner_class ' , '' );
4782 $ astroid_banner_wrapper = $ params ->get ('astroid_banner_wrapper ' , '' );
4883 $ astroid_banner_textcolor = $ params ->get ('astroid_banner_textcolor ' , '' );
4984
50- $ style = [];
85+
5186 if (!empty ($ astroid_banner_bgcolor )) {
5287 $ style [] = 'background-color: ' . $ astroid_banner_bgcolor ;
5388 }
5489 if (!empty ($ astroid_banner_bgimage )) {
5590 $ style [] = 'background-image:url( ' . $ astroid_banner_bgimage . ') ' ;
5691 }
5792 $ style = !empty ($ style ) ? 'style=" ' . implode ('; ' , $ style ) . '" ' : '' ;
58- $ styletext = [];
59- if (!empty ($ astroid_banner_textcolor )){
93+ $ styletext = [];
94+ if (!empty ($ astroid_banner_textcolor )) {
6095 $ styletext [] = 'color: ' . $ astroid_banner_textcolor ;
6196 }
6297 $ styletext = !empty ($ styletext ) ? 'style=" ' . implode ('; ' , $ styletext ) . '" ' : '' ;
6398 ?>
64- <div class="astroid-banner-inner<?php echo !empty ($ astroid_banner_class ) ? ' ' . $ astroid_banner_class : '' ; ?> " <?php echo $ style ; ?> >
99+ <div class="astroid-banner-inner<?php echo !empty ($ astroid_banner_class ) ? ' ' . $ astroid_banner_class : '' ; ?> " <?php echo $ style ; ?> >
65100 <?php
66- if (!empty ($ astroid_banner_wrapper )) {
67- echo '<div class=" ' . $ astroid_banner_wrapper . '"> ' ;
68- }
69- if ($ astroid_banner_title_enabled ) {
70- echo '< ' . $ astroid_banner_title_tag . ' class="astroid-banner-title" ' . $ styletext . '> ' . $ astroid_banner_title . '</ ' . $ astroid_banner_title_tag . '> ' ;
71- if (!empty ($ astroid_banner_subtitle )) {
72- echo '<span class="astroid-banner-subtitle" ' . $ styletext . '> ' . $ astroid_banner_subtitle . '</span> ' ;
101+ if (!empty ($ astroid_banner_wrapper )) {
102+ echo '<div class=" ' . $ astroid_banner_wrapper . '"> ' ;
73103 }
74- }
75- if (!empty ($ astroid_banner_wrapper )) {
76- echo '</div> ' ;
77- }
78- ?>
104+ if ($ astroid_banner_title_enabled ) {
105+ echo '< ' . $ astroid_banner_title_tag . ' class="astroid-banner-title" ' . $ styletext . '> ' . $ astroid_banner_title . '</ ' . $ astroid_banner_title_tag . '> ' ;
106+ if (!empty ($ astroid_banner_subtitle )) {
107+ echo '<span class="astroid-banner-subtitle" ' . $ styletext . '> ' . $ astroid_banner_subtitle . '</span> ' ;
108+ }
109+ }
110+ if (!empty ($ astroid_banner_wrapper )) {
111+ echo '</div> ' ;
112+ }
113+ ?>
79114 </div>
80- <?php
115+ <?php
81116}
82117?>
0 commit comments