Turba::getPreferredSortOrder PHP Method

getPreferredSortOrder() public static method

Returns the sort order selected by the user.
public static getPreferredSortOrder ( ) : array
return array TODO
    public static function getPreferredSortOrder()
    {
        return @unserialize($GLOBALS['prefs']->getValue('sortorder'));
    }

Usage Example

Example #1
0
        /* Perform a search. */
        if ($search_mode == 'duplicate') {
            try {
                $duplicates = $driver->searchDuplicates();
                $view = new Turba_View_Duplicates($duplicates, $driver, $vars->type, $vars->dupe);
                $page_output->addScriptFile('tables.js', 'horde');
            } catch (Exception $e) {
                $notification->push($e);
            }
        } else {
            try {
                if ($search_mode == 'basic' && ($results = $driver->search($criteria, null, 'OR')) || $search_mode == 'advanced' && ($results = $driver->search($criteria))) {
                    /* Read the columns to display from the preferences. */
                    $sources = Turba::getColumns();
                    $columns = isset($sources[$source]) ? $sources[$source] : array();
                    $results->sort(Turba::getPreferredSortOrder());
                    $view = new Turba_View_List($results, null, $columns);
                    $view->setType('search');
                } else {
                    $notification->push(_("Failed to search the address book"), 'horde.error');
                }
            } catch (Turba_Exception $e) {
                $notification->push($e, 'horde.error');
            }
        }
    }
}
/* Build search mode tabs. */
$sUrl = Horde::url('search.php');
$tabs = new Horde_Core_Ui_Tabs('search_mode', $vars);
$tabs->addTab(_("Basic Search"), $sUrl, 'basic');
All Usage Examples Of Turba::getPreferredSortOrder