Skip to content

Commit ac6b7ec

Browse files
committed
[4.0] Menu Items overview - Filter on Component
1 parent deb8dea commit ac6b7ec

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

administrator/components/com_menus/Model/ItemsModel.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ public function __construct($config = array(), MVCFactoryInterface $factory = nu
5656
'client_id', 'a.client_id',
5757
'home', 'a.home',
5858
'parent_id', 'a.parent_id',
59-
'a.ordering'
59+
'a.ordering',
60+
'e.name', 'componentName'
6061
);
6162

6263
$assoc = Associations::isEnabled();
@@ -495,6 +496,12 @@ protected function getListQuery()
495496
$query->where('a.language = ' . $db->quote($language));
496497
}
497498

499+
// Filter on componentName
500+
if ($componentName = $this->getState('filter.componentName'))
501+
{
502+
$query->where('e.name = ' . $db->quote($componentName));
503+
}
504+
498505
// Add the list ordering clause.
499506
$query->order($db->escape($this->getState('list.ordering', 'a.lft')) . ' ' . $db->escape($this->getState('list.direction', 'ASC')));
500507

administrator/components/com_menus/forms/filter_items.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@
7575
>
7676
<option value="">COM_MENUS_FILTER_SELECT_PARENT_MENU_ITEM</option>
7777
</field>
78+
<field
79+
name="componentName"
80+
type="componentscategory"
81+
label="COM_MENUS_FILTER_COMPONENT_LABEL"
82+
description="COM_MENUS_FILTER_COMPONENT_DESC"
83+
onchange="this.form.submit();"
84+
>
85+
<option value="">COM_MENUS_OPTION_SELECT_COMPONENT</option>
86+
</field>
7887
</fields>
7988
<fields name="list">
8089
<field

0 commit comments

Comments
 (0)