<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Arial">I've been fighting with this for a
couple weeks now with no resolution, so I'm hoping someone can shed
some light on this for me.&nbsp;&nbsp;&nbsp; I tried using the menu tabs capability in
Views with no luck, so I'm trying to accomplish the same thing in a
module, still with no luck, and I don't have much hair left to pull
out...<br>
<br>
What I want to do is create a page with three tabbed menu items.&nbsp; The
text will be from a Page node, and the three tabs will be views.&nbsp; There
are three roles - regular, associate, and affiliate - that need to have
access.&nbsp; Regular and Associate can see all items, and Affiliate role
can only see what has been flagged as being visible to the Affiliate
role.&nbsp; There are three categories - Basic Information, Best Practices,
and Technology.&nbsp; I've created six views accordingly.&nbsp; What I'm trying
to do is create two menu items: one for Regular/Associate, and one for
Affiliate, with the same intro text.&nbsp; Each will have three tabs, but
the views will be different&nbsp;&nbsp; Here is my hook_menu:<br>
<br>
function mymodule_menu($may_cache) {<br>
&nbsp; $items = array();<br>
&nbsp; <br>
&nbsp; if ($may_cache) {<br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/reg-assoc',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Resource Center - Regular'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Resource center for regular and associate
members'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_base_page',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('regular'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_NORMAL_ITEM,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/reg-assoc/basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Basic Information'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Basic Information'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_reg_assoc_basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('regular'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_DEFAULT_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/reg-assoc/best-practices',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Best Practices'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Best Practices'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_best',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_reg_assoc_best',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('regular'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/reg-assoc/technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Technology'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Technology'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_reg_assoc_technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('regular'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/affiliate',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Resource Center - Affiliate'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Resource center for affiliate members'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_base_page',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('affiliate'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_NORMAL_ITEM,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/affiliate/basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Basic Information'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Basic Information'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_affiliate_basic',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('affiliate'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_DEFAULT_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/affiliate/best-practices',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Best Practices'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Best Practices'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_best_practices',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_affiliate_best',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('affiliate'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );<br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; $items[] = array(<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'path' =&gt; 'resource-center/affiliate/technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'title' =&gt; t('Technology'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'description' =&gt; t('Technology'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback' =&gt; 'resource_center_technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'callback argument' =&gt; 'resources_affiliate_technology',<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'access' =&gt; user_access('affiliate'),<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'type' =&gt; MENU_LOCAL_TASK,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; );&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp; }&nbsp; <br>
&nbsp; return $items;<br>
}<br>
<br>
The URLs for the views match the paths for the MENU_LOCAL_TASK items.<br>
<br>
Here is the function to call the page (as referred to in the menu
callback:<br>
<br>
function resource_center_base_page() {<br>
&nbsp; $output = '';<br>
&nbsp; <br>
&nbsp; $base_node = node_load(84);<br>
&nbsp; $display = node_view($base_node);<br>
&nbsp; <br>
&nbsp; $output = $display;<br>
&nbsp; <br>
&nbsp; return $output;<br>
}<br>
<br>
and then the functions to call the views:<br>
<br>
function resource_center_basic($view_name) {<br>
&nbsp; $view = views_get_view($view_name);<br>
&nbsp; print views_build_view('embed', $view, array(), false, false); <br>
}<br>
<br>
function resource_center_best_practices($view_name) {<br>
&nbsp; <br>
&nbsp; $view = views_get_view($view_name);<br>
&nbsp; print views_build_view('embed', $view, array(), false, false);<br>
}<br>
<br>
function resource_center_technology($view_name) {<br>
&nbsp; <br>
&nbsp; $view = views_get_view($view_name);<br>
&nbsp; print views_build_view('embed', $view, array(), false, false);<br>
}<br>
<br>
After all that, what's happening is that the menu items are only
available to my admin user (the first one created).&nbsp; When I go to
resource-center/reg-assoc, I get my page and the tabs, but when I go to
resource-center/affiliate, I just get the page with no tabs.&nbsp; When I
log in as a regular role, I don't see the menu items at all, and if I
go to resource-center/reg-assoc, I get Access Denied.&nbsp; Am I doing
something wrong, or is this a bug in the menu system.<br>
<br>
Thanks.<br>
<br>
Steve<br>
<br>
<br>
<br>
<br>
</font></font>
</body>
</html>