You are here

function comment_notify_menu in Comment Notify 5

Same name and namespace in other branches
  1. 5.2 comment_notify.module \comment_notify_menu()
  2. 6 comment_notify.module \comment_notify_menu()
  3. 7 comment_notify.module \comment_notify_menu()

Implementation of hook_menu().

File

./comment_notify.module, line 110
This module provides comment follow-up e-mail notification for anonymous and registered users.

Code

function comment_notify_menu($may_cache) {
  $items = array();
  global $user;
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/comment_notify',
      'title' => t('Comment Notify'),
      'description' => t('Configure settings for e-mails about new comments.'),
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'comment_notify_settings',
      ),
      'access' => user_access('Administer comment notify'),
    );
    $items[] = array(
      'path' => 'admin/settings/comment_notify/settings',
      'title' => t('Settings'),
      'callback' => 'drupal_get_form',
      'description' => t('Configure settings for e-mails about new comments.'),
      'callback arguments' => array(
        'comment_notify_settings',
      ),
      'access' => user_access('Administer comment notify'),
      'type' => MENU_DEFAULT_LOCAL_TASK,
    );
    $items[] = array(
      'path' => 'admin/settings/comment_notify/unsubscribe',
      'title' => t('Unsubscribe'),
      'weight' => 2,
      'callback' => 'drupal_get_form',
      'description' => t('Unsubscribe an email from all notifications.'),
      'callback arguments' => array(
        'comment_notify_unsubscribe',
      ),
      'access' => user_access('Administer comment notify'),
      'type' => MENU_LOCAL_TASK,
    );
  }
  else {
    $items[] = array(
      'path' => 'comment_notify',
      'title' => t('comment notify'),
      'callback' => 'comment_notify_page',
      'access' => 1,
      'type' => MENU_CALLBACK,
    );
  }
  return $items;
}