mirror of https://github.com/acanas/swad-core.git
Version 23.45: Nov 07, 2023 Improvements in responsive design.
This commit is contained in:
parent
fd67813920
commit
61d93d612f
|
@ -749,11 +749,17 @@ a:hover /* Default ==> underlined */
|
|||
vertical-align:top;
|
||||
overflow:hidden;
|
||||
}
|
||||
.TAB_ICO
|
||||
{
|
||||
height:28px;
|
||||
vertical-align:middle;
|
||||
padding:4px 0;
|
||||
}
|
||||
.TAB_TXT
|
||||
{
|
||||
font-size:9pt;
|
||||
font-weight:bold;
|
||||
max-width:30px;
|
||||
max-width:26px;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
padding-top:2px;
|
||||
|
@ -797,6 +803,12 @@ a:hover /* Default ==> underlined */
|
|||
vertical-align:top;
|
||||
overflow:hidden;
|
||||
}
|
||||
.TAB_ICO
|
||||
{
|
||||
height:28px;
|
||||
vertical-align:middle;
|
||||
padding:4px 0;
|
||||
}
|
||||
.TAB_TXT
|
||||
{
|
||||
font-size:9pt;
|
||||
|
@ -845,6 +857,12 @@ a:hover /* Default ==> underlined */
|
|||
vertical-align:top;
|
||||
overflow:hidden;
|
||||
}
|
||||
.TAB_ICO
|
||||
{
|
||||
height:28px;
|
||||
vertical-align:middle;
|
||||
padding:4px 0;
|
||||
}
|
||||
.TAB_TXT
|
||||
{
|
||||
font-size:9pt;
|
||||
|
@ -889,12 +907,6 @@ a:hover /* Default ==> underlined */
|
|||
.TAB_ON_TXT_PINK {color:#63474e;}
|
||||
.TAB_ON_TXT_DARK {color:#e0e0e0;}
|
||||
|
||||
.TAB_ICO
|
||||
{
|
||||
height:28px;
|
||||
vertical-align:middle;
|
||||
padding:4px 0;
|
||||
}
|
||||
/* Creating filter from RGB: https://codepen.io/sosuke/pen/Pjoqqp */
|
||||
.TAB_ICO_WHITE,
|
||||
.TAB_ICO_GREY,
|
||||
|
@ -1226,7 +1238,7 @@ a:hover /* Default ==> underlined */
|
|||
line-height:110%;
|
||||
white-space:nowrap;
|
||||
overflow:hidden;
|
||||
width:30px;
|
||||
width:26px;
|
||||
margin:0 auto;
|
||||
padding:2px 0;
|
||||
}
|
||||
|
@ -1677,7 +1689,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
|||
.BT_SUBMIT_INLINE
|
||||
{
|
||||
box-sizing:border-box;
|
||||
min-width:170px;
|
||||
width:120px;
|
||||
margin:0 10px;
|
||||
padding:2px 4px;
|
||||
border-radius:2px;
|
||||
|
@ -1690,6 +1702,8 @@ a:hover img.CENTER_PHOTO_SHOW
|
|||
line-height:normal;
|
||||
white-space:nowrap;
|
||||
vertical-align:middle;
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
}
|
||||
.BT_SUBMIT:hover
|
||||
{
|
||||
|
@ -1874,7 +1888,7 @@ a:hover img.CENTER_PHOTO_SHOW
|
|||
overflow:hidden;
|
||||
}
|
||||
.NOTICE_BOX_NARROW {width:148px;}
|
||||
.NOTICE_BOX_WIDE {width:500px;}
|
||||
.NOTICE_BOX_WIDE {max-width:500px;}
|
||||
.NOTICE_DATE
|
||||
{
|
||||
float:right;
|
||||
|
@ -3992,7 +4006,7 @@ legend {font-size:12pt;}
|
|||
}
|
||||
.PREF_OFF
|
||||
{
|
||||
display:table-cell;
|
||||
display:inline-block;
|
||||
box-sizing:border-box;
|
||||
padding:6px;
|
||||
text-align:center;
|
||||
|
@ -4002,7 +4016,7 @@ legend {font-size:12pt;}
|
|||
}
|
||||
.PREF_ON
|
||||
{
|
||||
display:table-cell;
|
||||
display:inline-block;
|
||||
box-sizing:border-box;
|
||||
padding:6px;
|
||||
text-align:center;
|
||||
|
@ -4247,29 +4261,29 @@ legend {font-size:12pt;}
|
|||
|
||||
@media only screen and (max-width: 590px)
|
||||
{ /* For mobile-phones (maximum width visible on Moto G4 vertical) */
|
||||
.Tml_WIDTH {width:316px;} /* 556-240 */
|
||||
.Tml_RIGHT_WIDTH {width:260px;} /* 500-240 */
|
||||
.Tml_RIGHT_AUTHOR_WIDTH {width:100px;} /* 340-240 */
|
||||
.Tml_COM_WIDTH {width:220px;} /* 460-240 */
|
||||
.Tml_COM_AUTHOR_WIDTH {width: 60px;} /* 300-240 */
|
||||
.Tml_MED_INPUT_WIDTH {width:160px;} /* 400-240 */
|
||||
.TmlNot_FOOT_WIDTH {width:260px;} /* 500-240 */
|
||||
.Tml_COMM_FOOT_WIDTH {width:220px;} /* 460-240 */
|
||||
.Tml_FAV_NOT_WIDTH {width:120px;} /* (480-240)/2 */
|
||||
.Tml_SHA_NOT_WIDTH {width:120px;} /* (480-240)/2 */
|
||||
.Tml_FAV_COM_WIDTH {width:200px;} /* 440-240 */
|
||||
.Tml_WIDTH {width:276px;} /* 556-280 */
|
||||
.Tml_RIGHT_WIDTH {width:220px;} /* 500-280 */
|
||||
.Tml_RIGHT_AUTHOR_WIDTH {width: 60px;} /* 340-280 */
|
||||
.Tml_COM_WIDTH {width:180px;} /* 460-280 */
|
||||
.Tml_COM_AUTHOR_WIDTH {width: 20px;} /* 300-280 */
|
||||
.Tml_MED_INPUT_WIDTH {width:120px;} /* 400-280 */
|
||||
.TmlNot_FOOT_WIDTH {width:220px;} /* 500-280 */
|
||||
.Tml_COMM_FOOT_WIDTH {width:180px;} /* 460-280 */
|
||||
.Tml_FAV_NOT_WIDTH {width:100px;} /* (480-280)/2 */
|
||||
.Tml_SHA_NOT_WIDTH {width:100px;} /* (480-280)/2 */
|
||||
.Tml_FAV_COM_WIDTH {width:160px;} /* 440-280 */
|
||||
}
|
||||
@media only screen and (min-width: 590px)
|
||||
{ /* For tablets and desktop (maximum width visible on Moto G4 horizontal) */
|
||||
.Tml_WIDTH {width:556px;}
|
||||
.Tml_RIGHT_WIDTH {width:500px;}
|
||||
.Tml_WIDTH {width:556px;}
|
||||
.Tml_RIGHT_WIDTH {width:500px;}
|
||||
.Tml_RIGHT_AUTHOR_WIDTH {width:340px;}
|
||||
.Tml_COM_WIDTH {width:460px;}
|
||||
.Tml_COM_WIDTH {width:460px;}
|
||||
.Tml_COM_AUTHOR_WIDTH {width:300px;}
|
||||
.Tml_MED_INPUT_WIDTH {width:400px;}
|
||||
.Tml_FAV_NOT_WIDTH {width:240px;}
|
||||
.Tml_SHA_NOT_WIDTH {width:240px;}
|
||||
.Tml_FAV_COM_WIDTH {width:440px;}
|
||||
.Tml_FAV_NOT_WIDTH {width:240px;}
|
||||
.Tml_SHA_NOT_WIDTH {width:240px;}
|
||||
.Tml_FAV_COM_WIDTH {width:440px;}
|
||||
}
|
||||
|
||||
.Tml_NEW_PUB_WHITE,
|
||||
|
@ -4945,12 +4959,12 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
|
|||
.INPUT_INS_CODE
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:180px;
|
||||
width:160px;
|
||||
}
|
||||
.INPUT_SHRT_NAME
|
||||
{
|
||||
box-sizing:border-box;
|
||||
width:180px;
|
||||
width:160px;
|
||||
}
|
||||
.INPUT_FULL_NAME
|
||||
{
|
||||
|
@ -5010,6 +5024,28 @@ button.PAG_DARK:hover, .PAG_CUR_DARK {background-color:#707070;}
|
|||
.LC_DEG {text-align:left; vertical-align:top; min-width:150px; max-width:150px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
.LC_ACT {text-align:left; vertical-align:top; min-width:200px; max-width:200px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
|
||||
/*********************** Listing my courses as a tree ************************/
|
||||
@media only screen and (max-width: 800px)
|
||||
{ /* For mobile-phones */
|
||||
.MY_CRS_TXT
|
||||
{
|
||||
display:inline-block;
|
||||
text-align:left;
|
||||
vertical-align:middle;
|
||||
max-width:120px;
|
||||
overflow:hidden;
|
||||
}
|
||||
}
|
||||
@media only screen and (min-width: 800px)
|
||||
{ /* For tablets and desktop */
|
||||
.MY_CRS_TXT
|
||||
{
|
||||
display:inline-block;
|
||||
text-align:left;
|
||||
vertical-align:middle;
|
||||
}
|
||||
}
|
||||
|
||||
/********************************** Privacy **********************************/
|
||||
.PRI_LIST
|
||||
{
|
12
swad_API.c
12
swad_API.c
|
@ -936,7 +936,7 @@ int swad__loginBySessionKey (struct soap *soap,
|
|||
DB_FreeMySQLResult (&mysql_res);
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
if (UsrFound)
|
||||
{
|
||||
|
@ -1594,7 +1594,7 @@ int swad__getUsers (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Check requested users' role *****/
|
||||
if (userRole != API_ROLE_STUDENT && // Students
|
||||
|
@ -1678,7 +1678,7 @@ int swad__findUsers (struct soap *soap,
|
|||
|
||||
if (Gbl.Hierarchy.Level == Hie_CRS)
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Check requested users' role *****/
|
||||
if (userRole < API_ROLE_UNKNOWN ||
|
||||
|
@ -3360,7 +3360,7 @@ int swad__sendNotice (struct soap *soap,
|
|||
return ReturnCode;
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Check if I am a teacher *****/
|
||||
if (Gbl.Usrs.Me.UsrDat.Roles.InCurrentCrs != Rol_TCH)
|
||||
|
@ -3430,7 +3430,7 @@ int swad__getTestConfig (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Set default result to empty *****/
|
||||
getTestConfigOut->numQuestions =
|
||||
|
@ -3524,7 +3524,7 @@ int swad__getTests (struct soap *soap,
|
|||
"Requester must belong to course");
|
||||
|
||||
/***** Get degree of current course *****/
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetCurrentDegCodFromCurrentCrsCod ();
|
||||
Gbl.Hierarchy.Node[Hie_DEG].HieCod = Crs_DB_GetDegCodOfCourseByCod (Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Set default result to empty *****/
|
||||
getTestsOut->tagsArray.__size = 0;
|
||||
|
|
|
@ -1342,7 +1342,7 @@ void HTM_INPUT_PASSWORD (const char *Name,const char *PlaceHolder,
|
|||
int NumBytesPrinted;
|
||||
char *Attr;
|
||||
|
||||
HTM_TxtF ("<input type=\"password\" name=\"%s\" size=\"18\" maxlength=\"%u\"",
|
||||
HTM_TxtF ("<input type=\"password\" name=\"%s\" size=\"16\" maxlength=\"%u\"",
|
||||
Name,Pwd_MAX_CHARS_PLAIN_PASSWORD);
|
||||
if (PlaceHolder)
|
||||
if (PlaceHolder[0])
|
||||
|
|
|
@ -643,7 +643,7 @@ static void ID_ShowFormChangeUsrID (Usr_MeOrOther_t MeOrOther,bool IShouldFillIn
|
|||
UsrDat[MeOrOther]->IDs.Num ? UsrDat[MeOrOther]->IDs.List[UsrDat[MeOrOther]->IDs.Num - 1].ID :
|
||||
"", // Show the most recent ID
|
||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"id=\"NewID\" class=\"INPUT_%s\" size=\"18\"",
|
||||
"id=\"NewID\" class=\"INPUT_%s\" size=\"16\"",
|
||||
The_GetSuffix ());
|
||||
HTM_BR ();
|
||||
Btn_PutCreateButtonInline (Txt_Add_this_ID);
|
||||
|
|
|
@ -168,7 +168,7 @@ static void Acc_ShowFormCheckIfIHaveAccount (const char *Title)
|
|||
HTM_TxtColonNBSP (Txt_ID);
|
||||
HTM_INPUT_TEXT ("ID",ID_MAX_CHARS_USR_ID,"",
|
||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"size=\"18\" class=\"INPUT_%s\" required=\"required\"",
|
||||
"size=\"16\" class=\"INPUT_%s\" required=\"required\"",
|
||||
The_GetSuffix ());
|
||||
HTM_LABEL_End ();
|
||||
Btn_PutCreateButtonInline (Txt_Check);
|
||||
|
@ -397,7 +397,7 @@ static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr
|
|||
NewNickWithArr[0] = '\0';
|
||||
HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA,
|
||||
NewNickWithArr,HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"id=\"NewNick\" size=\"18\" placeholder=\"%s\""
|
||||
"id=\"NewNick\" size=\"16\" placeholder=\"%s\""
|
||||
" class=\"INPUT_%s\" required=\"required\"",
|
||||
Txt_HELP_nickname,
|
||||
The_GetSuffix ());
|
||||
|
@ -416,7 +416,7 @@ static void Acc_ShowFormRequestNewAccountWithPars (const char *NewNickWithoutArr
|
|||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,NewEmail,
|
||||
"id=\"NewEmail\" size=\"18\" placeholder=\"%s\""
|
||||
"id=\"NewEmail\" size=\"16\" placeholder=\"%s\""
|
||||
" class=\"INPUT_%s\" required=\"required\"",
|
||||
Txt_HELP_email,
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -82,7 +82,8 @@ static void CtrCfg_Map (const struct Map_Coordinates *Coord);
|
|||
static void CtrCfg_Latitude (double Latitude);
|
||||
static void CtrCfg_Longitude (double Longitude);
|
||||
static void CtrCfg_Altitude (double Altitude);
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool PutLink,
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,
|
||||
Frm_PutForm_t PutForm,Hie_PutLink_t PutLink,
|
||||
const char PathPhoto[PATH_MAX + 1]);
|
||||
static void CtrCfg_GetPhotoAttr (long CtrCod,char **PhotoAttribution);
|
||||
static void CtrCfg_FreePhotoAttr (char **PhotoAttribution);
|
||||
|
@ -126,7 +127,7 @@ static void CtrCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
{
|
||||
extern const char *Hlp_CENTER_Information;
|
||||
struct Map_Coordinates Coord;
|
||||
bool PutLink;
|
||||
Hie_PutLink_t PutLink;
|
||||
Frm_PutForm_t PutFormIns;
|
||||
Frm_PutForm_t PutFormName;
|
||||
Frm_PutForm_t PutFormPlc;
|
||||
|
@ -145,7 +146,9 @@ static void CtrCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
Ctr_GetCoordByCod (Gbl.Hierarchy.Node[Hie_CTR].HieCod,&Coord);
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTR].WWW[0];
|
||||
PutLink = (ViewType == Vie_VIEW &&
|
||||
Gbl.Hierarchy.Node[Hie_CTR].WWW[0]) ? Hie_PUT_LINK :
|
||||
Hie_DONT_PUT_LINK;
|
||||
PutFormIns = (ViewType == Vie_VIEW &&
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM :
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
@ -427,7 +430,8 @@ static void CtrCfg_Altitude (double Altitude)
|
|||
/***************************** Draw center photo *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool PutLink,
|
||||
static void CtrCfg_Photo (Vie_ViewType_t ViewType,
|
||||
Frm_PutForm_t PutForm,Hie_PutLink_t PutLink,
|
||||
const char PathPhoto[PATH_MAX + 1])
|
||||
{
|
||||
char *PhotoAttribution = NULL;
|
||||
|
@ -445,7 +449,7 @@ static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool Put
|
|||
|
||||
/***** Photo image *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",
|
||||
Gbl.Hierarchy.Node[Hie_CTR].WWW);
|
||||
if (asprintf (&URL,"%s/%02u/%u",
|
||||
|
@ -461,7 +465,7 @@ static void CtrCfg_Photo (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,bool Put
|
|||
"CENTER_PHOTO_PRINT CENTER_PHOTO_WIDTH");
|
||||
free (Icon);
|
||||
free (URL);
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
|
|
|
@ -633,10 +633,12 @@ Me sale este error, no s
|
|||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.44.3 (2023-11-06)"
|
||||
#define CSS_FILE "swad23.35.1.css"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.45 (2023-11-07)"
|
||||
#define CSS_FILE "swad23.45.css"
|
||||
#define JS_FILE "swad22.49.js"
|
||||
/*
|
||||
Version 23.45: Nov 07, 2023 Improvements in responsive design. (335468 lines)
|
||||
Version 23.44.4: Nov 06, 2023 Code refactoring in hierarchy. (335412 lines)
|
||||
Version 23.44.3: Nov 06, 2023 Code refactoring in hierarchy. (335391 lines)
|
||||
Version 23.44.2: Nov 06, 2023 Code refactoring in hierarchy. (335532 lines)
|
||||
Version 23.44.1: Nov 06, 2023 Code refactoring in hierarchy. (335538 lines)
|
||||
|
|
|
@ -60,11 +60,11 @@ extern struct Globals Gbl;
|
|||
|
||||
static void CtyCfg_Configuration (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args);
|
||||
static void CtyCfg_Title (bool PutLink);
|
||||
static void CtyCfg_Title (Hie_PutLink_t PutLink);
|
||||
static void CtyCfg_Map (void);
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink);
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,Hie_PutLink_t PutLink);
|
||||
static void CtyCfg_Platform (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_Name (bool PutLink);
|
||||
static void CtyCfg_Name (Hie_PutLink_t PutLink);
|
||||
static void CtyCfg_Shortcut (Vie_ViewType_t ViewType);
|
||||
static void CtyCfg_QR (void);
|
||||
static void CtyCfg_NumUsrs (void);
|
||||
|
@ -103,7 +103,7 @@ void CtyCfg_PrintConfiguration (void)
|
|||
static void CtyCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_COUNTRY_Information;
|
||||
bool PutLink;
|
||||
Hie_PutLink_t PutLink;
|
||||
bool MapImageExists;
|
||||
unsigned NumCtrs;
|
||||
unsigned NumCtrsWithMap;
|
||||
|
@ -113,7 +113,9 @@ static void CtyCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_CTY].WWW[0];
|
||||
PutLink = (ViewType == Vie_VIEW &&
|
||||
Gbl.Hierarchy.Node[Hie_CTY].WWW[0]) ? Hie_PUT_LINK :
|
||||
Hie_DONT_PUT_LINK;
|
||||
|
||||
/***** Begin box *****/
|
||||
Box_BoxBegin (NULL,NULL,
|
||||
|
@ -221,14 +223,14 @@ static void CtyCfg_PutIconToPrint (__attribute__((unused)) void *Args)
|
|||
/******************** Show title in country configuration ********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Title (bool PutLink)
|
||||
static void CtyCfg_Title (Hie_PutLink_t PutLink)
|
||||
{
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
||||
/* Begin link */
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
|
||||
" class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
||||
Gbl.Hierarchy.Node[Hie_CTY].WWW,
|
||||
|
@ -239,7 +241,7 @@ static void CtyCfg_Title (bool PutLink)
|
|||
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName);
|
||||
|
||||
/* End link */
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_End ();
|
||||
|
||||
/***** End container *****/
|
||||
|
@ -322,7 +324,7 @@ static void CtyCfg_Map (void)
|
|||
/************* Show country map image in country configuration ***************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink)
|
||||
static void CtyCfg_MapImage (Vie_ViewType_t ViewType,Hie_PutLink_t PutLink)
|
||||
{
|
||||
char *MapAttribution = NULL;
|
||||
|
||||
|
@ -331,13 +333,13 @@ static void CtyCfg_MapImage (Vie_ViewType_t ViewType,bool PutLink)
|
|||
|
||||
/***** Map image *****/
|
||||
HTM_DIV_Begin ("class=\"CM\"");
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",
|
||||
Gbl.Hierarchy.Node[Hie_CTY].WWW);
|
||||
Cty_DrawCountryMap (&Gbl.Hierarchy.Node[Hie_CTY],
|
||||
ViewType == Vie_VIEW ? "COUNTRY_MAP_SHOW" :
|
||||
"COUNTRY_MAP_PRINT");
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_End ();
|
||||
HTM_DIV_End ();
|
||||
|
||||
|
@ -406,7 +408,7 @@ static void CtyCfg_Platform (Vie_ViewType_t ViewType)
|
|||
/**************** Show country name in country configuration *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void CtyCfg_Name (bool PutLink)
|
||||
static void CtyCfg_Name (Hie_PutLink_t PutLink)
|
||||
{
|
||||
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
|
||||
|
||||
|
@ -418,12 +420,12 @@ static void CtyCfg_Name (bool PutLink)
|
|||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LB DAT_STRONG_%s\"",The_GetSuffix ());
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"DAT_STRONG_%s\"",
|
||||
Gbl.Hierarchy.Node[Hie_CTY].WWW,
|
||||
The_GetSuffix ());
|
||||
HTM_Txt (Gbl.Hierarchy.Node[Hie_CTY].FullName);
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
|
|
|
@ -152,6 +152,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
{
|
||||
extern const char *Hlp_PROFILE_Courses;
|
||||
extern const char *Par_CodeStr[];
|
||||
extern ParCod_Param_t Hie_ParCod[Hie_NUM_LEVELS];
|
||||
extern const char *Txt_My_courses;
|
||||
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
|
||||
struct Hie_Node Hie[Hie_NUM_LEVELS];
|
||||
|
@ -189,7 +190,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[1] = true;
|
||||
Lay_IndentDependingOnLevel (1,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
Par_PutParLong (NULL,Par_CodeStr[ParCod_Cty],-1L);
|
||||
Par_PutParLong (NULL,Par_CodeStr[Hie_ParCod[Hie_CTY]],-1L);
|
||||
HTM_BUTTON_Submit_Begin (Txt_HIERARCHY_SINGUL_Abc[Hie_SYS],
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -221,7 +222,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[2] = (NumCty == NumCtys - 1);
|
||||
Lay_IndentDependingOnLevel (2,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
ParCod_PutPar (ParCod_Cty,Hie[Hie_CTY].HieCod);
|
||||
ParCod_PutPar (Hie_ParCod[Hie_CTY],Hie[Hie_CTY].HieCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtyInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -254,7 +255,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[3] = (NumIns == NumInss - 1);
|
||||
Lay_IndentDependingOnLevel (3,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
ParCod_PutPar (ParCod_Ins,Hie[Hie_INS].HieCod);
|
||||
ParCod_PutPar (Hie_ParCod[Hie_INS],Hie[Hie_INS].HieCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeInsInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -289,7 +290,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[4] = (NumCtr == NumCtrs - 1);
|
||||
Lay_IndentDependingOnLevel (4,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
ParCod_PutPar (ParCod_Ctr,Hie[Hie_CTR].HieCod);
|
||||
ParCod_PutPar (Hie_ParCod[Hie_CTR],Hie[Hie_CTR].HieCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeCtrInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -324,7 +325,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[5] = (NumDeg == NumDegs - 1);
|
||||
Lay_IndentDependingOnLevel (5,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
ParCod_PutPar (ParCod_Deg,Hie[Hie_DEG].HieCod);
|
||||
ParCod_PutPar (Hie_ParCod[Hie_DEG],Hie[Hie_DEG].HieCod);
|
||||
HTM_BUTTON_Submit_Begin (Act_GetActionText (ActSeeDegInf),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
@ -361,13 +362,19 @@ static void Crs_WriteListMyCoursesToSelectOne (void)
|
|||
IsLastItemInLevel[6] = (NumCrs == NumCrss - 1);
|
||||
Lay_IndentDependingOnLevel (6,IsLastItemInLevel);
|
||||
Frm_BeginForm (ActMyCrs);
|
||||
ParCod_PutPar (ParCod_Crs,Hie[Hie_CRS].HieCod);
|
||||
ParCod_PutPar (Hie_ParCod[Hie_CRS],Hie[Hie_CRS].HieCod);
|
||||
HTM_BUTTON_Submit_Begin (Str_BuildGoToTitle (Hie[Hie_CRS].ShrtName),
|
||||
"class=\"BT_LINK FORM_IN_%s\"",
|
||||
The_GetSuffix ());
|
||||
Str_FreeGoToTitle ();
|
||||
Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,Hie[Hie_CRS].FullName,"ICO16x16");
|
||||
HTM_TxtF (" %s",Hie[Hie_CRS].ShrtName);
|
||||
// Ico_PutIcon ("chalkboard-teacher.svg",Ico_BLACK,Hie[Hie_CRS].FullName,"ICO16x16");
|
||||
Lgo_DrawLogo (Hie_CRS,
|
||||
Hie[Hie_CRS].HieCod,
|
||||
Hie[Hie_CRS].ShrtName,
|
||||
16,NULL);
|
||||
HTM_DIV_Begin ("class=\"MY_CRS_TXT\"");
|
||||
HTM_TxtF (" %s",Hie[Hie_CRS].ShrtName);
|
||||
HTM_DIV_End ();
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ static void CrsCfg_Indicators (void);
|
|||
void CrsCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_COURSE_Information;
|
||||
bool PutLink;
|
||||
Hie_PutLink_t PutLink;
|
||||
Frm_PutForm_t PutFormDeg;
|
||||
Frm_PutForm_t PutFormName;
|
||||
Frm_PutForm_t PutFormYear;
|
||||
|
@ -88,7 +88,9 @@ void CrsCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutLink = (ViewType == Vie_VIEW &&
|
||||
Gbl.Hierarchy.Node[Hie_DEG].WWW[0]) ? Hie_PUT_LINK :
|
||||
Hie_DONT_PUT_LINK;
|
||||
PutFormDeg = (ViewType == Vie_VIEW &&
|
||||
Gbl.Usrs.Me.Role.Logged >= Rol_CTR_ADM) ? Frm_PUT_FORM :
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
@ -380,7 +382,7 @@ static void CrsCfg_InstitutionalCode (Frm_PutForm_t PutForm)
|
|||
HTM_INPUT_TEXT ("InsCrsCod",Hie_MAX_CHARS_INSTITUTIONAL_COD,
|
||||
Gbl.Hierarchy.Node[Hie_CRS].InstitutionalCod,
|
||||
HTM_SUBMIT_ON_CHANGE,
|
||||
"id=\"InsCrsCod\" size=\"%u\""
|
||||
"id=\"InsCrsCod\" maxlength=\"%u\""
|
||||
" class=\"INPUT_INS_CODE INPUT_%s\"",
|
||||
Hie_MAX_CHARS_INSTITUTIONAL_COD,
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -144,16 +144,21 @@ unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Get degree code from course code **********************/
|
||||
/************* Get the degree code of a course from its code *****************/
|
||||
/*****************************************************************************/
|
||||
|
||||
long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void)
|
||||
long Crs_DB_GetDegCodOfCourseByCod (long CrsCod)
|
||||
{
|
||||
/***** Trivial check: course code should be > 0 *****/
|
||||
if (CrsCod <= 0)
|
||||
return -1L;
|
||||
|
||||
/***** Get the degree code of a course from database *****/
|
||||
return DB_QuerySELECTCode ("can not get the degree of a course",
|
||||
"SELECT DegCod"
|
||||
" FROM crs_courses"
|
||||
" WHERE CrsCod=%ld",
|
||||
Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
CrsCod);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -41,7 +41,7 @@ unsigned Crs_DB_GetCrssInDeg (MYSQL_RES **mysql_res,long DegCod);
|
|||
unsigned Crs_DB_GetCrssInCurrentDegBasic (MYSQL_RES **mysql_res);
|
||||
unsigned Crs_DB_GetCrssInCurrentDegFull (MYSQL_RES **mysql_res);
|
||||
unsigned Crs_DB_GetCourseDataByCod (MYSQL_RES **mysql_res,long CrsCod);
|
||||
long Crs_DB_GetCurrentDegCodFromCurrentCrsCod (void);
|
||||
long Crs_DB_GetDegCodOfCourseByCod (long CrsCod);
|
||||
void Crs_DB_GetShortNamesByCod (long CrsCod,
|
||||
char CrsShortName[Nam_MAX_BYTES_SHRT_NAME + 1],
|
||||
char DegShortName[Nam_MAX_BYTES_SHRT_NAME + 1]);
|
||||
|
|
|
@ -95,7 +95,7 @@ void DegCfg_PrintConfiguration (void)
|
|||
static void DegCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_DEGREE_Information;
|
||||
bool PutLink;
|
||||
Hie_PutLink_t PutLink;
|
||||
Frm_PutForm_t PutFormCtr;
|
||||
Frm_PutForm_t PutFormName;
|
||||
Frm_PutForm_t PutFormWWW;
|
||||
|
@ -105,7 +105,9 @@ static void DegCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_DEG].WWW[0];
|
||||
PutLink = (ViewType == Vie_VIEW &&
|
||||
Gbl.Hierarchy.Node[Hie_DEG].WWW[0]) ? Hie_PUT_LINK :
|
||||
Hie_DONT_PUT_LINK;
|
||||
PutFormCtr = (ViewType == Vie_VIEW &&
|
||||
Gbl.Usrs.Me.Role.Logged >= Rol_INS_ADM) ? Frm_PUT_FORM :
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
|
|
@ -351,7 +351,7 @@ void Enr_WriteFormToReqAnotherUsrID (Act_Action_t NextAction,void (*FuncPars) (v
|
|||
/***** Input box to enter user *****/
|
||||
HTM_INPUT_TEXT ("OtherUsrIDNickOrEMail",Cns_MAX_CHARS_EMAIL_ADDRESS,"",
|
||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"id=\"OtherUsrIDNickOrEMail\" size=\"18\""
|
||||
"id=\"OtherUsrIDNickOrEMail\" size=\"16\""
|
||||
" class=\"INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -57,6 +57,19 @@
|
|||
|
||||
extern struct Globals Gbl;
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************************** Public constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
ParCod_Param_t Hie_ParCod[Hie_NUM_LEVELS] =
|
||||
{
|
||||
[Hie_CTY] = ParCod_Cty,
|
||||
[Hie_INS] = ParCod_Ins,
|
||||
[Hie_CTR] = ParCod_Ctr,
|
||||
[Hie_DEG] = ParCod_Deg,
|
||||
[Hie_CRS] = ParCod_Crs,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/**************************** Private constants ******************************/
|
||||
/*****************************************************************************/
|
||||
|
@ -115,14 +128,6 @@ void Hie_WriteMenuHierarchy (void)
|
|||
{
|
||||
extern const char *Par_CodeStr[];
|
||||
extern const char *Txt_HIERARCHY_SINGUL_Abc[Hie_NUM_LEVELS];
|
||||
static const char **Id[Hie_NUM_LEVELS] =
|
||||
{
|
||||
[Hie_CTY] = &Par_CodeStr[ParCod_Cty],
|
||||
[Hie_INS] = &Par_CodeStr[ParCod_Ins],
|
||||
[Hie_CTR] = &Par_CodeStr[ParCod_Ctr],
|
||||
[Hie_DEG] = &Par_CodeStr[ParCod_Deg],
|
||||
[Hie_CRS] = &Par_CodeStr[ParCod_Crs],
|
||||
};
|
||||
static void (*FunctionWriteSelector[Hie_NUM_LEVELS]) (void) =
|
||||
{
|
||||
[Hie_CTY] = Cty_WriteSelectorOfCountry,
|
||||
|
@ -145,7 +150,8 @@ void Hie_WriteMenuHierarchy (void)
|
|||
HTM_TR_Begin (NULL);
|
||||
|
||||
/* Label */
|
||||
Frm_LabelColumn ("RT",*Id[Level],Txt_HIERARCHY_SINGUL_Abc[Level]);
|
||||
Frm_LabelColumn ("RT",Par_CodeStr[Hie_ParCod[Level]],
|
||||
Txt_HIERARCHY_SINGUL_Abc[Level]);
|
||||
|
||||
/* Data */
|
||||
HTM_TD_Begin ("class=\"LT\"");
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include "swad_figure_cache.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hierarchy_config.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_logo.h"
|
||||
#include "swad_QR.h"
|
||||
|
@ -48,17 +49,17 @@ extern struct Globals Gbl;
|
|||
/************************ Show title in configuration ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_Title (bool PutLink,Hie_Level_t Level)
|
||||
void HieCfg_Title (Hie_PutLink_t PutLink,Hie_Level_t Level)
|
||||
{
|
||||
Hie_Level_t LevelLogo = (Level == Hie_CRS) ? Hie_DEG :
|
||||
Level;
|
||||
Level;
|
||||
|
||||
/***** Begin container *****/
|
||||
HTM_DIV_Begin ("class=\"FRAME_TITLE FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
||||
/* Begin link */
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" title=\"%s\""
|
||||
" class=\"FRAME_TITLE_BIG FRAME_TITLE_%s\"",
|
||||
Gbl.Hierarchy.Node[LevelLogo].WWW,
|
||||
|
@ -74,7 +75,7 @@ void HieCfg_Title (bool PutLink,Hie_Level_t Level)
|
|||
HTM_Txt (Gbl.Hierarchy.Node[Level].FullName);
|
||||
|
||||
/* End link */
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
HTM_A_End ();
|
||||
|
||||
/***** End container *****/
|
||||
|
|
|
@ -29,11 +29,21 @@
|
|||
|
||||
#include "swad_parameter_code.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
/************************** Public constants and types ***********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Hie_DONT_PUT_LINK,
|
||||
Hie_PUT_LINK,
|
||||
} Hie_PutLink_t;
|
||||
|
||||
/*****************************************************************************/
|
||||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void HieCfg_Title (bool PutLink,Hie_Level_t LogoScope);
|
||||
void HieCfg_Title (Hie_PutLink_t PutLink,Hie_Level_t Level);
|
||||
void HieCfg_Name (Frm_PutForm_t PutForm,Hie_Level_t Level,
|
||||
Nam_ShrtOrFullName_t ShrtOrFull);
|
||||
void HieCfg_WWW (Vie_ViewType_t ViewType,Frm_PutForm_t PutForm,
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
#include "swad_forum_database.h"
|
||||
#include "swad_global.h"
|
||||
#include "swad_hierarchy.h"
|
||||
#include "swad_hierarchy_config.h"
|
||||
#include "swad_hierarchy_type.h"
|
||||
#include "swad_HTML.h"
|
||||
#include "swad_institution.h"
|
||||
|
@ -207,9 +208,10 @@ void Ins_SeeInsWithPendingCtrs (void)
|
|||
|
||||
void Ins_DrawInstitutionLogoWithLink (struct Hie_Node *Ins,unsigned Size)
|
||||
{
|
||||
bool PutLink = !Frm_CheckIfInside (); // Don't put link to institution if already inside a form
|
||||
Hie_PutLink_t PutLink = Frm_CheckIfInside () ? Hie_DONT_PUT_LINK : // Don't put link to institution if already inside a form
|
||||
Hie_PUT_LINK;
|
||||
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
{
|
||||
Frm_BeginForm (ActSeeInsInf);
|
||||
ParCod_PutPar (ParCod_Ins,Ins->HieCod);
|
||||
|
@ -219,7 +221,7 @@ void Ins_DrawInstitutionLogoWithLink (struct Hie_Node *Ins,unsigned Size)
|
|||
Ins->HieCod,
|
||||
Ins->FullName,
|
||||
Size,NULL);
|
||||
if (PutLink)
|
||||
if (PutLink == Hie_PUT_LINK)
|
||||
{
|
||||
HTM_BUTTON_End ();
|
||||
Frm_EndForm ();
|
||||
|
|
|
@ -104,7 +104,7 @@ void InsCfg_PrintConfiguration (void)
|
|||
static void InsCfg_Configuration (Vie_ViewType_t ViewType)
|
||||
{
|
||||
extern const char *Hlp_INSTITUTION_Information;
|
||||
bool PutLink;
|
||||
Hie_PutLink_t PutLink;
|
||||
Frm_PutForm_t PutFormCty;
|
||||
Frm_PutForm_t PutFormName;
|
||||
Frm_PutForm_t PutFormWWW;
|
||||
|
@ -116,7 +116,9 @@ static void InsCfg_Configuration (Vie_ViewType_t ViewType)
|
|||
return;
|
||||
|
||||
/***** Initializations *****/
|
||||
PutLink = ViewType == Vie_VIEW && Gbl.Hierarchy.Node[Hie_INS].WWW[0];
|
||||
PutLink = (ViewType == Vie_VIEW &&
|
||||
Gbl.Hierarchy.Node[Hie_INS].WWW[0]) ? Hie_PUT_LINK :
|
||||
Hie_DONT_PUT_LINK;
|
||||
PutFormCty =
|
||||
PutFormName = (ViewType == Vie_VIEW &&
|
||||
Gbl.Usrs.Me.Role.Logged == Rol_SYS_ADM) ? Frm_PUT_FORM :
|
||||
|
|
28
swad_logo.c
28
swad_logo.c
|
@ -34,8 +34,9 @@
|
|||
#include "swad_action_list.h"
|
||||
#include "swad_alert.h"
|
||||
#include "swad_box.h"
|
||||
#include "swad_degree_database.h"
|
||||
#include "swad_center_database.h"
|
||||
#include "swad_course_database.h"
|
||||
#include "swad_degree_database.h"
|
||||
#include "swad_error.h"
|
||||
#include "swad_form.h"
|
||||
#include "swad_global.h"
|
||||
|
@ -83,10 +84,11 @@ void Lgo_DrawLogo (Hie_Level_t Level,
|
|||
[Hie_INS] = "university.svg",
|
||||
[Hie_CTR] = "building.svg",
|
||||
[Hie_DEG] = "graduation-cap.svg",
|
||||
[Hie_CRS] = "chalkboard-teacher.svg",
|
||||
};
|
||||
const char *Folder = NULL; // To avoid warning
|
||||
char PathLogo[PATH_MAX + 1];
|
||||
bool LogoFound = false;
|
||||
bool LogoFound;
|
||||
long InsCod;
|
||||
long CtrCod;
|
||||
long DegCod;
|
||||
|
@ -99,11 +101,17 @@ void Lgo_DrawLogo (Hie_Level_t Level,
|
|||
{
|
||||
if (HieCod > 0) // Institution, center or degree exists
|
||||
{
|
||||
/* Course */
|
||||
LogoFound = false;
|
||||
|
||||
/* Degree */
|
||||
if (Level == Hie_DEG)
|
||||
if (!LogoFound && Level >= Hie_DEG)
|
||||
{
|
||||
Folder = Cfg_FOLDER_DEG;
|
||||
DegCod = HieCod;
|
||||
if (Level >= Hie_CRS) // && !LogoFound
|
||||
DegCod = Crs_DB_GetDegCodOfCourseByCod (HieCod);
|
||||
else
|
||||
DegCod = HieCod;
|
||||
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
|
||||
Cfg_PATH_DEG_PUBLIC,
|
||||
(unsigned) (DegCod % 100),
|
||||
|
@ -115,11 +123,11 @@ void Lgo_DrawLogo (Hie_Level_t Level,
|
|||
}
|
||||
|
||||
/* Center */
|
||||
if (!LogoFound && Level != Hie_INS)
|
||||
if (!LogoFound && Level >= Hie_CTR)
|
||||
{
|
||||
Folder = Cfg_FOLDER_CTR;
|
||||
if (Level == Hie_DEG) // && !LogoFound
|
||||
CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (HieCod);
|
||||
if (Level >= Hie_DEG) // && !LogoFound
|
||||
CtrCod = Deg_DB_GetCtrCodOfDegreeByCod (DegCod);
|
||||
else
|
||||
CtrCod = HieCod;
|
||||
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
|
||||
|
@ -136,10 +144,8 @@ void Lgo_DrawLogo (Hie_Level_t Level,
|
|||
if (!LogoFound)
|
||||
{
|
||||
Folder = Cfg_FOLDER_INS;
|
||||
if (Level == Hie_DEG) // && !LogoFound
|
||||
InsCod = Deg_DB_GetInsCodOfDegreeByCod (HieCod);
|
||||
else if (Level == Hie_CTR) // && !LogoFound
|
||||
InsCod = Ctr_DB_GetInsCodOfCenterByCod (HieCod);
|
||||
if (Level >= Hie_CTR) // && !LogoFound
|
||||
InsCod = Ctr_DB_GetInsCodOfCenterByCod (CtrCod);
|
||||
else
|
||||
InsCod = HieCod;
|
||||
snprintf (PathLogo,sizeof (PathLogo),"%s/%02u/%u/logo/%u.png",
|
||||
|
|
|
@ -1239,7 +1239,7 @@ static void Mai_ShowFormChangeUsrEmail (Usr_MeOrOther_t MeOrOther,
|
|||
if (MeOrOther == Usr_OTHER)
|
||||
Usr_PutParUsrCodEncrypted (Gbl.Usrs.Other.UsrDat.EnUsrCod);
|
||||
HTM_INPUT_EMAIL ("NewEmail",Cns_MAX_CHARS_EMAIL_ADDRESS,UsrDat[MeOrOther]->Email,
|
||||
"id=\"NewEmail\" class=\"INPUT_%s\" size=\"18\"",
|
||||
"id=\"NewEmail\" class=\"INPUT_%s\" size=\"16\"",
|
||||
The_GetSuffix ());
|
||||
HTM_BR ();
|
||||
Btn_PutCreateButtonInline (NumEmails ? Txt_Change_email : // User already has an email address
|
||||
|
|
11
swad_media.c
11
swad_media.c
|
@ -1483,7 +1483,6 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
|
|||
[Med_WEBM] = Med_ShowVideo,
|
||||
[Med_OGG ] = Med_ShowVideo,
|
||||
};
|
||||
bool PutLink;
|
||||
char PathMedPriv[PATH_MAX + 1];
|
||||
|
||||
/***** If no media to show ==> nothing to do *****/
|
||||
|
@ -1493,12 +1492,9 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
|
|||
return;
|
||||
|
||||
/***** Begin optional link to external URL *****/
|
||||
PutLink = false;
|
||||
if (Media->URL)
|
||||
if (Media->URL[0])
|
||||
PutLink = true;
|
||||
if (PutLink)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Media->URL);
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Media->URL);
|
||||
|
||||
/***** Build path to private directory with the media *****/
|
||||
snprintf (PathMedPriv,sizeof (PathMedPriv),"%s/%c%c",
|
||||
|
@ -1511,8 +1507,9 @@ static void Med_ShowMediaFile (const struct Med_Media *Media,const char *ClassMe
|
|||
Show[Media->Type] (Media,PathMedPriv,ClassMedia);
|
||||
|
||||
/***** End optional link to external URL *****/
|
||||
if (PutLink)
|
||||
HTM_A_End ();
|
||||
if (Media->URL)
|
||||
if (Media->URL[0])
|
||||
HTM_A_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -315,7 +315,7 @@ static void Nck_ShowFormChangeUsrNickname (Usr_MeOrOther_t MeOrOther,
|
|||
HTM_INPUT_TEXT ("NewNick",1 + Nck_MAX_CHARS_NICK_WITHOUT_ARROBA,
|
||||
NickWithArr,HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"id=\"NewNick\" class=\"INPUT_%s\""
|
||||
" size=\"18\"",
|
||||
" size=\"16\"",
|
||||
The_GetSuffix ());
|
||||
HTM_BR ();
|
||||
Btn_PutCreateButtonInline (NumNicks ? Txt_Change_nickname : // I already have a nickname
|
||||
|
|
|
@ -208,7 +208,7 @@ void Prf_ReqUserProfile (void)
|
|||
Gbl.Usrs.Me.UsrDat.Nickname);
|
||||
HTM_INPUT_TEXT ("usr",sizeof (NickWithArr) - 1,NickWithArr,
|
||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"size=\"18\" class=\"INPUT_%s\""
|
||||
"size=\"16\" class=\"INPUT_%s\""
|
||||
" required=\"required\"",
|
||||
The_GetSuffix ());
|
||||
HTM_LABEL_End ();
|
||||
|
|
|
@ -1647,16 +1647,16 @@ static void Prj_ShowProjectDepartment (const struct Prj_Projects *Projects,
|
|||
const char *ClassData)
|
||||
{
|
||||
struct Dpt_Department Dpt;
|
||||
bool PutLink;
|
||||
bool PutLinkToDpt;
|
||||
|
||||
/***** Get data of department *****/
|
||||
Dpt.DptCod = Projects->Prj.DptCod;
|
||||
Dpt_GetDepartmentDataByCod (&Dpt);
|
||||
|
||||
/***** Show department *****/
|
||||
PutLink = (Dpt.WWW[0] &&
|
||||
(Projects->View == Prj_LIST_PROJECTS ||
|
||||
Projects->View == Prj_VIEW_ONE_PROJECT));
|
||||
PutLinkToDpt = (Dpt.WWW[0] &&
|
||||
(Projects->View == Prj_LIST_PROJECTS ||
|
||||
Projects->View == Prj_VIEW_ONE_PROJECT));
|
||||
|
||||
switch (Projects->View)
|
||||
{
|
||||
|
@ -1669,13 +1669,15 @@ static void Prj_ShowProjectDepartment (const struct Prj_Projects *Projects,
|
|||
ClassData,The_GetSuffix ());
|
||||
break;
|
||||
}
|
||||
if (PutLink)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"%s_%s\"",
|
||||
Dpt.WWW,ClassData,The_GetSuffix ());
|
||||
HTM_Txt (Dpt.FullName);
|
||||
if (PutLink)
|
||||
HTM_A_End ();
|
||||
HTM_TD_End ();
|
||||
|
||||
if (PutLinkToDpt)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\" class=\"%s_%s\"",
|
||||
Dpt.WWW,ClassData,The_GetSuffix ());
|
||||
HTM_Txt (Dpt.FullName);
|
||||
if (PutLinkToDpt)
|
||||
HTM_A_End ();
|
||||
|
||||
HTM_TD_End ();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -2350,9 +2352,9 @@ static void Prj_ShowURL (const struct Prj_Projects *Projects,
|
|||
const char *id,unsigned UniqueId)
|
||||
{
|
||||
extern const char *Txt_URL;
|
||||
bool PutLink = (Projects->Prj.URL[0] &&
|
||||
(Projects->View == Prj_LIST_PROJECTS ||
|
||||
Projects->View == Prj_VIEW_ONE_PROJECT));
|
||||
bool PutLinkToURL = (Projects->Prj.URL[0] &&
|
||||
(Projects->View == Prj_LIST_PROJECTS ||
|
||||
Projects->View == Prj_VIEW_ONE_PROJECT));
|
||||
|
||||
/***** Write row with label and text *****/
|
||||
switch (Projects->View)
|
||||
|
@ -2391,11 +2393,13 @@ static void Prj_ShowURL (const struct Prj_Projects *Projects,
|
|||
ClassData,The_GetSuffix ());
|
||||
break;
|
||||
}
|
||||
if (PutLink)
|
||||
|
||||
if (PutLinkToURL)
|
||||
HTM_A_Begin ("href=\"%s\" target=\"_blank\"",Projects->Prj.URL);
|
||||
HTM_Txt (Projects->Prj.URL);
|
||||
if (PutLink)
|
||||
if (PutLinkToURL)
|
||||
HTM_A_End ();
|
||||
|
||||
HTM_TD_End ();
|
||||
|
||||
HTM_TR_End ();
|
||||
|
|
|
@ -276,7 +276,7 @@ void Sch_PutInputStringToSearch (const char *IdInputText)
|
|||
/***** String to find *****/
|
||||
// Input field not required, because it can be hidden (display:none)
|
||||
HTM_INPUT_SEARCH ("Search",Sch_MAX_CHARS_STRING_TO_FIND,Search->Str,
|
||||
"id=\"%s\" size=\"18\" class=\"INPUT_%s\""
|
||||
"id=\"%s\" size=\"16\" class=\"INPUT_%s\""
|
||||
" placeholder=\"%s…\"",
|
||||
IdInputText,
|
||||
The_GetSuffix (),
|
||||
|
|
|
@ -1179,7 +1179,7 @@ void Usr_WriteFormLogin (Act_Action_t NextAction,void (*FuncPars) (void))
|
|||
HTM_LABEL_End ();
|
||||
HTM_INPUT_TEXT ("UsrId",Cns_MAX_CHARS_EMAIL_ADDRESS,Gbl.Usrs.Me.UsrIdLogin,
|
||||
HTM_DONT_SUBMIT_ON_CHANGE,
|
||||
"id=\"UsrId\" size=\"18\" placeholder=\"%s\""
|
||||
"id=\"UsrId\" size=\"16\" placeholder=\"%s\""
|
||||
" class=\"INPUT_%s\" autofocus=\"autofocus\""
|
||||
" required=\"required\"",
|
||||
Txt_nick_email_or_ID,
|
||||
|
|
Loading…
Reference in New Issue