",
IconSet == Gbl.Prefs.IconSet ? "PREF_ON" :
"PREF_OFF");
Frm_StartForm (ActChgIco);
Par_PutHiddenParamString ("IconSet",Ico_IconSetId[IconSet]);
snprintf (Icon,sizeof (Icon),
"%s/%s/cog.svg",
Cfg_ICON_FOLDER_SETS,
Ico_IconSetId[IconSet]);
Ico_PutPrefIconLink (Icon,Ico_IconSetNames[IconSet]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"
");
}
Pre_EndOnePrefSelector ();
Pre_EndPrefsHead ();
Box_EndBox ();
}
/*****************************************************************************/
/*************** Put contextual icons in icon-set preference *****************/
/*****************************************************************************/
static void Ico_PutIconsIconSet (void)
{
/***** Put icon to show a figure *****/
Gbl.Figures.FigureType = Fig_ICON_SETS;
Fig_PutIconToShowFigure ();
}
/*****************************************************************************/
/***************************** Change icon set *******************************/
/*****************************************************************************/
void Ico_ChangeIconSet (void)
{
/***** Get param with icon set *****/
Gbl.Prefs.IconSet = Ico_GetParamIconSet ();
snprintf (Gbl.Prefs.URLIconSet,sizeof (Gbl.Prefs.URLIconSet),
"%s/%s",
Cfg_URL_ICON_SETS_PUBLIC,
Ico_IconSetId[Gbl.Prefs.IconSet]);
/***** Store icon set in database *****/
if (Gbl.Usrs.Me.Logged)
DB_QueryUPDATE ("can not update your preference about icon set",
"UPDATE usr_data SET IconSet='%s' WHERE UsrCod=%ld",
Ico_IconSetId[Gbl.Prefs.IconSet],
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Set preferences from current IP *****/
Pre_SetPrefsFromIP ();
}
/*****************************************************************************/
/*********************** Get parameter with icon set *************************/
/*****************************************************************************/
Ico_IconSet_t Ico_GetParamIconSet (void)
{
char IconSetId[Ico_MAX_BYTES_ICON_SET_ID + 1];
Ico_IconSet_t IconSet;
Par_GetParToText ("IconSet",IconSetId,Ico_MAX_BYTES_ICON_SET_ID);
for (IconSet = (Ico_IconSet_t) 0;
IconSet < Ico_NUM_ICON_SETS;
IconSet++)
if (!strcmp (IconSetId,Ico_IconSetId[IconSet]))
return IconSet;
return Ico_ICON_SET_DEFAULT;
}
/*****************************************************************************/
/************************* Get icon set from string **************************/
/*****************************************************************************/
Ico_IconSet_t Ico_GetIconSetFromStr (const char *Str)
{
Ico_IconSet_t IconSet;
for (IconSet = (Ico_IconSet_t) 0;
IconSet < Ico_NUM_ICON_SETS;
IconSet++)
if (!strcasecmp (Str,Ico_IconSetId[IconSet]))
return IconSet;
return Ico_ICON_SET_DEFAULT;
}
/*****************************************************************************/
/*** Show contextual icons to add, remove, edit, view, hide, unhide, print ***/
/*****************************************************************************/
void Ico_PutContextualIconToAdd (Act_Action_t NextAction,const char *Anchor,
void (*FuncParams) (),
const char *Txt)
{
Lay_PutContextualLinkOnlyIcon (NextAction,Anchor,FuncParams,
"plus.svg",
Txt);
}
void Ico_PutContextualIconToRemove (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Remove;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"trash.svg",
Txt_Remove);
}
void Ico_PutContextualIconToEdit (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Edit;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"pen.svg",
Txt_Edit);
}
void Ico_PutContextualIconToViewFiles (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Files;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"folder-open.svg",
Txt_Files);
}
void Ico_PutContextualIconToView (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_View;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"eye.svg",
Txt_View);
}
void Ico_PutContextualIconToHide (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Hide;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"eye.svg",
Txt_Hide);
}
void Ico_PutContextualIconToUnhide (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Show;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"eye-slash.svg",
Txt_Show);
}
void Ico_PutContextualIconToPrint (Act_Action_t NextAction,void (*FuncParams) ())
{
extern const char *Txt_Print;
Lay_PutContextualLinkOnlyIcon (NextAction,NULL,FuncParams,
"print.svg",
Txt_Print);
}
/*****************************************************************************/
/**************** Show an icon inside a div (without text) *******************/
/*****************************************************************************/
void Ico_PutDivIcon (const char *DivClass,const char *Icon,const char *Title)
{
fprintf (Gbl.F.Out,""
"
"
"
" // Animated icon hidden
"
"
"",
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title,
Gbl.Form.Num,Cfg_URL_ICON_PUBLIC,Title,Title);
}
/*****************************************************************************/
/********** Put a icon with a text to submit a form. **********/
/********** When clicked, the icon will be replaced by an animation **********/
/*****************************************************************************/
void Ico_PutCalculateIconWithText (const char *Text)
{
fprintf (Gbl.F.Out,"