Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin Menu Sort options #14655

Closed
brianteeman opened this issue Mar 15, 2017 · 7 comments
Closed

Admin Menu Sort options #14655

brianteeman opened this issue Mar 15, 2017 · 7 comments

Comments

@brianteeman
Copy link
Contributor

brianteeman commented Mar 15, 2017

The new ability to create admin menus is awesome.
When you have created an admin menu etc then you can see a list of the admin menu items that you have created.
The Available Sort orders in the select box are the same ones that are used for the frontend menu items - this is not correct as admin menu items do not have as many fields to sort by

screenshotr22-03-50

@brianteeman
Copy link
Contributor Author

Paging @izharaazmi

@infograf768
Copy link
Member

Not only the sort, but also the language filter in searchtools should not display.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14655.

@yasirunilan
Copy link
Contributor

so can we remove the language filter in the searchtools??

@infograf768
Copy link
Member

Here is patch that will remove for admin_menus language and access filters, which are not used.
It does not solve fully the sorting list.

diff --git a/administrator/components/com_menus/views/items/view.html.php b/administrator/components/com_menus/views/items/view.html.php
index a8b499f..2d94a20 100644
--- a/administrator/components/com_menus/views/items/view.html.php
+++ b/administrator/components/com_menus/views/items/view.html.php
@@ -249,4 +249,13 @@
 		}
 
+		if ($this->state->get('filter.client_id') == 1)
+		{
+			unset($this->activeFilters['language']);
+			$this->filterForm->removeField('language', 'filter');
+
+			unset($this->activeFilters['access']);
+			$this->filterForm->removeField('access', 'filter');
+		}
+
 		// Allow a system plugin to insert dynamic menu types to the list shown in menus:
 		JEventDispatcher::getInstance()->trigger('onBeforeRenderMenuItems', array($this));
@@ -358,14 +367,28 @@
 	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')
+			);
+		}
 	}
 }

It gives:
screen shot 2017-03-18 at 18 35 14

@infograf768
Copy link
Member

Ok, found how to solve this, including sorting.
Making a PR now.

@joomla-cms-bot
Copy link

Set to "closed" on behalf of @infograf768 by The JTracker Application at issues.joomla.org/joomla-cms/14655

@infograf768
Copy link
Member

Closed as we have a patch #14786


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/14655.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants