Index: og_forum.module =================================================================== --- og_forum.module (revision 251) +++ og_forum.module (working copy) @@ -2,7 +2,7 @@ /** * @file * Creates a forum per organic group and restricts viewing forum nodes by group membership. - * @version $Id: og_forum.module,v 1.11.2.11.2.18.2.17.2.12 2009/09/14 13:56:21 paulbooker Exp $ + * @version $Id: og_forum.module,v 1.11.2.11.2.18.2.17.2.13 2009/10/14 13:49:56 paulbooker Exp $ * @package OG_Forum */ @@ -94,13 +94,25 @@ 'access arguments' => array(3), 'type' => MENU_CALLBACK ); - $items['node/%og_forum_group_type/forum'] = array( + $items['node/%og_forum_group_type/og/forum'] = array( 'title' => 'Forums', - 'page callback' => 'drupal_goto', + 'page callback' => 'forum_page', 'page arguments' => array(1), - 'access callback' => TRUE, - 'type' => MENU_LOCAL_TASK + 'access arguments' => array('access content'), + 'type' => MENU_LOCAL_TASK, + 'file' => 'forum.pages.inc', + 'file path' => drupal_get_path('module', 'forum') + ); + $items['node/%og_forum_group_type/og/forum/%'] = array( + 'title' => 'Forums', + 'page callback' => 'forum_page', + 'page arguments' => array(4), + 'access arguments' => array('access content'), + 'type' => MENU_LOCAL_TASK, + 'file' => 'forum.pages.inc', + 'file path' => drupal_get_path('module', 'forum') ); + return $items; } @@ -110,8 +122,15 @@ function og_forum_menu_alter(&$callbacks) { $callbacks['forum']['access callback'] = 'og_forum_access_forum_page'; $callbacks['forum']['access arguments'] = array(1); + + $callbacks['forum']['page callback'] = 'og_forum_topic_redirect'; } +function og_forum_topic_redirect($tid) { + $gid = og_forum_gid_from_tid($tid); + drupal_goto("node/$gid/og/forum/$tid"); +} + function og_forum_access_privileges_1 ($gid) { $group = node_load($gid); $allow_public = variable_get('forum_allow_public', 0); @@ -134,7 +153,7 @@ global $user; $tid = og_forum_get_forum_container($arg); if (og_forum_is_public($tid) || (!empty($user->og_groups) && array_key_exists($arg, $user->og_groups)) || user_access('administer forums')) - return 'forum/'.$tid; + return $tid; else return FALSE; }