Commit f18cb5ae authored by Steven Jones's avatar Steven Jones

Issue #1781832 by Steven Jones: Added hosting_available_tasks() should invoke alter.

parent 27baac5a
......@@ -50,6 +50,23 @@ function hook_hosting_tasks() {
return $options;
}
/**
* Alter front-end tasks defined by other modules.
*
* @param $tasks
* An array of tasks defined by other modules. Keys of the outer array are the
* types of objects that the tasks operate on, e.g. 'site', 'platform' or
* 'server', values are arrays of the tasks that apply to those objects.
*
* @see hook_hosting_tasks
*/
function hook_hosting_tasks_alter(&$tasks) {
// Change the title of the site's clone task.
if (isset($tasks['site']['clone'])) {
$tasks['site']['clone']['title'] = t('Site clone');
}
}
/**
* @} End of "addtogroup hooks".
*/
......@@ -570,6 +570,7 @@ function hosting_available_tasks($type, $reset = FALSE) {
if (!sizeof($cache) || $reset) {
$cache = module_invoke_all('hosting_tasks');
drupal_alter('hosting_tasks', $cache);
}
return $cache[$type];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment