You are here

function hosting_package_menu in Hostmaster (Aegir) 6

Implementation of hook_menu().

File

modules/hosting/package/hosting_package.module, line 38

Code

function hosting_package_menu() {
  $items = array();
  $items['node/%hosting_package_node/packages'] = array(
    'title' => 'Packages',
    'description' => 'List of packages available for this platform',
    'page callback' => 'hosting_package_list',
    'page arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'access arguments' => array(
      'view package',
    ),
    'weight' => 1,
  );
  $items['node/%hosting_package_node/packages/all'] = array(
    'title' => 'All packages',
    'description' => 'List of all packages',
    'page callback' => 'hosting_package_list',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'view package',
    ),
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'weight' => -1,
  );
  $x = 0;
  foreach (_hosting_package_types() as $type => $description) {
    $items['node/%hosting_package_node/packages/' . $type] = array(
      'title' => $description,
      'description' => $description,
      'page callback' => 'hosting_package_list',
      'page arguments' => array(
        1,
        $type,
      ),
      'access arguments' => array(
        'view package',
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => $x++,
    );
  }
  return $items;
}