• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Lack of interest Please alphabetize add-on Options

AndyB

Well-known member
#1
When we look at the Options here:

Admin CP -> Home -> Options

It would be nice if the add-ons with same Group ID would be shown in alphabetical order.

pic001.jpg

I set all my add-ons to Group ID 4000, that way they fall under the default XenForo Options.
 
Last edited:

Alfa1

Well-known member
#4
Its not a big deal, but the addon list quickly gets long and its hard to find what you need. 5 addons like depicted above is nothing. I just use ctrl + F and search for the addon.
 

Alfa1

Well-known member
#6
As the admincp index which does not have such filter, I tend to automatically use ctrl + f5 when looking for an addon in a long list. Its just as fast.
 

AndyB

Well-known member
#7
I was looking at the following code to see if I could just add the additional ORDER BY information:

PHP:
	public function getOptionGroupList(array $fetchOptions = array())
	{
		if (!isset($fetchOptions['includeDebug']))
		{
			$fetchOptions['includeDebug'] = XenForo_Application::debugMode();
		}

		$joinOptions = $this->prepareOptionGroupFetchOptions($fetchOptions);

		return $this->fetchAllKeyed('
			SELECT option_group.*
				' . $joinOptions['selectFields'] . '
			FROM xf_option_group AS option_group
				' . $joinOptions['joinTables'] . '
			WHERE 1=1
				' . (!$fetchOptions['includeDebug'] ? 'AND option_group.debug_only = 0' : '') . '
			ORDER BY
				option_group.display_order
		', 'group_id');
	}
I'm not able to figure out where to add the additional ORDER BY "addon_id".
 

AndyB

Well-known member
#8
Okay figured out how to alphabetize the add-ons if they have the same group_id.

PHP:
	public function getOptionGroupList(array $fetchOptions = array())
	{
		if (!isset($fetchOptions['includeDebug']))
		{
			$fetchOptions['includeDebug'] = XenForo_Application::debugMode();
		}

		$joinOptions = $this->prepareOptionGroupFetchOptions($fetchOptions);

		return $this->fetchAllKeyed('
			SELECT option_group.*
				' . $joinOptions['selectFields'] . '
			FROM xf_option_group AS option_group
				' . $joinOptions['joinTables'] . '
			WHERE 1=1
				' . (!$fetchOptions['includeDebug'] ? 'AND option_group.debug_only = 0' : '') . '
			ORDER BY
				option_group.display_order ASC, option_group.addon_id ASC
		', 'group_id');
	}
Notice the line:

option_group.display_order ASC, option_group.addon_id ASC