diff --git a/administrator/components/com_menus/models/forms/item_alias.xml b/administrator/components/com_menus/models/forms/item_alias.xml index 61879dbe4c08d..3b09c6fc343bc 100644 --- a/administrator/components/com_menus/models/forms/item_alias.xml +++ b/administrator/components/com_menus/models/forms/item_alias.xml @@ -44,6 +44,13 @@ description="COM_MENUS_ITEM_FIELD_MENU_IMAGE_DESC" /> + + + + + + + + + + + + + + + + + + + + title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false); - $item->anchor_css = htmlspecialchars($item->params->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false); - $item->anchor_title = htmlspecialchars($item->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false); - $item->anchor_rel = htmlspecialchars($item->params->get('menu-anchor_rel', ''), ENT_COMPAT, 'UTF-8', false); - $item->menu_image = $item->params->get('menu_image', '') ? + $item->title = htmlspecialchars($item->title, ENT_COMPAT, 'UTF-8', false); + $item->anchor_css = htmlspecialchars($item->params->get('menu-anchor_css', ''), ENT_COMPAT, 'UTF-8', false); + $item->anchor_title = htmlspecialchars($item->params->get('menu-anchor_title', ''), ENT_COMPAT, 'UTF-8', false); + $item->anchor_rel = htmlspecialchars($item->params->get('menu-anchor_rel', ''), ENT_COMPAT, 'UTF-8', false); + $item->menu_image = $item->params->get('menu_image', '') ? htmlspecialchars($item->params->get('menu_image', ''), ENT_COMPAT, 'UTF-8', false) : ''; + $item->menu_image_css = htmlspecialchars($item->params->get('menu_image_css', ''), ENT_COMPAT, 'UTF-8', false); } if (isset($items[$lastitem])) diff --git a/modules/mod_menu/tmpl/default_component.php b/modules/mod_menu/tmpl/default_component.php index 0de08f8951d03..39e0ed8013163 100644 --- a/modules/mod_menu/tmpl/default_component.php +++ b/modules/mod_menu/tmpl/default_component.php @@ -30,7 +30,15 @@ if ($item->menu_image) { - $linktype = JHtml::_('image', $item->menu_image, $item->title); + if ($item->menu_image_css) + { + $image_attributes['class'] = $item->menu_image_css; + $linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes); + } + else + { + $linktype = JHtml::_('image', $item->menu_image, $item->title); + } if ($item->params->get('menu_text', 1)) { diff --git a/modules/mod_menu/tmpl/default_heading.php b/modules/mod_menu/tmpl/default_heading.php index 1808eb99259ad..5612c40bfd54f 100644 --- a/modules/mod_menu/tmpl/default_heading.php +++ b/modules/mod_menu/tmpl/default_heading.php @@ -16,7 +16,15 @@ if ($item->menu_image) { - $linktype = JHtml::_('image', $item->menu_image, $item->title); + if ($item->menu_image_css) + { + $image_attributes['class'] = $item->menu_image_css; + $linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes); + } + else + { + $linktype = JHtml::_('image', $item->menu_image, $item->title); + } if ($item->params->get('menu_text', 1)) { diff --git a/modules/mod_menu/tmpl/default_separator.php b/modules/mod_menu/tmpl/default_separator.php index b98120649adf1..eca36cce382db 100644 --- a/modules/mod_menu/tmpl/default_separator.php +++ b/modules/mod_menu/tmpl/default_separator.php @@ -16,7 +16,15 @@ if ($item->menu_image) { - $linktype = JHtml::_('image', $item->menu_image, $item->title); + if ($item->menu_image_css) + { + $image_attributes['class'] = $item->menu_image_css; + $linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes); + } + else + { + $linktype = JHtml::_('image', $item->menu_image, $item->title); + } if ($item->params->get('menu_text', 1)) { diff --git a/modules/mod_menu/tmpl/default_url.php b/modules/mod_menu/tmpl/default_url.php index 0a2b038174356..a2ab43b0f33d9 100644 --- a/modules/mod_menu/tmpl/default_url.php +++ b/modules/mod_menu/tmpl/default_url.php @@ -30,7 +30,15 @@ if ($item->menu_image) { - $linktype = JHtml::_('image', $item->menu_image, $item->title); + if ($item->menu_image_css) + { + $image_attributes['class'] = $item->menu_image_css; + $linktype = JHtml::_('image', $item->menu_image, $item->title, $image_attributes); + } + else + { + $linktype = JHtml::_('image', $item->menu_image, $item->title); + } if ($item->params->get('menu_text', 1)) {