You are here

function hosting_task_menu in Hosting 5

Same name and namespace in other branches
  1. 6.2 task/hosting_task.module \hosting_task_menu()
  2. 7.4 task/hosting_task.module \hosting_task_menu()
  3. 7.3 task/hosting_task.module \hosting_task_menu()

Implementation of hook_menu().

File

task/hosting_task.module, line 9
Web server node type is defined here.

Code

function hosting_task_menu($may_cache) {
  $items = array();
  if (!$may_cache) {
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      foreach (hosting_available_tasks($node) as $type => $task) {
        $items[] = array(
          'path' => 'node/' . arg(1) . '/task_' . $type,
          'title' => $task['title'],
          'description' => $task['description'],
          'callback' => 'drupal_get_form',
          'callback arguments' => array(
            'hosting_task_confirm_form',
            $node,
            $type,
          ),
          'access' => user_access('create ' . $type . ' task'),
          'type' => MENU_LOCAL_TASK,
          'weight' => $task['weight'] ? $task['weight'] : 0,
        );
      }
    }
  }
  return $items;
}