1. 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

Discussion in 'Closed Suggestions' started by AndyB, Nov 10, 2013.

  1. AndyB

    AndyB Well-Known Member

    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: Nov 10, 2013
    Claudio and Alfa1 like this.
  2. Jeremy

    Jeremy XenForo Moderator Staff Member

    If you alphabetized the list, they wouldn't fall below. It's ordered by add-on ID past sort order.
     
  3. AndyB

    AndyB Well-Known Member

    I think currently it's ordered by Group ID. What would be nice is a second sorting by add-on name if the Group Id is the same.
     
  4. Alfa1

    Alfa1 Well-Known Member

    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.
     
  5. Chris D

    Chris D XenForo Developer Staff Member

    Not the filter list in the top right corner? :p
     
  6. Alfa1

    Alfa1 Well-Known Member

    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.
     
  7. AndyB

    AndyB Well-Known Member

    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".
     
  8. AndyB

    AndyB Well-Known Member

    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
     

Share This Page