Skip to content
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
>
<option value="">COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM</option>
</field>
<field
name="componentName"
type="componentscategory"
label="COM_MENUS_FILTER_COMPONENT_LABEL"
description="COM_MENUS_FILTER_COMPONENT_DESC"
onchange="this.form.submit();"
>
<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
</field>
</fields>
<fields name="list">
<field
Expand Down
9 changes: 8 additions & 1 deletion administrator/components/com_menus/models/items.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public function __construct($config = array())
'client_id', 'a.client_id',
'home', 'a.home',
'parent_id', 'a.parent_id',
'a.ordering'
'a.ordering',
'e.name', 'componentName'
);

$app = JFactory::getApplication();
Expand Down Expand Up @@ -431,6 +432,12 @@ protected function getListQuery()
$query->where('a.access = ' . (int) $access);
}

// Filter on componentName
if ($componentName = $this->getState('filter.componentName'))
{
$query->where('e.name = ' . $db->quote($componentName));
}

// Implement View Level Access
if (!$user->authorise('core.admin'))
{
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 @@ -53,6 +53,8 @@ COM_MENUS_FIELD_VALUE_NEW_WITH_NAV="New Window With Navigation"
COM_MENUS_FIELD_VALUE_NEW_WITHOUT_NAV="New Without Navigation"
COM_MENUS_FIELD_VALUE_PARENT="Parent"
COM_MENUS_FIELDSET_RULES="Permissions"
COM_MENUS_FILTER_COMPONENT_DESC="Filters the menu items on the component used."
COM_MENUS_FILTER_COMPONENT_LABEL="Component"
COM_MENUS_FILTER_PARENT_MENU_ITEM_DESC="Filters the menu items list where the parent is this selected menu item."
COM_MENUS_FILTER_PARENT_MENU_ITEM_LABEL="Parent Menu Item"
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM="- Select Parent Menu Item -"
Expand Down