function page_manager_get_task_handler_plugins in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 page_manager/page_manager.module \page_manager_get_task_handler_plugins()
Retrieve a list of all applicable task handlers for a given task.
This looks at the $task['handler type'] and compares that to $task_handler['handler type']. If the task has no type, the id of the task is used instead.
4 calls to page_manager_get_task_handler_plugins()
- page_manager_handler_add_form in page_manager/
page_manager.admin.inc - Provide a consistent UI for adding handlers.
- page_manager_menu in page_manager/
page_manager.module - Delegated implementation of hook_menu().
- page_manager_page_add_subtask in page_manager/
plugins/ tasks/ page.admin.inc - Page callback to add a subtask.
- template_preprocess_page_manager_edit_page in page_manager/
theme/ page_manager.theme.inc - Preprocess the page manager edit page.
File
- page_manager/
page_manager.module, line 772 - The page manager module provides a UI and API to manage pages.
Code
function page_manager_get_task_handler_plugins($task, $all = FALSE) {
$type = isset($task['handler type']) ? $task['handler type'] : $task['name'];
$name = $task['name'];
$handlers = array();
$task_handlers = page_manager_get_task_handlers();
foreach ($task_handlers as $id => $handler) {
$task_type = is_array($handler['handler type']) ? $handler['handler type'] : array(
$handler['handler type'],
);
if (in_array($type, $task_type) || in_array($name, $task_type)) {
if ($all || !empty($handler['visible'])) {
$handlers[$id] = $handler;
}
}
}
return $handlers;
}