File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1313
1414use Joomla \CMS \Component \ComponentHelper ;
1515use Joomla \CMS \Factory ;
16+ use Joomla \CMS \HTML \HTMLHelper ;
1617use Joomla \CMS \Language \Text ;
1718use Joomla \CMS \Menu \MenuItem ;
1819use Joomla \Component \Menus \Administrator \Helper \MenusHelper ;
@@ -159,6 +160,29 @@ public static function preprocess($parent)
159160 continue ;
160161 }
161162 }
163+ elseif ($ item ->element === 'com_menus ' )
164+ {
165+ // Get badges for Menus containing a Home page.
166+ $ iconImage = $ item ->icon ;
167+
168+ if ($ iconImage )
169+ {
170+ if (substr ($ iconImage , 0 , 6 ) === 'class: ' && substr ($ iconImage , 6 ) === 'icon-home ' )
171+ {
172+ $ iconImage = '<span class="home-image icon-featured"></span> ' ;
173+ }
174+ elseif (substr ($ iconImage , 0 , 6 ) === 'image: ' )
175+ {
176+ $ iconImage = ' <span class="badge badge-secondary"> ' . substr ($ iconImage , 6 ) . '</span> ' ;
177+ }
178+ else
179+ {
180+ $ iconImage = '<span> ' . HTMLHelper::_ ('image ' , $ iconImage , null ) . '</span> ' ;
181+ }
182+
183+ $ item ->title = $ item ->title . $ iconImage ;
184+ }
185+ }
162186
163187 if ($ item ->hasChildren ())
164188 {
You can’t perform that action at this time.
0 commit comments