You are here

function spaces_active_space_menu in Spaces 6.2

Same name and namespace in other branches
  1. 5.2 spaces.module \spaces_active_space_menu()
  2. 6 spaces.module \spaces_active_space_menu()

A mild abstraction of hook_menu() items that can be used by implementing modules to embed/graft relevant spaces items into the menu tree.

Parameters

$space: A space object.

$local_tasks: Optional boolean flag for whether the items are fully rendered as local tasks.

$path_prefix: A path to prefix the menu item paths by.

Return value

An array of menu items.

3 calls to spaces_active_space_menu()
spaces_site_menu in spaces_site/spaces_site.module
Implementation of hook_menu().
spaces_taxonomy_menu in spaces_taxonomy/spaces_taxonomy.module
Implementation of hook_menu().
spaces_user_menu in spaces_user/spaces_user.module
Implementation of hook_menu().

File

./spaces.module, line 1365

Code

function spaces_active_space_menu($type, $local_tasks = FALSE, $path_prefix = '') {
  $types = spaces_types();
  $arg_count = !empty($path_prefix) ? count(explode('/', $path_prefix)) : 0;
  $path_prefix = !empty($path_prefix) ? $path_prefix . '/' : '';
  $spaces_path = drupal_get_path('module', 'spaces');
  $items[$path_prefix . 'spaces/features'] = array(
    'title' => 'Features',
    'page arguments' => array(
      'spaces_features_form',
    ),
    'access arguments' => array(
      $type,
      'features',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );
  $items[$path_prefix . 'spaces/features/%'] = array(
    'title' => 'Features',
    'page arguments' => array(
      'spaces_customize_form',
      NULL,
      2 + $arg_count,
    ),
    'access arguments' => array(
      $type,
      'features',
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 1,
  );
  foreach ($items as $path => $item) {
    $items[$path]['page callback'] = 'drupal_get_form';
    $items[$path]['access callback'] = 'spaces_admin_access';
    $items[$path]['file'] = 'spaces_admin.inc';
    $items[$path]['file path'] = $spaces_path;
  }
  return $items;
}