You are here

function page_manager_sort_task_handlers in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 page_manager/page_manager.module \page_manager_sort_task_handlers()

Callback for uasort to sort task handlers.

Task handlers are sorted by weight then by name.

1 string reference to 'page_manager_sort_task_handlers'
page_manager_load_sorted_handlers in page_manager/page_manager.module
Load all task handlers for a given task and subtask and sort them.

File

page_manager/page_manager.module, line 656
The page manager module provides a UI and API to manage pages.

Code

function page_manager_sort_task_handlers($a, $b) {
  if ($a->weight < $b->weight) {
    return -1;
  }
  elseif ($a->weight > $b->weight) {
    return 1;
  }
  elseif ($a->name < $b->name) {
    return -1;
  }
  elseif ($a->name > $b->name) {
    return 1;
  }
  return 0;
}