You are here

function workspace_menu in Workspace 7

Same name and namespace in other branches
  1. 5 workspace.module \workspace_menu()
  2. 6 workspace.module \workspace_menu()

Implements hook_menu().

File

./workspace.module, line 37
Presents a user-centric view of content.

Code

function workspace_menu() {
  $items['workspace/%user_uid_optional'] = array(
    'title' => 'My workspace',
    'page callback' => 'workspace_list_content',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'workspace_access',
    'access arguments' => array(
      1,
    ),
    'weight' => -10,
  );
  $items['workspace/%user/content'] = array(
    'title' => 'Content',
    'type' => MENU_DEFAULT_LOCAL_TASK,
    'page callback' => 'workspace_list_content',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'workspace_access',
    'access arguments' => array(
      1,
    ),
    'weight' => 10,
  );
  $items['workspace/%user/comments'] = array(
    'title' => 'Comments',
    'type' => MENU_LOCAL_TASK,
    'page callback' => 'workspace_list_comments',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'workspace_access',
    'access arguments' => array(
      1,
      module_exists('comment'),
    ),
    'weight' => 20,
  );

  /*
    $items['workspace/%user/attachments'] = array(
      'title' => 'Attachments',
      'type' => MENU_LOCAL_TASK,
      'page callback' => 'workspace_list_files',
      'page arguments' => array(1),
      'access callback' => 'workspace_access',
      'access arguments' => array(1),
      'weight' => 30,
    );
  */
  $items['workspace/%user/configure'] = array(
    'title' => 'Configure',
    'page callback' => 'workspace_configure',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'workspace_configure_access',
    'access arguments' => array(
      1,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 50,
  );
  $items[WORKSPACE_ADMIN_PATH] = array(
    'title' => 'Workspace',
    'description' => 'Customize workspace behavior.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'workspace_settings',
    ),
    'access arguments' => array(
      'administer workspaces',
    ),
  );

  // In this entry, 'access content' permission may seem liberal
  // but since workspace_delete() simply redirects to
  // node/*/delete deletion permissions will be applied there.
  $items['workspace/delete/%'] = array(
    'title' => 'Delete',
    'page callback' => 'workspace_delete',
    'page arguments' => array(
      2,
    ),
    'access arguments' => array(
      'access content',
    ),
    'type' => MENU_CALLBACK,
  );
  $items['workspace/%user/content/%workspace_content_type'] = array(
    'type' => MENU_CALLBACK,
    'access callback' => 'workspace_access',
    'access arguments' => array(
      1,
    ),
    'page callback' => 'workspace_list_content',
    'page arguments' => array(
      1,
      3,
    ),
  );
  $items['workspace/node/switch'] = array(
    'type' => MENU_CALLBACK,
    'access arguments' => array(
      'administer nodes',
    ),
    'page callback' => 'workspace_node_status_json_switch',
  );
  return $items;
}