You are here

function pm_menu in Drupal PM (Project Management) 7

Same name and namespace in other branches
  1. 8 pm.module \pm_menu()
  2. 7.3 pm.module \pm_menu()
  3. 7.2 pm.module \pm_menu()

Implements hook_menu().

1 string reference to 'pm_menu'
pm_block_view in ./pm.module
Implements hook_block_view().

File

./pm.module, line 63
Main module file for the Project Management module.

Code

function pm_menu() {
  $items = array();
  $dashboard_types = module_invoke_all('pm_dashboard_types');
  foreach ($dashboard_types as $type => $type_info) {
    if (isset($type_info['url'])) {
      $title = isset($type_info['title']) ? $type_info['title'] : 'Project Management Dashboard';
      $items[$type_info['url']] = array(
        'title' => $title,
        'description' => $title,
        'page callback' => 'pm_dashboard',
        'page arguments' => array(
          $type,
        ),
        'access arguments' => array(
          'Project Management: access dashboard',
        ),
        'parent' => '',
        'type' => MENU_NORMAL_ITEM,
      );
      if (isset($type_info['menu_options'])) {
        $items[$type_info['url']] = array_merge($items[$type_info['url']], $type_info['menu_options']);
      }
    }
  }
  $items['admin/config/pm'] = array(
    'title' => 'Project Management',
    'description' => 'Project Management settings',
    'page callback' => 'system_admin_menu_block_page',
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'system.admin.inc',
    'file path' => drupal_get_path('module', 'system'),
  );
  $items['admin/config/pm/pm'] = array(
    'title' => 'Project Management',
    'description' => 'Project Management settings including display and taxation.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_admin_settings',
    ),
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'weight' => -100,
  );
  $items['pm/attributes'] = array(
    'title' => 'Attributes',
    'description' => 'Project Management attributes',
    'page callback' => 'pm_attribute_list',
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'pm.admin.inc',
    'type' => MENU_NORMAL_ITEM,
    'weight' => 11,
  );
  $items['pm/attributes/add'] = array(
    'title' => 'Add a new attribute',
    'description' => 'Project Management attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_attribute_add',
    ),
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'pm.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['pm/attributes/edit/%'] = array(
    'title' => 'Edit an attribute',
    'description' => 'Project Management attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_attribute_edit',
      3,
    ),
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'pm.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['pm/attributes/delete/%'] = array(
    'title' => 'Delete an attribute',
    'description' => 'Project Management attributes',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'pm_attribute_delete',
      3,
    ),
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'pm.admin.inc',
    'type' => MENU_CALLBACK,
  );
  $items['pm/attributes/domain/autocomplete'] = array(
    'title' => 'List of attributes',
    'description' => 'Project Management attributes',
    'page callback' => '_pm_attribute_domain_autocomplete',
    'page arguments' => array(
      4,
    ),
    'access arguments' => array(
      'Project Management: access administration pages',
    ),
    'file' => 'pm.admin.inc',
    'type' => MENU_CALLBACK,
  );
  return $items;
}