I am trying to remove the hard coding of "site", "platform", "server" in some places.

Currently hosting_available_tasks($type) requires $type, so you can't get a list of all tasks (which would let me get a list of all "objects" that have tasks as well.

CommentFileSizeAuthor
#1 1861896-hosting_available_tasks.patch1.12 KBJon Pugh
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Jon Pugh’s picture

Patch attached.

The function now looks like this:

/**
 * User-driven task descriptions
 *
 * This is the list of tasks that can be invoked by the user. This doesn't
 * check permissions or relevance of the tasks.
 *
 * Modules can extend this list using hook_hosting_tasks()
 *
 * @see hook_hosting_tasks()
 * @see hosting_task_menu_access()
 */
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 ($type){
    return $cache[$type];
  }
  else {
    return $cache;
  }
Steven Jones’s picture

Status: Needs review » Fixed

Thanks very much for the patch, I've applied the changes to the hosting_available_tasks function and cleaned up the documentation and merged into 6.x-2.x.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit 6d3c1b4 on 6.x-2.x, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by Steven Jones:
    Issue #1861896 by Jon Pugh, Steven Jones: Added Make $type argument of...

  • Commit 6d3c1b4 on 6.x-2.x, dev-1205458-move_sites_out_of_platforms, 7.x-3.x, dev-588728-views-integration, dev-1403208-new_roles, dev-helmo-3.x by Steven Jones:
    Issue #1861896 by Jon Pugh, Steven Jones: Added Make $type argument of...