You are here

function redhen_note_menu in RedHen CRM 7

Implements hook_menu().

File

modules/redhen_note/redhen_note.module, line 59
Redhen Notes main module

Code

function redhen_note_menu() {
  $items = array();
  $items['admin/structure/redhen/notes'] = array(
    'title' => 'Notes',
    'description' => 'Manage RedHen notes',
    'page callback' => 'redhen_note_admin_page',
    'access arguments' => array(
      'administer redhen notes',
    ),
  );
  foreach (redhen_entity_types() as $note_entity_type => $path) {
    $items['redhen/' . $path . '/%' . $note_entity_type . '/notes'] = array(
      'title' => 'Notes',
      'page callback' => 'redhen_note_notes_page',
      'page arguments' => array(
        2,
        $note_entity_type,
      ),
      'access callback' => 'redhen_note_access',
      'access arguments' => array(
        'view',
        2,
      ),
      'file' => 'includes/redhen_note.pages.inc',
      'type' => MENU_LOCAL_TASK,
      'weight' => 3,
    );
    $items['redhen/' . $path . '/%' . $note_entity_type . '/notes/add'] = array(
      'title' => 'Add Note',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'redhen_note_form',
        NULL,
        2,
      ),
      'file' => 'includes/redhen_note.forms.inc',
      'access callback' => 'redhen_note_access',
      'access arguments' => array(
        'edit',
        2,
      ),
      'type' => MENU_LOCAL_ACTION,
    );
    $items['redhen/' . $path . '/%' . $note_entity_type . '/note/%redhen_note'] = array(
      'title callback' => 'redhen_note_title',
      'title arguments' => array(
        4,
      ),
      'page callback' => 'redhen_note_view',
      'page arguments' => array(
        2,
        $note_entity_type,
        4,
      ),
      'access callback' => 'redhen_note_access',
      'access arguments' => array(
        'view',
        2,
      ),
      'weight' => 10,
    );
    $items['redhen/' . $path . '/%' . $note_entity_type . '/note/%redhen_note/view'] = array(
      'title' => 'Summary',
      'type' => MENU_DEFAULT_LOCAL_TASK,
      'weight' => -10,
      'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
    );
    $items['redhen/' . $path . '/%' . $note_entity_type . '/note/%redhen_note/view/edit'] = array(
      'title' => 'Edit',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'redhen_note_form',
        4,
      ),
      'access callback' => 'redhen_note_access',
      'access arguments' => array(
        'edit',
        2,
      ),
      'type' => MENU_LOCAL_TASK,
      'file' => 'includes/redhen_note.forms.inc',
    );
    $items['redhen/' . $path . '/%' . $note_entity_type . '/note/%redhen_note/view/delete'] = array(
      'title' => 'Delete',
      'page callback' => 'drupal_get_form',
      'page arguments' => array(
        'redhen_note_delete_form',
        4,
      ),
      'access callback' => 'redhen_note_access',
      'access arguments' => array(
        'delete',
        2,
      ),
      'type' => MENU_LOCAL_TASK,
      'weight' => 10,
      'file' => 'includes/redhen_note.forms.inc',
    );
  }
  return $items;
}