Re: Changing tab colors for modules
Hi enrikm!
It's really interesting question.
So you have to update the file /modules/themes/Sugar/header.php
there is code
foreach($preListHeader as $module_name)
{
$color = "";
if ($module_name == "Home") $color = "blue";
if ($module_name == "Contacts") $color = "red";
if ($module_name == "Accounts") $color = "#ffbbaa";
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", '<span style="background-color:'.$color.';"><a class="'.$tabClass.'Link" href="index.php?module='.$module_name.'&action=ind ex">'.$app_list_strings['moduleList'][$module_name].'</A></span>');
} 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_HANDLE_CLASS", 'otherTab');
$xtpl->parse("main.moreHandle");
}
$xtpl->parse("main.module_tab");
$i++;
}
you can find the code i've just added as bold.
Petro Blagodir
petro@blagodir.ua
http://www.blagodir.com
Blagodir Ltd.( SugarCRM - Consultations, Development and Support)
Bookmarks