1 installer.pages.inc installer_browser_get_sort_options($full = FALSE)

Returns a list of sort options.

Parameters

$full: Set this to TRUE if you want to get all of the supported sort methods.

Return value

array: An array of all sort methods, keyed by method name, with each value an array with the following keys:

  • method: Same as the method name key.
  • label: Translated label for the method.
  • default_sort: The default sort for this method, either "desc" or "asc".

File

core/modules/installer/installer.pages.inc, line 957
Page callbacks used by the Installer browse pages.

Code

function installer_browser_get_sort_options($full = FALSE) {
  $sort_options = array(
    'score' => array('method' => 'score', 'label' => t('Relevance'), 'default_sort' => 'desc'),
    'usage' => array('method' => 'usage', 'label' => t('Most installed'), 'default_sort' => 'desc'),
    'title' => array('method' => 'title', 'label' => t('Title'), 'default_sort' => 'asc'),
    'latest_release' => array('method' => 'latest_release', 'label' => t('Latest release'), 'default_sort' => 'desc'),
  );

  if ($full) {
    $sort_options['type'] = array('method' => 'type', 'label' => t('Type'), 'default_sort' => 'asc');
    $sort_options['created'] = array('method' => 'created', 'label' => t('Date created'), 'default_sort' => 'asc');
    $sort_options['latest_activity'] = array('method' => 'latest_activity', 'label' => t('Latest build'), 'default_sort' => 'desc');
  }

  return $sort_options;
}