Jump to content

Suggestion: #show_groups# (or #show_groups_asc#)


Peter F.

Recommended Posts

I've a small suggestion to make with regards to the #show_groups# that people use in settings to display the multi_select group box. Something that has been a source of much annoyance to me for a while is that fact that the output of the shortcut is not sorted in any way at all, to remedy this I propose that the following code in '/admin/applications/core/modules_admin/tools/settings.php' be changed from:

                    else if ( $r['conf_extra'] == '#show_groups#' )

                    {

                        $this->DB->build( array( 'select' => '*', 'from' => 'groups' ) );

                        $this->DB->execute();


                        while( $row = $this->DB->fetch() )

                        {

                            if ( $row['g_access_cp'] )

                            {

                                $row['g_title'] .= "( STAFF )";

                            }


                            $dropdown[] = array( $row['g_id'], $row['g_title'] );

                        }

                    }


to 


                    else if ( $r['conf_extra'] == '#show_groups#' )

                    {

                        $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC', ) );

                        $this->DB->execute();


                        while( $row = $this->DB->fetch() )

                        {

                            if ( $row['g_access_cp'] )

                            {

                                $row['g_title'] .= "( STAFF )";

                            }


                            $dropdown[] = array( $row['g_id'], $row['g_title'] );

                        }

                    }



or that a new conditional be added to detect #show_groups_asc# (to signify that the groups are sorted in ascending order) like so:


                    else if ( $r['conf_extra'] == '#show_groups_asc#' )

                    {

                        $this->DB->build( array( 'select' => '*', 'from' => 'groups', 'order' => 'g_title ASC', ) );

                        $this->DB->execute();


                        while( $row = $this->DB->fetch() )

                        {

                            if ( $row['g_access_cp'] )

                            {

                                $row['g_title'] .= "( STAFF )";

                            }


                            $dropdown[] = array( $row['g_id'], $row['g_title'] );

                        }

                    }
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...