diff --git a/css/swad17.25.4.css b/css/swad17.25.4.css index 4f1f8788..4bbdefdf 100644 --- a/css/swad17.25.4.css +++ b/css/swad17.25.4.css @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as @@ -2411,19 +2411,31 @@ a:hover img.CENTRE_PHOTO_SHOW } .GAM_PLAY_NUM_QST { - width:15%; + width:10%; float:left; /* position:relative; */ padding-bottom:24pt; color:#808080; font-size:48pt; font-weight:bold; + + // background:pink; } .GAM_PLAY_QST_CONTAINER { - width:85%; + width:80%; float:left; /* position:relative; */ + + // background:blue; + } +.GAM_PLAY_NXT_CONTAINER + { + width:10%; + float:left; + /* position:relative; */ + + // background:grey; } .GAM_PLAY_QST { @@ -2441,7 +2453,7 @@ a:hover img.CENTRE_PHOTO_SHOW } .GAM_PLAY_CONTINUE { - font-size:24pt; + font-size:16pt; } /******************************* Time table **********************************/ diff --git a/js/swad17.17.1.js b/js/swad17.17.1.js index 24d913bd..adba0d22 100644 --- a/js/swad17.17.1.js +++ b/js/swad17.17.1.js @@ -4,7 +4,7 @@ SWAD (Shared Workspace At a Distance), is a web platform developed at the University of Granada (Spain), and used to support university teaching. - Copyright (C) 1999-2017 Antonio Cañas-Vargas + Copyright (C) 1999-2018 Antonio Cañas-Vargas University of Granada (SPAIN) (acanas@ugr.es) This program is free software: you can redistribute it and/or modify diff --git a/swad_ID.c b/swad_ID.c index 5bb562d2..d1269b88 100644 --- a/swad_ID.c +++ b/swad_ID.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -363,7 +363,6 @@ static bool ID_CheckIfUsrIDIsValidUsingMinDigits (const char *UsrID,unsigned Min void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; unsigned NumID; bool ICanSeeUsrID; bool ICanConfirmUsrID; @@ -372,7 +371,7 @@ void ID_WriteUsrIDs (struct UsrData *UsrDat,const char *Anchor) ICanConfirmUsrID = ICanSeeUsrID && (UsrDat->UsrCod != Gbl.Usrs.Me.UsrDat.UsrCod) && // Not me !Gbl.Form.Inside && // Not inside another form - Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB; // Only in main browser tab + Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB; // Only in main browser tab for (NumID = 0; NumID < UsrDat->IDs.Num; @@ -448,7 +447,6 @@ bool ID_ICanSeeOtherUsrIDs (const struct UsrData *UsrDat) static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, const char *Anchor) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *Txt_Confirm_ID; Act_Action_t NextAction; @@ -471,7 +469,7 @@ static void ID_PutLinkToConfirmID (struct UsrData *UsrDat,unsigned NumID, if (Gbl.Action.Original != ActUnk) { Par_PutHiddenParamLong ("OriginalActCod", - Act_Actions[Gbl.Action.Original].ActCod); // Original action, used to know where we came from + Act_GetActCod (Gbl.Action.Original)); // Original action, used to know where we came from switch (Gbl.Action.Original) { case ActSeeRecSevGst: diff --git a/swad_ID.h b/swad_ID.h index f0e0b389..9bdc89ae 100644 --- a/swad_ID.h +++ b/swad_ID.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_MFU.c b/swad_MFU.c index f88fff08..afe9ed63 100644 --- a/swad_MFU.c +++ b/swad_MFU.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as @@ -98,7 +98,6 @@ void MFU_FreeMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxActionsShown) { extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; char Query[512]; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -123,7 +122,7 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc ActCod = Str_ConvertStrCodToLongCod (row[0]); if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD) if ((Action = Act_FromActCodToAction[ActCod]) >= 0) - if (Act_Actions[Action].IndexInMenu >= 0) // MFU actions must be only actions shown on menu (database could contain wrong action numbers) + if (Act_GetIndexInMenu (Action) >= 0) // MFU actions must be only actions shown on menu (database could contain wrong action numbers) if (Act_CheckIfIHavePermissionToExecuteAction (Action)) ListMFUActions->Actions[ListMFUActions->NumActions++] = Action; } @@ -139,7 +138,6 @@ void MFU_GetMFUActions (struct MFU_ListMFUActions *ListMFUActions,unsigned MaxAc Act_Action_t MFU_GetMyLastActionInCurrentTab (void) { extern Act_Action_t Act_FromActCodToAction[1 + Act_MAX_ACTION_COD]; - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; char Query[512]; MYSQL_RES *mysql_res; MYSQL_ROW row; @@ -147,7 +145,6 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void) unsigned NumAct; long ActCod; Act_Action_t Action; - Act_Action_t SuperAction; Act_Action_t MoreRecentActionInCurrentTab = ActUnk; if (Gbl.Usrs.Me.UsrDat.UsrCod > 0) @@ -170,15 +167,12 @@ Act_Action_t MFU_GetMyLastActionInCurrentTab (void) ActCod = Str_ConvertStrCodToLongCod (row[0]); if (ActCod >= 0 && ActCod <= Act_MAX_ACTION_COD) if ((Action = Act_FromActCodToAction[ActCod]) >= 0) - { - SuperAction = Act_Actions[Action].SuperAction; - if (Act_Actions[SuperAction].Tab == Gbl.Action.Tab) + if (Act_GetTab (Act_GetSuperAction (Action)) == Gbl.Action.Tab) if (Act_CheckIfIHavePermissionToExecuteAction (Action)) { MoreRecentActionInCurrentTab = Action; break; } - } } /***** Free structure that stores the query result *****/ @@ -210,14 +204,12 @@ void MFU_ShowMyMFUActions (void) void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Hlp_ANALYTICS_Frequent; extern const char *The_ClassFormNoWrap[The_NUM_THEMES]; extern const char *Txt_My_frequent_actions; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; unsigned NumAct; Act_Action_t Action; - Act_Action_t SuperAction; const char *Title; char TabStr[MFU_MAX_BYTES_TAB + 1]; char MenuStr[MFU_MAX_BYTES_MENU + 1]; @@ -239,8 +231,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) if ((Title = Act_GetTitleAction (Action)) != NULL) { /* Action string */ - SuperAction = Act_Actions[Action].SuperAction; - Str_Copy (TabStr,Txt_TABS_TXT[Act_Actions[SuperAction].Tab], + Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], MFU_MAX_BYTES_TAB); Str_Copy (MenuStr,Title, MFU_MAX_BYTES_MENU); @@ -252,7 +243,7 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) Act_LinkFormSubmit (TabMenuStr,The_ClassFormNoWrap[Gbl.Prefs.Theme],NULL); fprintf (Gbl.F.Out,"\"%s\"", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, - Act_Actions[Action].Icon, + Act_GetIcon (Action), MenuStr); fprintf (Gbl.F.Out," %s",TabMenuStr); Act_FormEnd (); @@ -271,13 +262,11 @@ void MFU_WriteBigMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_My_frequent_actions; extern const char *Txt_Frequent_ACTIONS; extern const char *Txt_TABS_TXT[Tab_NUM_TABS]; unsigned NumAct; Act_Action_t Action; - Act_Action_t SuperAction; const char *Title; char TabStr[MFU_MAX_BYTES_TAB + 1]; char MenuStr[MFU_MAX_BYTES_MENU + 1]; @@ -303,8 +292,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) if ((Title = Act_GetTitleAction (Action)) != NULL) { /* Action string */ - SuperAction = Act_Actions[Action].SuperAction; - Str_Copy (TabStr,Txt_TABS_TXT[Act_Actions[SuperAction].Tab], + Str_Copy (TabStr,Txt_TABS_TXT[Act_GetTab (Act_GetSuperAction (Action))], MFU_MAX_BYTES_TAB); Str_Copy (MenuStr,Title, MFU_MAX_BYTES_MENU); @@ -316,7 +304,7 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) Act_LinkFormSubmit (TabMenuStr,NULL,NULL); fprintf (Gbl.F.Out,"\"%s\"", Gbl.Prefs.PathIconSet,Cfg_ICON_ACTION, - Act_Actions[Action].Icon, + Act_GetIcon (Action), MenuStr); fprintf (Gbl.F.Out," %s",MenuStr); Act_FormEnd (); @@ -340,27 +328,30 @@ void MFU_WriteSmallMFUActions (struct MFU_ListMFUActions *ListMFUActions) void MFU_UpdateMFUActions (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; char Query[1024]; MYSQL_RES *mysql_res; MYSQL_ROW row; float Score; + long ActCod; + Act_Action_t SuperAction; /***** In some cases, don't register action *****/ if (!Gbl.Usrs.Me.Logged) return; - if (Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].IndexInMenu < 0) + if (Act_GetIndexInMenu (Gbl.Action.Act) < 0) return; - if (Act_Actions[Gbl.Action.Act].SuperAction == ActMFUAct) + SuperAction = Act_GetSuperAction (Gbl.Action.Act); + if (SuperAction == ActMFUAct) return; + ActCod = Act_GetActCod (SuperAction); + Str_SetDecimalPointToUS (); // To get the decimal point as a dot /***** Get current score *****/ sprintf (Query,"SELECT Score FROM actions_MFU" " WHERE UsrCod=%ld AND ActCod=%ld", - Gbl.Usrs.Me.UsrDat.UsrCod, - Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod); + Gbl.Usrs.Me.UsrDat.UsrCod,ActCod); if (DB_QuerySELECT (Query,&mysql_res,"can not get score for current action")) { row = mysql_fetch_row (mysql_res); @@ -381,17 +372,14 @@ void MFU_UpdateMFUActions (void) " (UsrCod,ActCod,Score,LastClick)" " VALUES" " (%ld,%ld,'%f',NOW())", - Gbl.Usrs.Me.UsrDat.UsrCod, - Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod, - Score); + Gbl.Usrs.Me.UsrDat.UsrCod,ActCod,Score); DB_QueryREPLACE (Query,"can not update most frequently used actions"); /***** Update score for other actions *****/ sprintf (Query,"UPDATE actions_MFU SET Score=GREATEST(Score*'%f','%f')" " WHERE UsrCod=%ld AND ActCod<>%ld", MFU_DECREASE_FACTOR,MFU_MIN_SCORE, - Gbl.Usrs.Me.UsrDat.UsrCod, - Act_Actions[Act_Actions[Gbl.Action.Act].SuperAction].ActCod); + Gbl.Usrs.Me.UsrDat.UsrCod,ActCod); DB_QueryUPDATE (Query,"can not update most frequently used actions"); Str_SetDecimalPointToLocal (); // Return to local system diff --git a/swad_MFU.h b/swad_MFU.h index d33ee082..e52a6569 100644 --- a/swad_MFU.h +++ b/swad_MFU.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_QR.c b/swad_QR.c index 6d2f0de9..a3f975b3 100644 --- a/swad_QR.c +++ b/swad_QR.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as @@ -147,7 +147,6 @@ void QR_LinkTo (unsigned Size,const char *ParamStr,long Cod) void QR_ExamAnnnouncement (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_Link_to_announcement_of_exam; /***** Show QR code with direct link to the exam announcement *****/ @@ -157,7 +156,7 @@ void QR_ExamAnnnouncement (void) " style=\"width:250px; height:250px;\" />" "", 300,300, - Cfg_URL_SWAD_CGI,Gbl.CurrentCrs.Crs.CrsCod,Act_Actions[ActSeeAllExaAnn].ActCod, + Cfg_URL_SWAD_CGI,Gbl.CurrentCrs.Crs.CrsCod,Act_GetActCod (ActSeeAllExaAnn), Txt_Link_to_announcement_of_exam, Txt_Link_to_announcement_of_exam); } diff --git a/swad_QR.h b/swad_QR.h index 95c9d5d7..0d293149 100644 --- a/swad_QR.h +++ b/swad_QR.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_RSS.c b/swad_RSS.c index 5424b800..da5bc65c 100644 --- a/swad_RSS.c +++ b/swad_RSS.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_RSS.h b/swad_RSS.h index 98a98156..541e08ce 100644 --- a/swad_RSS.h +++ b/swad_RSS.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_account.c b/swad_account.c index b97fe372..cd970746 100644 --- a/swad_account.c +++ b/swad_account.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_account.h b/swad_account.h index 7b0dcb88..c4634708 100644 --- a/swad_account.h +++ b/swad_account.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_action.c b/swad_action.c index b8161efc..fc31f797 100644 --- a/swad_action.c +++ b/swad_action.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -4940,6 +4940,48 @@ Act_Action_t Act_GetActionFromActCod (long ActCod) return ActUnk; } +/*****************************************************************************/ +/****************** Get permanent action code from action ********************/ +/*****************************************************************************/ + +long Act_GetActCod (Act_Action_t Action) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return -1L; + + return Act_Actions[Action].ActCod; + } + +/*****************************************************************************/ +/***************** Get index in menu associated to an action ******************/ +/*****************************************************************************/ + +signed int Act_GetIndexInMenu (Act_Action_t Action) + { + return Act_Actions[Act_GetSuperAction (Action)].IndexInMenu; + } + +/*****************************************************************************/ +/********************* Get tab associated to an action ***********************/ +/*****************************************************************************/ + +Tab_Tab_t Act_GetTab (Act_Action_t Action) + { + return Act_Actions[Act_GetSuperAction (Action)].Tab; + } + +/*****************************************************************************/ +/***************** Get superaction associated to an action *******************/ +/*****************************************************************************/ + +Act_Action_t Act_GetSuperAction (Act_Action_t Action) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return ActUnk; + + return Act_Actions[Action].SuperAction; + } + /*****************************************************************************/ /************* Check if I have permission to execute an action ***************/ /*****************************************************************************/ @@ -4968,6 +5010,66 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action) return Permission & (1 << Gbl.Usrs.Me.Role.Logged); } +/*****************************************************************************/ +/***************** Get content type associated to an action ******************/ +/*****************************************************************************/ + +Act_Content_t Act_GetContentType (Act_Action_t Action) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return Act_CONT_NORM; + + return Act_Actions[Action].ContentType; + } + +/*****************************************************************************/ +/****************** Get browser tab associated to an action ******************/ +/*****************************************************************************/ + +Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return Act_BRW_UNK_TAB; + + return Act_Actions[Action].BrowserTab; + } + +/*****************************************************************************/ +/********* Get pointer to function a priori associated to an action **********/ +/*****************************************************************************/ + +void (*Act_GetFunctionPriori (Act_Action_t Action)) (void) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return NULL; + + return Act_Actions[Action].FunctionPriori; + } + +/*****************************************************************************/ +/******* Get pointer to function a posteriori associated to an action ********/ +/*****************************************************************************/ + +void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return NULL; + + return Act_Actions[Action].FunctionPosteriori; + } + +/*****************************************************************************/ +/********************** Get icon associated to an action *********************/ +/*****************************************************************************/ + +const char *Act_GetIcon (Act_Action_t Action) + { + if (Action < 0 || Action >= Act_NUM_ACTIONS) + return NULL; + + return Act_Actions[Action].Icon; + } + /*****************************************************************************/ /******************* Get the title associated to an action *******************/ /*****************************************************************************/ @@ -4975,13 +5077,11 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action) const char *Act_GetTitleAction (Act_Action_t Action) { extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; - Act_Action_t SuperAction; if (Action < 0 || Action >= Act_NUM_ACTIONS) return NULL; - SuperAction = Act_Actions[Action].SuperAction; - return Txt_MENU_TITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu]; + return Txt_MENU_TITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)]; } /*****************************************************************************/ @@ -4991,13 +5091,11 @@ const char *Act_GetTitleAction (Act_Action_t Action) const char *Act_GetSubtitleAction (Act_Action_t Action) { extern const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB]; - Act_Action_t SuperAction; if (Action < 0 || Action >= Act_NUM_ACTIONS) return NULL; - SuperAction = Act_Actions[Action].SuperAction; - return Txt_MENU_SUBTITLE[Act_Actions[SuperAction].Tab][Act_Actions[SuperAction].IndexInMenu]; + return Txt_MENU_SUBTITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)]; } /*****************************************************************************/ @@ -5104,7 +5202,7 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca if (OnSubmit) if (OnSubmit[0]) fprintf (Gbl.F.Out," onsubmit=\"%s;\"",OnSubmit); - switch (Act_Actions[NextAction].BrowserTab) + switch (Act_GetBrowserTab (NextAction)) { case Act_BRW_NEW_TAB: case Act_DOWNLD_FILE: @@ -5113,7 +5211,7 @@ static void Act_FormStartInternal (Act_Action_t NextAction,bool PutParameterLoca default: break; } - if (Act_Actions[NextAction].ContentType == Act_CONT_DATA) + if (Act_GetContentType (NextAction) == Act_CONT_DATA) fprintf (Gbl.F.Out," enctype=\"multipart/form-data\""); fprintf (Gbl.F.Out," accept-charset=\"windows-1252\">"); @@ -5140,7 +5238,7 @@ void Act_SetParamsForm (char *ParamsStr,Act_Action_t NextAction, if (NextAction != ActUnk) sprintf (ParamAction,"", - Act_Actions[NextAction].ActCod); + Act_GetActCod (NextAction)); if (Gbl.Session.Id[0]) sprintf (ParamSession,"",CtyName); Act_FormEnd (); diff --git a/swad_country.h b/swad_country.h index bddfd8f2..4b62d150 100644 --- a/swad_country.h +++ b/swad_country.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_course.c b/swad_course.c index f31a9d1b..68ab2a69 100644 --- a/swad_course.c +++ b/swad_course.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -510,7 +510,6 @@ static void Crs_ShowNumUsrsInCrs (Rol_Role_t Role) static void Crs_WriteListMyCoursesToSelectOne (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Hlp_PROFILE_Courses; extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassFormDark[The_NUM_THEMES]; @@ -596,7 +595,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (1,IsLastItemInLevel); Act_FormStart (ActMyCrs); Cty_PutParamCtyCod (Cty.CtyCod); - Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtyInf].ActCod,ActTxt), + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtyInf),ActTxt), Highlight ? ClassHighlight : ClassNormal,NULL); /* Country map */ @@ -637,7 +636,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (2,IsLastItemInLevel); Act_FormStart (ActMyCrs); Ins_PutParamInsCod (Ins.InsCod); - Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeInsInf].ActCod,ActTxt), + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeInsInf),ActTxt), Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Sco_SCOPE_INS,Ins.InsCod,Ins.ShrtName,20,NULL,true); @@ -670,7 +669,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (3,IsLastItemInLevel); Act_FormStart (ActMyCrs); Ctr_PutParamCtrCod (Ctr.CtrCod); - Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeCtrInf].ActCod,ActTxt), + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeCtrInf),ActTxt), Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Sco_SCOPE_CTR,Ctr.CtrCod,Ctr.ShrtName,20,NULL,true); @@ -703,7 +702,7 @@ static void Crs_WriteListMyCoursesToSelectOne (void) Lay_IndentDependingOnLevel (4,IsLastItemInLevel); Act_FormStart (ActMyCrs); Deg_PutParamDegCod (Deg.DegCod); - Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[ActSeeDegInf].ActCod,ActTxt), + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (ActSeeDegInf),ActTxt), Highlight ? ClassHighlight : ClassNormal,NULL); Log_DrawLogo (Sco_SCOPE_DEG,Deg.DegCod,Deg.ShrtName,20,NULL,true); diff --git a/swad_course.h b/swad_course.h index d9b057c8..7d820d2d 100644 --- a/swad_course.h +++ b/swad_course.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_cryptography.c b/swad_cryptography.c index 3fc2a045..53beffb4 100644 --- a/swad_cryptography.c +++ b/swad_cryptography.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_cryptography.h b/swad_cryptography.h index b615c9d7..3e9613f6 100644 --- a/swad_cryptography.h +++ b/swad_cryptography.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_database.c b/swad_database.c index 8fb8af89..1787c640 100644 --- a/swad_database.c +++ b/swad_database.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_database.h b/swad_database.h index d61c9831..7d64cce0 100644 --- a/swad_database.h +++ b/swad_database.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_date.c b/swad_date.c index 7d3604f3..447753d7 100644 --- a/swad_date.c +++ b/swad_date.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_date.h b/swad_date.h index 150553a6..d52b9c36 100644 --- a/swad_date.h +++ b/swad_date.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_degree.c b/swad_degree.c index d7d919e4..d5c461b6 100644 --- a/swad_degree.c +++ b/swad_degree.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_degree.h b/swad_degree.h index 9b73fea5..9c8145ea 100644 --- a/swad_degree.h +++ b/swad_degree.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_degree_type.c b/swad_degree_type.c index edb0358f..344af29c 100644 --- a/swad_degree_type.c +++ b/swad_degree_type.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_degree_type.h b/swad_degree_type.h index 4bbf8b45..c62f136a 100644 --- a/swad_degree_type.h +++ b/swad_degree_type.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_department.c b/swad_department.c index 747e2816..ae57fd31 100644 --- a/swad_department.c +++ b/swad_department.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_department.h b/swad_department.h index 3739fb39..b91732ac 100644 --- a/swad_department.h +++ b/swad_department.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_duplicate.c b/swad_duplicate.c index 84d4467d..4af9b8d6 100644 --- a/swad_duplicate.c +++ b/swad_duplicate.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_duplicate.h b/swad_duplicate.h index 5886eab4..3ba930e6 100644 --- a/swad_duplicate.h +++ b/swad_duplicate.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_enrolment.c b/swad_enrolment.c index baec2e69..9d5f8ac3 100644 --- a/swad_enrolment.c +++ b/swad_enrolment.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_enrolment.h b/swad_enrolment.h index d22d338c..84b6d8c7 100644 --- a/swad_enrolment.h +++ b/swad_enrolment.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_exam.h b/swad_exam.h index d654d8f7..2202be6c 100644 --- a/swad_exam.h +++ b/swad_exam.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_file.c b/swad_file.c index a91d6ea0..aa1db9b0 100644 --- a/swad_file.c +++ b/swad_file.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_file.h b/swad_file.h index cddab19b..efb1a94a 100644 --- a/swad_file.h +++ b/swad_file.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_file_browser.c b/swad_file_browser.c index 78c990bc..7553e95e 100644 --- a/swad_file_browser.c +++ b/swad_file_browser.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -8800,7 +8800,6 @@ static void Brw_PutFormToCreateAFolder (const char FileNameToShow[NAME_MAX + 1]) static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_Upload_files; extern const char *Txt_or_you_can_upload_new_files_to_the_folder_X; extern const char *Txt_Select_one_or_more_files_from_your_computer_or_drag_and_drop_here; @@ -8829,7 +8828,7 @@ static void Brw_PutFormToUploadFilesUsingDropzone (const char *FileNameToShow) Cfg_URL_SWAD_CGI, Txt_STR_LANG_ID[Gbl.Prefs.Language], Gbl.Prefs.IconsURL); - Par_PutHiddenParamLong ("act",Act_Actions[Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type]].ActCod); + Par_PutHiddenParamLong ("act",Act_GetActCod (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type])); Par_PutHiddenParamString ("ses",Gbl.Session.Id); Brw_PutParamsFileBrowser (Brw_ActUploadFileDropzone[Gbl.FileBrowser.Type], Gbl.FileBrowser.Priv.PathInTreeUntilFilFolLnk, diff --git a/swad_file_browser.h b/swad_file_browser.h index 500a2339..e47b14b6 100644 --- a/swad_file_browser.h +++ b/swad_file_browser.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_follow.c b/swad_follow.c index 890a6d4c..9a5446fd 100644 --- a/swad_follow.c +++ b/swad_follow.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_follow.h b/swad_follow.h index fd2e62fb..1ccdb090 100644 --- a/swad_follow.h +++ b/swad_follow.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_forum.c b/swad_forum.c index baacf312..38778e71 100644 --- a/swad_forum.c +++ b/swad_forum.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -2059,7 +2059,6 @@ static void For_WriteLinkToForum (struct Forum *Forum, unsigned Level, bool IsLastItemInLevel[1 + For_FORUM_MAX_LEVELS]) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *The_ClassForm[The_NUM_THEMES]; extern const char *The_ClassFormBold[The_NUM_THEMES]; extern const char *Txt_Copy_not_allowed; @@ -2127,7 +2126,7 @@ static void For_WriteLinkToForum (struct Forum *Forum, Forum->Location, -1L, -1L); - Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_Actions[For_ActionsSeeFor[Forum->Type]].ActCod,ActTxt), + Act_LinkFormSubmit (Act_GetActionTextFromDB (Act_GetActCod (For_ActionsSeeFor[Forum->Type]),ActTxt), Style,NULL); For_SetForumName (Forum,ForumName,Gbl.Prefs.Language,true); switch (Forum->Type) diff --git a/swad_forum.h b/swad_forum.h index d1efb666..e9d505fe 100644 --- a/swad_forum.h +++ b/swad_forum.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_game.c b/swad_game.c index 4b1c5b03..803a4e6a 100644 --- a/swad_game.c +++ b/swad_game.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -3608,8 +3608,9 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) fprintf (Gbl.F.Out,"
%u
", QstInd + 1); - /* Write the stem (row[2]) and the image (row[3], row[4], row[5]) */ fprintf (Gbl.F.Out,"
"); + + /* Write the stem (row[2]) and the image (row[3], row[4], row[5]) */ Tst_WriteQstStem (row[2],"GAM_PLAY_QST"); Img_GetImageNameTitleAndURLFromRow (row[3],row[4],row[5],&Gbl.Test.Image); Img_ShowImage (&Gbl.Test.Image, @@ -3630,12 +3631,13 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) Tst_WriteAnswersGameResult (&Game,QstInd,QstCod, "GAM_PLAY_QST",false); // Don't show result } - fprintf (Gbl.F.Out,"
"); + else + fprintf (Gbl.F.Out," "); - /* End container for number and question */ fprintf (Gbl.F.Out,""); /***** Put button to continue *****/ + fprintf (Gbl.F.Out,"
"); if (ShowAnswers) { /* Get index of the next question */ @@ -3647,6 +3649,10 @@ static void Gam_PlayGameShowQuestionAndAnswers (bool ShowAnswers) else /* Put button to show answers */ Gam_PutBigButtonToContinue (ActPlyGamAns,Game.GamCod,QstInd); + fprintf (Gbl.F.Out,"
"); + + /***** End container for question *****/ + fprintf (Gbl.F.Out,""); } /*****************************************************************************/ diff --git a/swad_game.h b/swad_game.h index 045b2c26..21fd03b6 100644 --- a/swad_game.h +++ b/swad_game.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_global.c b/swad_global.c index 2f40f297..41fedeed 100644 --- a/swad_global.c +++ b/swad_global.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -483,12 +483,11 @@ void Gbl_InitializeGlobals (void) void Gbl_Cleanup (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; Rol_Role_t Role; if (!Gbl.Action.UsesAJAX && !Gbl.WebService.IsWebService && - Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB) + Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB) Ses_RemoveHiddenParFromThisSession (); Usr_FreeMyCourses (); Usr_FreeMyDegrees (); diff --git a/swad_global.h b/swad_global.h index 9b1ba5e2..851b8cca 100644 --- a/swad_global.h +++ b/swad_global.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_group.c b/swad_group.c index 361ea297..901466a4 100644 --- a/swad_group.c +++ b/swad_group.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_group.h b/swad_group.h index 69c99f1d..8a43fa15 100644 --- a/swad_group.h +++ b/swad_group.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_help.c b/swad_help.c index 552e8d1c..1145f3e5 100644 --- a/swad_help.c +++ b/swad_help.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_help.h b/swad_help.h index 3be41343..f3ee4e92 100644 --- a/swad_help.h +++ b/swad_help.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_help_URL.c b/swad_help_URL.c index 3928f527..0456e7ba 100644 --- a/swad_help_URL.c +++ b/swad_help_URL.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_hierarchy.c b/swad_hierarchy.c index dbc3cf09..1e866ed8 100644 --- a/swad_hierarchy.c +++ b/swad_hierarchy.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_hierarchy.h b/swad_hierarchy.h index fa219e09..43ccf774 100644 --- a/swad_hierarchy.h +++ b/swad_hierarchy.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_holiday.c b/swad_holiday.c index 8efd4fa7..0797ef6f 100644 --- a/swad_holiday.c +++ b/swad_holiday.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_holiday.h b/swad_holiday.h index e8d8917b..04210016 100644 --- a/swad_holiday.h +++ b/swad_holiday.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_icon.c b/swad_icon.c index cfbceacc..bf0e3029 100644 --- a/swad_icon.c +++ b/swad_icon.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_icon.h b/swad_icon.h index 21c41290..4f769b04 100644 --- a/swad_icon.h +++ b/swad_icon.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_image.c b/swad_image.c index c95eb8ac..10258963 100644 --- a/swad_image.c +++ b/swad_image.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General 3 License as diff --git a/swad_image.h b/swad_image.h index cead624a..c2164482 100644 --- a/swad_image.h +++ b/swad_image.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_indicator.c b/swad_indicator.c index 0e7b09cb..3f6af093 100644 --- a/swad_indicator.c +++ b/swad_indicator.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -682,7 +682,6 @@ static void Ind_ShowNumCoursesWithIndicators (unsigned NumCrssWithIndicatorYes[1 static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t IndicatorsLayout, unsigned NumCrss,MYSQL_RES *mysql_res) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_Degree; extern const char *Txt_Course; extern const char *Txt_Institutional_BR_code; @@ -715,6 +714,7 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat unsigned NumStds; unsigned NumIndicators; struct Ind_IndicatorsCrs Indicators; + long ActCod; /***** Start table *****/ fprintf (Gbl.F.Out,""); @@ -1003,6 +1003,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat /* The number of indicators may have changed */ if (Gbl.Stat.IndicatorsSelected[Indicators.NumIndicators]) { + ActCod = Act_GetActCod (ActReqStaCrs); + /* Write a row for this course */ switch (IndicatorsLayout) { @@ -1077,8 +1079,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat "DAT_SMALL_RED"), Gbl.RowEvenOdd, row[3], - Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,ActCod, + Cfg_URL_SWAD_CGI,CrsCod,ActCod, Indicators.CourseAllOK ? "DAT_SMALL_GREEN" : (Indicators.CoursePartiallyOK ? "DAT_SMALL" : @@ -1243,8 +1245,8 @@ static void Ind_ShowTableOfCoursesWithIndicators (Ind_IndicatorsLayout_t Indicat "DAT_SMALL_RED"), Gbl.RowEvenOdd, row[3], - Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, - Cfg_URL_SWAD_CGI,CrsCod,Act_Actions[ActReqStaCrs].ActCod, + Gbl.RowEvenOdd,Cfg_URL_SWAD_CGI,CrsCod,ActCod, + Cfg_URL_SWAD_CGI,CrsCod,ActCod, NumTchs != 0 ? "DAT_SMALL_GREEN" : "DAT_SMALL_RED", diff --git a/swad_indicator.h b/swad_indicator.h index 9ddc267d..61986692 100644 --- a/swad_indicator.h +++ b/swad_indicator.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_info.c b/swad_info.c index 3b5fe757..a7cfea9e 100644 --- a/swad_info.c +++ b/swad_info.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_info.h b/swad_info.h index 818fd47a..9f4602ee 100644 --- a/swad_info.h +++ b/swad_info.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_institution.c b/swad_institution.c index 67091cd4..02ecd0be 100644 --- a/swad_institution.c +++ b/swad_institution.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_institution.h b/swad_institution.h index b60e99ce..6f6381cb 100644 --- a/swad_institution.h +++ b/swad_institution.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_language.c b/swad_language.c index 3b49c345..0f2605c2 100644 --- a/swad_language.c +++ b/swad_language.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_language.h b/swad_language.h index 74141dfe..e68b1f70 100644 --- a/swad_language.h +++ b/swad_language.h @@ -8,7 +8,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as diff --git a/swad_layout.c b/swad_layout.c index 04d31119..fa66afd8 100644 --- a/swad_layout.c +++ b/swad_layout.c @@ -6,7 +6,7 @@ and used to support university teaching. This file is part of SWAD core. - Copyright (C) 1999-2017 Antonio Cañas Vargas + Copyright (C) 1999-2018 Antonio Cañas Vargas This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as @@ -107,7 +107,6 @@ static void Lay_HelpTextEditor (const char *Text,const char *InlineMath,const ch void Lay_WriteStartOfPage (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; extern const unsigned Txt_Current_CGI_SWAD_Language; extern const char *The_TabOnBgColors[The_NUM_THEMES]; @@ -252,7 +251,7 @@ void Lay_WriteStartOfPage (void) fprintf (Gbl.F.Out,"\n"); /***** HTML body *****/ - if (Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB) + if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB) fprintf (Gbl.F.Out,"\n" "
" "= 0) + Act_GetIndexInMenu (Gbl.Action.Act) >= 0) Lay_WriteTitleAction (); Gbl.Layout.WritingHTMLStart = false; @@ -389,8 +388,6 @@ void Lay_WriteHTTPStatus204NoContent (void) static void Lay_WriteEndOfPage (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; - if (!Gbl.Layout.DivsEndWritten) { /***** End of central part of main zone *****/ @@ -399,7 +396,7 @@ static void Lay_WriteEndOfPage (void) "
"); // main_zone_central_container /***** Write page footer *****/ - if (Act_Actions[Gbl.Action.Act].BrowserTab == Act_BRW_1ST_TAB) + if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB) Lay_WriteFootFromHTMLFile (); /***** End of main zone and page *****/ @@ -443,27 +440,25 @@ static void Lay_WritePageTitle (void) static void Lay_WriteRedirToMyLangOnLogIn (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; fprintf (Gbl.F.Out,"", Cfg_URL_SWAD_CGI, Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], - Act_Actions[ActLogInLan].ActCod, + Act_GetActCod (ActLogInLan), Gbl.Session.Id); } static void Lay_WriteRedirToMyLangOnViewUsrAgd (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_STR_LANG_ID[1 + Txt_NUM_LANGUAGES]; fprintf (Gbl.F.Out,"", Cfg_URL_SWAD_CGI, Txt_STR_LANG_ID[Gbl.Usrs.Me.UsrDat.Prefs.Language], - Act_Actions[ActLogInUsrAgdLan].ActCod, + Act_GetActCod (ActLogInUsrAgdLan), Gbl.Session.Id, Gbl.Usrs.Other.UsrDat.Nickname); } @@ -474,7 +469,6 @@ static void Lay_WriteRedirToMyLangOnViewUsrAgd (void) static void Lay_WriteScripts (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; extern const char *Txt_DAYS_CAPS[7]; extern const char *Txt_DAYS_SMALL[7]; extern const char *Txt_Exam_of_X; @@ -724,18 +718,16 @@ static void Lay_WriteScriptInit (void) static void Lay_WriteScriptParamsAJAX (void) { - extern struct Act_Actions Act_Actions[Act_NUM_ACTIONS]; - /***** Start script *****/ fprintf (Gbl.F.Out,"