");
Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) NumTab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[NumTab],
NumTab == Gbl.CurrentTab ? The_ClassTabOn[Gbl.Prefs.Theme] :
The_ClassTabOff[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"
"
"
%s
"
"",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Tab_TabIcons[NumTab],
Txt_TABS_FULL_TXT[NumTab],
Txt_TABS_FULL_TXT[NumTab],
Txt_TABS_SHORT_TXT[NumTab]);
Act_FormEnd ();
}
else
fprintf (Gbl.F.Out,"
"
"
"
"
%s
",
Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION,
Tab_TabIcons[NumTab],
Txt_TABS_FULL_TXT[NumTab],
Txt_TABS_FULL_TXT[NumTab],
The_ClassTabOff[Gbl.Prefs.Theme],
Txt_TABS_SHORT_TXT[NumTab]);
fprintf (Gbl.F.Out,"
"
"");
}
}
/***** End of the table *****/
fprintf (Gbl.F.Out,"");
}
/*****************************************************************************/
/************************* Check if I can view a tab *************************/
/*****************************************************************************/
static bool Tab_CheckIfICanViewTab (Act_Tab_t Tab)
{
switch (Tab)
{
case TabUnk:
return false;
case TabSys:
return (Gbl.CurrentCty.Cty.CtyCod <= 0);
case TabCty:
return (Gbl.CurrentCty.Cty.CtyCod > 0 &&
Gbl.CurrentIns.Ins.InsCod <= 0);
case TabIns:
return (Gbl.CurrentIns.Ins.InsCod > 0 &&
Gbl.CurrentCtr.Ctr.CtrCod <= 0);
case TabCtr:
return (Gbl.CurrentCtr.Ctr.CtrCod > 0 &&
Gbl.CurrentDeg.Deg.DegCod <= 0);
case TabDeg:
return (Gbl.CurrentDeg.Deg.DegCod > 0 &&
Gbl.CurrentCrs.Crs.CrsCod <= 0);
case TabCrs:
return (Gbl.CurrentCrs.Crs.CrsCod > 0);
default:
return true;
}
}
/*****************************************************************************/
/********************* Draw breadcrumb with tab and action *******************/
/*****************************************************************************/
void Tab_DrawBreadcrumb (void)
{
extern const char *The_TabOnBgColors[The_NUM_THEMES];
extern const char *The_ClassTabOn[The_NUM_THEMES];
fprintf (Gbl.F.Out,"
",
The_TabOnBgColors[Gbl.Prefs.Theme]);
/***** Home *****/
Tab_WriteBreadcrumbHome ();
if (Gbl.CurrentAct == ActMnu ||
Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0)
{
/***** Tab *****/
fprintf (Gbl.F.Out," > ",
The_ClassTabOn[Gbl.Prefs.Theme]);
Tab_WriteBreadcrumbTab ();
if (Act_Actions[Act_Actions[Gbl.CurrentAct].SuperAction].IndexInMenu >= 0)
{
/***** Menu *****/
fprintf (Gbl.F.Out," > ",
The_ClassTabOn[Gbl.Prefs.Theme]);
Tab_WriteBreadcrumbAction ();
}
}
fprintf (Gbl.F.Out,"
");
}
/*****************************************************************************/
/************************ Write home in breadcrumb ***************************/
/*****************************************************************************/
static void Tab_WriteBreadcrumbHome (void)
{
extern const char *The_ClassTabOn[The_NUM_THEMES];
extern const char *Txt_Home_PAGE;
Act_FormStart (ActHom);
Act_LinkFormSubmit (Txt_Home_PAGE,The_ClassTabOn[Gbl.Prefs.Theme]);
fprintf (Gbl.F.Out,"%s",
Txt_Home_PAGE);
Act_FormEnd ();
}
/*****************************************************************************/
/************ Write icon and title associated to the current tab *************/
/*****************************************************************************/
static void Tab_WriteBreadcrumbTab (void)
{
extern const char *The_ClassTabOn[The_NUM_THEMES];
extern const char *Txt_TABS_FULL_TXT[Tab_NUM_TABS];
/***** Start form *****/
Act_FormStart (ActMnu);
Par_PutHiddenParamUnsigned ("NxtTab",(unsigned) Gbl.CurrentTab);
Act_LinkFormSubmit (Txt_TABS_FULL_TXT[Gbl.CurrentTab],The_ClassTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/
fprintf (Gbl.F.Out,"%s",
Txt_TABS_FULL_TXT[Gbl.CurrentTab]);
Act_FormEnd ();
}
/*****************************************************************************/
/***************** Write title associated to the current action **************/
/*****************************************************************************/
static void Tab_WriteBreadcrumbAction (void)
{
extern const char *The_ClassTabOn[The_NUM_THEMES];
const char *Title = Act_GetTitleAction (Gbl.CurrentAct);
/***** Start form *****/
Act_FormStart (Act_Actions[Gbl.CurrentAct].SuperAction);
Act_LinkFormSubmit (Title,The_ClassTabOn[Gbl.Prefs.Theme]);
/***** Title and end of form *****/
fprintf (Gbl.F.Out,"%s",
Title);
Act_FormEnd ();
}
/*****************************************************************************/
/*************** Set current tab depending on current action *****************/
/*****************************************************************************/
void Tab_SetCurrentTab (void)
{
Gbl.CurrentTab = Act_Actions[Gbl.CurrentAct].Tab;
/***** Change action and tab if country, institution, centre or degree
are incompatible with the current tab *****/
switch (Gbl.CurrentTab)
{
case TabCty:
if (Gbl.CurrentCty.Cty.CtyCod <= 0) // No country selected
Gbl.CurrentAct = ActSeeCty;
break;
case TabIns:
if (Gbl.CurrentIns.Ins.InsCod <= 0) // No institution selected
{
if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns;
else // No country selected
Gbl.CurrentAct = ActSeeCty;
}
break;
case TabCtr:
if (Gbl.CurrentCtr.Ctr.CtrCod <= 0) // No centre selected
{
if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected
Gbl.CurrentAct = ActSeeCtr;
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns;
else // No country selected
Gbl.CurrentAct = ActSeeCty;
}
break;
case TabDeg:
if (Gbl.CurrentDeg.Deg.DegCod <= 0) // No degree selected
{
if (Gbl.CurrentCtr.Ctr.CtrCod > 0) // Centre selected, but no degree selected
Gbl.CurrentAct = ActSeeDeg;
else if (Gbl.CurrentIns.Ins.InsCod > 0) // Institution selected, but no centre selected
Gbl.CurrentAct = ActSeeCtr;
else if (Gbl.CurrentCty.Cty.CtyCod > 0) // Country selected, but no institution selected
Gbl.CurrentAct = ActSeeIns;
else // No country selected
Gbl.CurrentAct = ActSeeCty;
}
break;
default:
break;
}
Gbl.CurrentTab = Act_Actions[Gbl.CurrentAct].Tab;
Tab_DisableIncompatibleTabs ();
}
/*****************************************************************************/
/************************** Disable incompatible tabs ************************/
/*****************************************************************************/
void Tab_DisableIncompatibleTabs (void)
{
/***** Set country, institution, centre, degree and course depending on the current tab.
This will disable tabs incompatible with the current one. *****/
switch (Gbl.CurrentTab)
{
case TabSys:
Gbl.CurrentCty.Cty.CtyCod = -1L;
// no break
case TabCty:
Gbl.CurrentIns.Ins.InsCod = -1L;
// no break
case TabIns:
Gbl.CurrentCtr.Ctr.CtrCod = -1L;
// no break
case TabCtr:
Gbl.CurrentDeg.Deg.DegCod = -1L;
// no break
case TabDeg:
Gbl.CurrentCrs.Crs.CrsCod = -1L;
break;
default:
break;
}
}