function hosting_available_tasks in Hosting 6.2
Same name and namespace in other branches
- 5 task/hosting_task.module \hosting_available_tasks()
- 7.4 task/hosting_task.module \hosting_available_tasks()
- 7.3 task/hosting_task.module \hosting_available_tasks()
Get a list of tasks that can be invoked by the user.
Note this does not check permissions or relevance of the tasks.
Modules can extend this list using hook_hosting_tasks().
Parameters
$type: Tasks are grouped by the type of thing that the task is performed on. This parameter should either be NULL, or a string indicating the type of thing that you want possible tasks to operate on.
$reset: This function has an internal static cache, to reset the cache, pass in TRUE.
Return value
Depending on the value of the $type parameter, you will either be returned:
- If $type is NULL: an associative array whose keys are things that can be acted upon by the tasks defined in the corresponding values.
- If $type is a string, then an associative array whose keys are task types and whose values are definitions for those tasks.
See also
6 calls to hosting_available_tasks()
- drush_hosting_task_validate in ./
task.hosting.inc - Validate hook for the hosting-task Drush command.
- hosting_task_confirm_form in task/
hosting_task.module - Implementation of hook_form().
- hosting_task_fetch_tasks in task/
hosting_task.module - hosting_task_handler_filter_hosting_task_type::get_value_options in task/
hosting_task_handler_filter_hosting_task_type.inc - hosting_task_menu in task/
hosting_task.module - Implementation of hook_menu().
File
- task/
hosting_task.module, line 583 - Web server node type is defined here.
Code
function hosting_available_tasks($type = NULL, $reset = FALSE) {
static $cache = array();
if (!sizeof($cache) || $reset) {
$cache = module_invoke_all('hosting_tasks');
drupal_alter('hosting_tasks', $cache);
}
if (isset($type)) {
return $cache[$type];
}
else {
return $cache;
}
}