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,"", 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,"", 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,"