Hi,
I have solved my problem by not showing "My Portal" for Non-admin users and still show the Portals that has been added.. I did it by changing in the themes\sugar\header.php. since i am using only 1 theme.(LINE NO: 519 or so..Search for the '$preListHeader as $module_name')
OLD CODE:
Code:
foreach($preListHeader as $module_name)
{
if (!is_array($module_name)) {
$xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]);
$xtpl->assign("MODULE_KEY", $module_name);
if($module_name == $currentModule && ($module_name != 'iFrames' || empty($_REQUEST['record'])|| (!empty($_REQUEST['tab']) && $_REQUEST['tab']=='false')))
{
$tabClass = "currentTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "currentTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
else
{
$tabClass = "otherTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "otherTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
$xtpl->assign("LINK", '<a class="'.$tabClass.'Link" href="index.php?module='.$module_name.'&action=index">'.$app_list_strings['moduleList'][$module_name].'</A>');
} else {
$xtpl->assign("MODULE_NAME", $module_name[4]);
$xtpl->assign("MODULE_KEY", $module_name[3]);
if($module_name[3] == $currentModule && (!empty($_REQUEST['record']) and $_REQUEST['record']==$module_name[0] and !empty($_REQUEST['tab'])))
{
$tabClass = "currentTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "currentTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
else
{
$tabClass = "otherTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "otherTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
$xtpl->assign("LINK", '<a class="'.$tabClass.'Link" href="index.php?module='.$module_name[3].'&action=index&record='.$module_name[0].'&tab='.$module_name[2].'">'.$module_name[4].'</A>');
}
if ($i==$max_tabs-1 and $numb_tabs>$max_tabs) {
//$xtpl->assign("MORE", "<img src='".$image_path."more.gif' alt='' align='absmiddle' id='MoreHandle' style=' margin-left:2px; cursor: pointer; cursor: hand;' align='absmiddle' onmouseover='tbButtonMouseOver(this.id,\"\",\"\",0);'>");
$xtpl->assign("MORE_HANDLE_CLASS", 'otherTab');
$xtpl->parse("main.moreHandle");
}
$xtpl->parse("main.module_tab");
$i++;
} NEW CODE: // This is the section where modules are added to the tabs list..
Code:
foreach($preListHeader as $module_name)
{
if (!is_array($module_name)) {
if ($module_name != 'iFrames')
{
$xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]);
$xtpl->assign("MODULE_KEY", $module_name);
if($module_name == $currentModule && ($module_name != 'iFrames' || empty($_REQUEST['record'])|| (!empty($_REQUEST['tab']) && $_REQUEST['tab']=='false')))
{
$tabClass = "currentTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "currentTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
else
{
$tabClass = "otherTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "otherTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
$xtpl->assign("LINK", '<a class="'.$tabClass.'Link" href="index.php?module='.$module_name.'&action=index">'.$app_list_strings['moduleList'][$module_name].'</A>');
}
else
{ // Add "My Portal" to the Tabs only if the User is Admin..
if ($current_user->user_name == 'Admin')
{
$xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]);
$xtpl->assign("MODULE_KEY", $module_name);
if($module_name == $currentModule && ($module_name != 'iFrames' || empty($_REQUEST['record'])|| (!empty($_REQUEST['tab']) && $_REQUEST['tab']=='false')))
{
$tabClass = "currentTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "currentTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
else
{
$tabClass = "otherTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "otherTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
$xtpl->assign("LINK", '<a class="'.$tabClass.'Link" href="index.php?module='.$module_name.'&action=index">'.$app_list_strings['moduleList'][$module_name].'</A>');
}
else
{
$xtpl->assign("MODULE_NAME", $app_list_strings['moduleList'][$module_name]);
$xtpl->assign("MODULE_KEY", $module_name);
$tabClass = "PortalTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "PortalTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
}
} else {
$xtpl->assign("MODULE_NAME", $module_name[4]);
$xtpl->assign("MODULE_KEY", $module_name[3]);
if($module_name[3] == $currentModule && (!empty($_REQUEST['record']) and $_REQUEST['record']==$module_name[0] and !empty($_REQUEST['tab'])))
{
$tabClass = "currentTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "currentTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
else
{
$tabClass = "otherTab";
$otherTab = "currentTab";
$xtpl->assign("TAB_CLASS", "otherTab");
$xtpl->assign("OTHER_TAB", "currentTab");
}
$xtpl->assign("LINK", '<a class="'.$tabClass.'Link" href="index.php?module='.$module_name[3].'&action=index&record='.$module_name[0].'&tab='.$module_name[2].'">'.$module_name[4].'</A>');
}
if ($i==$max_tabs-1 and $numb_tabs>$max_tabs) {
//$xtpl->assign("MORE", "<img src='".$image_path."more.gif' alt='' align='absmiddle' id='MoreHandle' style=' margin-left:2px; cursor: pointer; cursor: hand;' align='absmiddle' onmouseover='tbButtonMouseOver(this.id,\"\",\"\",0);'>");
$xtpl->assign("MORE_HANDLE_CLASS", 'otherTab');
$xtpl->parse("main.moreHandle");
}
$xtpl->parse("main.module_tab");
$i++;
} in the style.css added the following style
Code:
.PortalTab {
display:none;
}
.PortalTabRight , .PortalTabLeft, .PortalTab {
display:none;
} By using the above code i was able to hide "my Portal" and also at the same time show the Portals for all the users.
Thanks
Raja.
Bookmarks