You are here

function comment_og_menu_alter in Comment OG 7

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

Implements hook_menu_alter().

File

./comment_og.module, line 149
Provides comment integration for Organic Groups.

Code

function comment_og_menu_alter(&$items) {

  // Every other comment path uses %, but this one loads the comment directly,
  // so we don't end up loading it twice (in the page and access callback).
  $items['comment/%comment/edit'] = array(
    'title' => 'Edit',
    'page callback' => 'comment_edit_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'comment_og_access',
    'access arguments' => array(
      'edit',
      1,
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'weight' => 0,
  );
  $items['comment/%/approve'] = array(
    'title' => 'Approve',
    'page callback' => 'comment_approve',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'comment_og_access',
    'access arguments' => array(
      'approve',
      1,
      3,
    ),
    'file' => 'comment.pages.inc',
    'file path' => drupal_get_path('module', 'comment'),
    'weight' => 1,
  );
  $items['comment/%/delete'] = array(
    'title' => 'Delete',
    'page callback' => 'comment_confirm_delete_page',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'comment_og_access',
    'access arguments' => array(
      'delete',
      1,
      3,
    ),
    'type' => MENU_LOCAL_TASK,
    'file' => 'comment.admin.inc',
    'file path' => drupal_get_path('module', 'comment'),
    'weight' => 2,
  );
}