You are here

function notifications_feed_menu in Notifications 5

Implementation of hook_menu_()

File

notifications_feed/notifications_feed.module, line 18
Subscriptions to FeedAPI feeds

Code

function notifications_feed_menu($may_cache) {
  global $user;

  // we need the user to to build some urls
  $items = array();
  if ($may_cache) {

    /*
    $items[] = array(
      'path' => 'admin/notifications/settings/taxonomy',
      'title' => t('Taxonomy'),
      'type' => MENU_LOCAL_TASK,
      'callback' => 'drupal_get_form',
      'callback arguments' => array('notifications_tags_settings_form'),
    );
    */
  }
  else {
    if ($user->uid && arg(0) == 'user' && is_numeric(arg(1)) && arg(2) == 'notifications' && ($user->uid == arg(1) || user_access('administer notifications'))) {
      $account = $user->uid == arg(1) ? $user : user_load(array(
        'uid' => arg(1),
      ));
      $items[] = array(
        'path' => 'user/' . $account->uid . '/notifications/feeds',
        'type' => MENU_LOCAL_TASK,
        'access' => user_access('subscribe to feeds'),
        'title' => t('Feeds'),
        'callback' => 'notifications_feed_user_page',
        'callback arguments' => array(
          $account,
        ),
        'weight' => 10,
      );
    }
  }
  return $items;
}