function hosting_available_tasks in Hosting 7.4
Same name and namespace in other branches
- 5 task/hosting_task.module \hosting_available_tasks()
- 6.2 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
string|null $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.
bool $reset: This function has an internal static cache, to reset the cache, pass in TRUE.
Return value
array 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
7 calls to hosting_available_tasks()
- drush_hosting_task_validate in ./
task.hosting.inc - Validate hook for the hosting-task Drush command.
- hosting_task_action_info in task/
hosting_task.module - Implements hook_action_info().
- hosting_task_confirm_form in task/
hosting_task.module - Implements hook_form().
- hosting_task_fetch_tasks in task/
hosting_task.module - @todo Please document this function.
- hosting_task_handler_filter_type::get_value_options in task/
includes/ views/ handlers/ hosting_task_handler_filter_type.inc - Child classes should be used to override this function and set the 'value options', unless 'options callback' is defined as a valid function or static public method to generate these values.
File
- task/
hosting_task.module, line 882 - Web server node type is defined here.
Code
function hosting_available_tasks($type = NULL, $reset = FALSE) {
static $cache = array();
if (!count($cache) || $reset) {
// Invoke hook_hosting_tasks().
$cache = module_invoke_all('hosting_tasks');
// Invoke hook_hosting_tasks_alter().
drupal_alter('hosting_tasks', $cache);
}
if (isset($type)) {
return $cache[$type];
}
else {
return $cache;
}
}