You are here

function ajax_comments_menu in AJAX Comments 7

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

Implements hook_menu().

File

./ajax_comments.module, line 11
AJAX comments module file.

Code

function ajax_comments_menu() {
  $items['admin/config/content/ajax_comments'] = array(
    'title' => 'AJAX comments',
    'description' => 'AJAXifies comments on site.',
    'page callback' => 'drupal_get_form',
    'page arguments' => array(
      'ajax_comments_settings',
    ),
    'access arguments' => array(
      'administer site configuration',
    ),
    'file' => 'ajax_comments.admin.inc',
  );
  $items['ajax_comment/%comment/edit'] = array(
    'page callback' => 'ajax_comments_edit',
    'page arguments' => array(
      1,
    ),
    'access callback' => 'comment_access',
    'access arguments' => array(
      'edit',
      1,
    ),
    'delivery callback' => 'ajax_deliver',
    'type' => MENU_CALLBACK,
  );

  // Special-casing for EditLimit Module.
  if (module_exists('edit_limit')) {
    $items['ajax_comment/%comment/edit']['access callback'] = 'edit_limit_comment_access';
  }
  $items['ajax_comment/%/delete'] = array(
    'page callback' => 'ajax_comments_delete',
    'page arguments' => array(
      1,
    ),
    'access arguments' => array(
      'administer comments',
    ),
    'delivery callback' => 'ajax_deliver',
    'type' => MENU_CALLBACK,
  );

  // Special-casing for comment_goodness Module
  if (module_exists('comment_goodness')) {
    $items['ajax_comment/%/delete']['access arguments'] = array(
      1,
    );
    $items['ajax_comment/%/delete']['access callback'] = 'comment_goodness_delete_comment_access';
  }

  // Special-casing for CommentAccess Module
  if (module_exists('commentaccess')) {
    $items['ajax_comment/%/delete']['access callback'] = 'commentaccess_access_check';
    $items['ajax_comment/%/delete']['access arguments'] = array(
      1,
      'delete',
    );
  }
  $items['ajax_comment/reply/%node'] = array(
    'page callback' => 'ajax_comments_reply',
    'page arguments' => array(
      2,
    ),
    'access callback' => 'node_access',
    'access arguments' => array(
      'view',
      2,
    ),
    'delivery callback' => 'ajax_deliver',
    'type' => MENU_CALLBACK,
  );
  return $items;
}