You are here

function talk_menu in Talk 5

Same name and namespace in other branches
  1. 6 talk.module \talk_menu()
  2. 7 talk.module \talk_menu()

Implementation of hook_menu().

File

./talk.module, line 23
Comments are displayed in a separate 'talk' tab, for node types you wish Made for Drupal 5.x

Code

function talk_menu($may_cache) {
  $items = array();
  if ($may_cache) {
    $items[] = array(
      'path' => 'admin/settings/talk',
      'title' => 'Talk page',
      'description' => 'Configure settings for the talk page.',
      'callback' => 'drupal_get_form',
      'callback arguments' => array(
        'talk_admin_form',
      ),
    );
  }
  else {
    if (arg(0) == 'node' && is_numeric(arg(1))) {
      $node = node_load(arg(1));
      if (talk_activated($node->type) && $node->nid && _talk_node_comment_value($node)) {
        $items[] = array(
          'path' => 'node/' . arg(1) . '/talk',
          'title' => talk_title(),
          'callback' => 'talk_handle',
          'callback arguments' => array(
            arg(1),
          ),
          'access' => user_access('access comments') && node_access('view', $node),
          'type' => MENU_LOCAL_TASK,
          'weight' => 1,
        );
      }
    }
  }
  return $items;
}