diff --git a/administrator/components/com_menus/models/forms/filter_itemsadmin.xml b/administrator/components/com_menus/models/forms/filter_itemsadmin.xml new file mode 100644 index 0000000000000..afad9341a4d21 --- /dev/null +++ b/administrator/components/com_menus/models/forms/filter_itemsadmin.xml @@ -0,0 +1,91 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/administrator/components/com_menus/models/items.php b/administrator/components/com_menus/models/items.php index eba57f37f35a2..9febfb9e122b9 100644 --- a/administrator/components/com_menus/models/items.php +++ b/administrator/components/com_menus/models/items.php @@ -161,6 +161,12 @@ protected function populateState($ordering = 'a.lft', $direction = 'asc') $clientId = (int) $this->getUserStateFromRequest($this->context . '.client_id', 'client_id', 0, 'int'); $this->setState('filter.client_id', $clientId); + // Use a different filter file when client is administrator + if ($clientId == 1) + { + $this->filterFormName = 'filter_itemsadmin'; + } + $this->setState('filter.menutype', $menuType); $language = $this->getUserStateFromRequest($this->context . '.filter.language', 'filter_language', ''); diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php index a8b499f46b030..66521994edafb 100644 --- a/administrator/components/com_menus/views/items/view.html.php +++ b/administrator/components/com_menus/views/items/view.html.php @@ -357,15 +357,29 @@ protected function addToolbar() */ protected function getSortFields() { - return array( - 'a.lft' => JText::_('JGRID_HEADING_ORDERING'), - 'a.published' => JText::_('JSTATUS'), - 'a.title' => JText::_('JGLOBAL_TITLE'), - 'a.home' => JText::_('COM_MENUS_HEADING_HOME'), - 'a.access' => JText::_('JGRID_HEADING_ACCESS'), - 'association' => JText::_('COM_MENUS_HEADING_ASSOCIATION'), - 'language' => JText::_('JGRID_HEADING_LANGUAGE'), - 'a.id' => JText::_('JGRID_HEADING_ID') - ); + $this->state = $this->get('State'); + + if ($this->state->get('filter.client_id') == 0) + { + return array( + 'a.lft' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.title' => JText::_('JGLOBAL_TITLE'), + 'a.home' => JText::_('COM_MENUS_HEADING_HOME'), + 'a.access' => JText::_('JGRID_HEADING_ACCESS'), + 'association' => JText::_('COM_MENUS_HEADING_ASSOCIATION'), + 'language' => JText::_('JGRID_HEADING_LANGUAGE'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } + else + { + return array( + 'a.lft' => JText::_('JGRID_HEADING_ORDERING'), + 'a.published' => JText::_('JSTATUS'), + 'a.title' => JText::_('JGLOBAL_TITLE'), + 'a.id' => JText::_('JGRID_HEADING_ID') + ); + } } }