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
9 changes: 8 additions & 1 deletion administrator/components/com_menus/Model/ItemsModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
'parent_id', 'a.parent_id',
'publish_up', 'a.publish_up',
'publish_down', 'a.publish_down',
'a.ordering'
'a.ordering',
'e.name', 'componentName'
);

$assoc = Associations::isEnabled();
Expand Down Expand Up @@ -499,6 +500,12 @@ protected function getListQuery()
$query->where('a.language = ' . $db->quote($language));
}

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

// Add the list ordering clause.
$query->order($db->escape($this->getState('list.ordering', 'a.lft')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));

Expand Down
8 changes: 8 additions & 0 deletions administrator/components/com_menus/forms/filter_items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,14 @@
>
<option value="">COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM</option>
</field>
<field
name="componentName"
type="componentscategory"
label="COM_MENUS_FILTER_COMPONENT_LABEL"
onchange="this.form.submit();"
>
<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
</field>
</fields>
<fields name="list">
<field
Expand Down
1 change: 1 addition & 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,7 @@ 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_LABEL="Component"
COM_MENUS_FILTER_PARENT_MENU_ITEM_LABEL="Parent Menu Item"
COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM="- Select Parent Menu Item -"
COM_MENUS_GRID_UNSET_LANGUAGE="Unset %s Default"
Expand Down