Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion administrator/components/com_menus/models/forms/item.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
description="COM_MENUS_ITEM_FIELD_TYPE_DESC"
class="input-medium"
required="true"
size="40"
size="40"
/>

<field
Expand Down Expand Up @@ -146,6 +146,7 @@
description="COM_MENUS_ITEM_FIELD_TEMPLATE_DESC"
client="site"
filter="int"
showon="params.alias_redirect:0"
>
<option value="0">JOPTION_USE_DEFAULT</option>
</field>
Expand Down
47 changes: 30 additions & 17 deletions administrator/components/com_menus/models/forms/item_alias.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<fields name="params">

<fieldset name="aliasoptions">
<field
name="aliasoptions"
<field
name="aliasoptions"
type="modal_menu"
label="COM_MENUS_ITEM_FIELD_ALIAS_MENU_LABEL"
description="COM_MENUS_ITEM_FIELD_ALIAS_MENU_DESC"
Expand All @@ -17,47 +17,60 @@
edit="true"
clear="true"
/>

<field
name="alias_redirect"
type="radio"
label="COM_MENUS_ITEM_FIELD_ALIAS_REDIRECT_LABEL"
description="COM_MENUS_ITEM_FIELD_ALIAS_REDIRECT_DESC"
class="btn-group btn-group-yesno"
default="0"
filter="integer"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
</fieldset>

<fieldset name="menu-options"
label="COM_MENUS_LINKTYPE_OPTIONS_LABEL"
>

<field
name="menu-anchor_title"
<field
name="menu-anchor_title"
type="text"
label="COM_MENUS_ITEM_FIELD_ANCHOR_TITLE_LABEL"
description="COM_MENUS_ITEM_FIELD_ANCHOR_TITLE_DESC"
description="COM_MENUS_ITEM_FIELD_ANCHOR_TITLE_DESC"
/>

<field
name="menu-anchor_css"
<field
name="menu-anchor_css"
type="text"
label="COM_MENUS_ITEM_FIELD_ANCHOR_CSS_LABEL"
description="COM_MENUS_ITEM_FIELD_ANCHOR_CSS_DESC"
description="COM_MENUS_ITEM_FIELD_ANCHOR_CSS_DESC"
/>

<field
name="menu_image"
<field
name="menu_image"
type="media"
label="COM_MENUS_ITEM_FIELD_MENU_IMAGE_LABEL"
description="COM_MENUS_ITEM_FIELD_MENU_IMAGE_DESC"
description="COM_MENUS_ITEM_FIELD_MENU_IMAGE_DESC"
/>

<field
<field
name="menu_image_css"
type="text"
type="text"
label="COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_LABEL"
description="COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_DESC"
description="COM_MENUS_ITEM_FIELD_MENU_IMAGE_CSS_DESC"
/>

<field
name="menu_text"
<field
name="menu_text"
type="radio"
label="COM_MENUS_ITEM_FIELD_MENU_TEXT_LABEL"
description="COM_MENUS_ITEM_FIELD_MENU_TEXT_DESC"
class="btn-group btn-group-yesno"
default="1"
default="1"
filter="integer"
>
<option value="1">JYES</option>
Expand Down
7 changes: 6 additions & 1 deletion administrator/components/com_menus/views/item/tmpl/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@

if ($this->item->type == 'alias')
{
echo $this->form->renderFieldset('aliasoptions');
echo $this->form->renderField('aliasoptions', 'params');
}

if ($this->item->type == 'separator')
Expand All @@ -169,6 +169,11 @@

echo $this->form->renderField('link');

if ($this->item->type == 'alias')
{
echo $this->form->renderField('alias_redirect', 'params');
}

echo $this->form->renderField('browserNav');
echo $this->form->renderField('template_style_id');

Expand Down
2 changes: 2 additions & 0 deletions administrator/language/en-GB/en-GB.com_menus.ini
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ COM_MENUS_ITEM_DETAILS="Details"
COM_MENUS_ITEM_FIELD_ALIAS_DESC="The alias is used in the URL when SEF is on."
COM_MENUS_ITEM_FIELD_ALIAS_MENU_DESC="Menu Item to link to."
COM_MENUS_ITEM_FIELD_ALIAS_MENU_LABEL="Menu Item"
COM_MENUS_ITEM_FIELD_ALIAS_REDIRECT_DESC="If set to Yes then visitors will be redirected to the linked menu item."
COM_MENUS_ITEM_FIELD_ALIAS_REDIRECT_LABEL="Use Redirection"
COM_MENUS_ITEM_FIELD_ANCHOR_CSS_DESC="An optional class to apply to the menu hyperlink."
COM_MENUS_ITEM_FIELD_ANCHOR_CSS_LABEL="Link Class"
COM_MENUS_ITEM_FIELD_ANCHOR_TITLE_DESC="An optional, custom description for the title attribute of the menu hyperlink."
Expand Down
5 changes: 4 additions & 1 deletion libraries/src/Application/CMSApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,10 @@ protected function route()

$active = $this->getMenu()->getActive();

if ($active !== null && $active->type === 'alias')
if ($active !== null
&& $active->type === 'alias'
&& $active->params->get('alias_redirect')
&& in_array($this->input->getMethod(), array('GET', 'HEAD'), true))
{
$item = $this->getMenu()->getItem($active->params->get('aliasoptions'));

Expand Down