mirror of https://github.com/acanas/swad-core.git
Compare commits
3 Commits
fdd2d2b550
...
e84bf1b504
Author | SHA1 | Date |
---|---|---|
acanas | e84bf1b504 | |
acanas | 24e0aa519d | |
acanas | 14f2653119 |
|
@ -5,7 +5,7 @@
|
|||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuildCommandParser" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser" keep-relative-paths="false" name="CDT GCC Build Output Parser" parameter="(g?cc)|([gc]\+\+)|(clang)" prefer-non-shared="true"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="1458321346374226041" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-823415816682434587" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
|
|
@ -312,7 +312,7 @@ void ID_WriteUsrIDs (struct Usr_Data *UsrDat,const char *Anchor)
|
|||
bool ICanConfirmUsrID = ICanSeeUsrID &&
|
||||
Usr_ItsMe (UsrDat->UsrCod) == Usr_OTHER && // Not me
|
||||
!Frm_CheckIfInside () && // Not inside another form
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB; // Only in main browser tab
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB; // Only in main browser tab
|
||||
|
||||
for (NumID = 0;
|
||||
NumID < UsrDat->IDs.Num;
|
||||
|
|
|
@ -316,10 +316,10 @@ static void MFU_PutIconAndText (Act_Action_t Action,
|
|||
snprintf (URLIconSet,sizeof (URLIconSet),"%s/%s",
|
||||
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet]);
|
||||
if (Color[Gbl.Prefs.IconSet] == Ico_UNCHANGED)
|
||||
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
|
||||
HTM_IMG (URLIconSet,Act_GetIconFromAction (Action),MenuStr,
|
||||
NULL);
|
||||
else
|
||||
HTM_IMG (URLIconSet,Act_GetIcon (Action),MenuStr,
|
||||
HTM_IMG (URLIconSet,Act_GetIconFromAction (Action),MenuStr,
|
||||
"class=\"ICO_%s_%s\"",
|
||||
Ico_GetPreffix (Color[Gbl.Prefs.IconSet]),
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -59,7 +59,7 @@ Act_Action_t Act_GetActionFromActCod (long ActCod)
|
|||
|
||||
long Act_GetActCod (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return -1L;
|
||||
|
||||
return ActLst_Actions[Action].ActCod;
|
||||
|
@ -89,7 +89,7 @@ Tab_Tab_t Act_GetTab (Act_Action_t Action)
|
|||
|
||||
Act_Action_t Act_GetSuperAction (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return ActUnk;
|
||||
|
||||
return ActLst_Actions[Action].SuperAction;
|
||||
|
@ -103,7 +103,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
|
|||
{
|
||||
unsigned Permission;
|
||||
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return false;
|
||||
|
||||
switch (Gbl.Hierarchy.Level)
|
||||
|
@ -140,7 +140,7 @@ bool Act_CheckIfIHavePermissionToExecuteAction (Act_Action_t Action)
|
|||
|
||||
Act_Content_t Act_GetContentType (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return Act_CONT_NORM;
|
||||
|
||||
return ActLst_Actions[Action].ContentType;
|
||||
|
@ -152,8 +152,8 @@ Act_Content_t Act_GetContentType (Act_Action_t Action)
|
|||
|
||||
Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
return Act_BRW_UNK_TAB;
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return Act_UNK_TAB;
|
||||
|
||||
return ActLst_Actions[Action].BrowserTab;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action)
|
|||
|
||||
void (*Act_GetFunctionPriori (Act_Action_t Action)) (void)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return ActLst_Actions[Action].FunctionPriori;
|
||||
|
@ -176,7 +176,7 @@ void (*Act_GetFunctionPriori (Act_Action_t Action)) (void)
|
|||
|
||||
void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return ActLst_Actions[Action].FunctionPosteriori;
|
||||
|
@ -186,12 +186,12 @@ void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void)
|
|||
/********************** Get icon associated to an action *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *Act_GetIcon (Act_Action_t Action)
|
||||
const char *Act_GetIconFromAction (Act_Action_t Action)
|
||||
{
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return Ico_GetIcon (ActLst_Actions[Action].Icon);
|
||||
return Ico_GetIcon (Mnu_GetIconFromAction (Action));
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -202,7 +202,7 @@ const char *Act_GetTitleAction (Act_Action_t Action)
|
|||
{
|
||||
extern const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB];
|
||||
|
||||
if (Action < 0 || Action >= ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action >= ActLst_NUM_ACTIONS)
|
||||
return NULL;
|
||||
|
||||
return Txt_MENU_TITLE[Act_GetTab (Action)][Act_GetIndexInMenu (Action)];
|
||||
|
@ -216,7 +216,7 @@ const char *Act_GetActionText (Act_Action_t Action)
|
|||
{
|
||||
extern const char *Txt_Actions[ActLst_NUM_ACTIONS];
|
||||
|
||||
if (Action >= 0 && Action < ActLst_NUM_ACTIONS)
|
||||
if ((unsigned) Action < ActLst_NUM_ACTIONS)
|
||||
if (Txt_Actions[Action])
|
||||
if (Txt_Actions[Action][0])
|
||||
return Txt_Actions[Action];
|
||||
|
@ -242,7 +242,7 @@ void Act_AdjustActionWhenNoUsrLogged (void)
|
|||
};
|
||||
|
||||
if (Gbl.Hierarchy.Level >= Hie_NUM_LEVELS)
|
||||
Gbl.Hierarchy.Level = ActUnk;
|
||||
Gbl.Hierarchy.Level = Hie_UNK;
|
||||
|
||||
Gbl.Action.Act = Actions[Gbl.Hierarchy.Level];
|
||||
Tab_SetCurrentTab ();
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include <stdbool.h> // For boolean type
|
||||
|
||||
#include "swad_action_list.h"
|
||||
#include "swad_constant.h"
|
||||
#include "swad_cryptography.h"
|
||||
#include "swad_language.h"
|
||||
|
@ -57,20 +58,18 @@ typedef enum
|
|||
|
||||
typedef enum
|
||||
{
|
||||
Act_BRW_UNK_TAB, // Unknown tab
|
||||
Act_BRW_1ST_TAB, // The main (original, first) tab in the browser
|
||||
Act_BRW_NEW_TAB, // A new (second) blank tab in the browser
|
||||
Act_BRW_2ND_TAB, // The second tab in the browser
|
||||
Act_AJAX_NORMAL, // Update a zone of the page using AJAX
|
||||
Act_AJAX_RFRESH, // Update a zone of the page using AJAX, with auto-refresh
|
||||
Act_UPLOAD_FILE, // Upload a file. Do not write HTML content. Write Status code instead for Dropzone.js
|
||||
Act_DOWNLD_FILE, // Download a file in a new tab. Do not write HTML content.
|
||||
Act_204_NO_CONT, // Do not write HTML content. HTTP will return Status 204 No Content
|
||||
Act_WEB_SERVICE, // Web service. Send output to client using SOAP.
|
||||
Act_UNK_TAB, // Unknown tab
|
||||
Act_1ST_TAB, // The main (original, first) tab in the browser
|
||||
Act_NEW_TAB, // A new (second) blank tab in the browser
|
||||
Act_2ND_TAB, // The second tab in the browser
|
||||
Act_AJAX_NR, // Update a zone of the page using AJAX
|
||||
Act_AJAX_RF, // Update a zone of the page using AJAX, with auto-refresh
|
||||
Act_UPL_FIL, // Upload a file. Do not write HTML content. Write Status code instead for Dropzone.js
|
||||
Act_DWN_FIL, // Download a file in a new tab. Do not write HTML content.
|
||||
Act_204_NOC, // Do not write HTML content. HTTP will return Status 204 No Content
|
||||
Act_WEB_SVC, // Web service. Send output to client using SOAP.
|
||||
} Act_BrowserTab_t;
|
||||
|
||||
typedef signed int Act_Action_t; // Must be a signed type, because -1 is used to indicate obsolete action
|
||||
|
||||
struct Act_Actions
|
||||
{
|
||||
long ActCod; // Unique, time-persistent numerical code for the action
|
||||
|
@ -88,7 +87,6 @@ struct Act_Actions
|
|||
Act_BrowserTab_t BrowserTab;
|
||||
void (*FunctionPriori) ();
|
||||
void (*FunctionPosteriori) ();
|
||||
const char *Icon;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -105,7 +103,8 @@ Act_Content_t Act_GetContentType (Act_Action_t Action);
|
|||
Act_BrowserTab_t Act_GetBrowserTab (Act_Action_t Action);
|
||||
void (*Act_GetFunctionPriori (Act_Action_t Action)) (void);
|
||||
void (*Act_GetFunctionPosteriori (Act_Action_t Action)) (void);
|
||||
const char *Act_GetIcon (Act_Action_t Action);
|
||||
|
||||
const char *Act_GetIconFromAction (Act_Action_t Action);
|
||||
|
||||
const char *Act_GetTitleAction (Act_Action_t Action);
|
||||
const char *Act_GetActionText (Act_Action_t Action);
|
||||
|
|
4191
swad_action_list.c
4191
swad_action_list.c
File diff suppressed because it is too large
Load Diff
3222
swad_action_list.h
3222
swad_action_list.h
File diff suppressed because it is too large
Load Diff
|
@ -6683,7 +6683,7 @@ void Brw_RenFolderFileBrowser (void)
|
|||
/****** Receive a new file in a file browser unsigned Dropzone.js ************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Brw_RcvFileInFileBrwDropzone (void)
|
||||
void Brw_RcvFileInFileBrwDZ (void)
|
||||
{
|
||||
bool UploadSucessful;
|
||||
struct BrwSiz_BrowserSize *Size = BrwSiz_GetSize ();
|
||||
|
@ -9720,7 +9720,6 @@ Act_Action_t Brw_GetActionContract (void)
|
|||
return Brw_ActContractFolder[Gbl.FileBrowser.Type];
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************* Show stats about exploration trees ********************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -208,7 +208,7 @@ void Brw_RemSubtreeInFileBrowser (void);
|
|||
void Brw_ShowFormFileBrowser (void);
|
||||
void Brw_RecFolderFileBrowser (void);
|
||||
void Brw_RenFolderFileBrowser (void);
|
||||
void Brw_RcvFileInFileBrwDropzone (void);
|
||||
void Brw_RcvFileInFileBrwDZ (void);
|
||||
void Brw_RcvFileInFileBrwClassic (void);
|
||||
void Brw_RecLinkFileBrowser (void);
|
||||
void Brw_SetDocumentAsVisible (void);
|
||||
|
|
|
@ -633,10 +633,13 @@ Me sale este error, no s
|
|||
"can npt create received message (duplicated entry '243218-2160773' for key 'UsrCod_MsgCod')
|
||||
*/
|
||||
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.67.3 (2024-03-09)"
|
||||
#define Log_PLATFORM_VERSION "SWAD 23.69 (2024-03-14)"
|
||||
#define CSS_FILE "swad23.67.2.css"
|
||||
#define JS_FILE "swad23.53.6.js"
|
||||
/*
|
||||
Version 23.69: Mar 14, 2024 Actions defined as enum type. (335591 lines)
|
||||
Version 23.68.1: Mar 14, 2024 Code refactoring in menu icons. (335591 lines)
|
||||
Version 23.68: Mar 14, 2024 New order in list of actions. (335700 lines)
|
||||
Version 23.67.3: Mar 09, 2024 Changes in global hits. (335454 lines)
|
||||
Version 23.67.2: Mar 09, 2024 Changes in layout. Fixed missing texts in actions. (335424 lines)
|
||||
Version 23.67.1: Mar 08, 2024 Fixed issue in layout. (335308 lines)
|
||||
|
|
|
@ -865,7 +865,7 @@ void Cty_WriteCountryName (long CtyCod)
|
|||
{
|
||||
char CtyName[Cty_MAX_BYTES_NAME + 1];
|
||||
Frm_PutForm_t PutForm = (!Frm_CheckIfInside () && // Only if not inside another form
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB) ? Frm_PUT_FORM : // Only in main browser tab
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB) ? Frm_PUT_FORM : // Only in main browser tab
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
||||
/***** Get country name *****/
|
||||
|
|
|
@ -653,7 +653,7 @@ void Err_ShowErrorAndExit (const char *Txt)
|
|||
/***** End the output *****/
|
||||
if (!Gbl.Layout.HTMLEndWritten)
|
||||
{
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB)
|
||||
Lay_WriteAboutZone ();
|
||||
|
||||
HTM_Txt ("</body>\n"
|
||||
|
|
|
@ -135,8 +135,8 @@ static void Frm_BeginFormInternal (Act_Action_t NextAction,bool PutParLocationIf
|
|||
HTM_TxtF (" onsubmit=\"%s\"",OnSubmit);
|
||||
switch (Act_GetBrowserTab (NextAction))
|
||||
{
|
||||
case Act_BRW_NEW_TAB:
|
||||
case Act_DOWNLD_FILE:
|
||||
case Act_NEW_TAB:
|
||||
case Act_DWN_FIL:
|
||||
HTM_Txt (" target=\"_blank\"");
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -258,7 +258,7 @@ void Gbl_Cleanup (void)
|
|||
|
||||
if (!Gbl.Action.UsesAJAX &&
|
||||
!Gbl.WebService.IsWebService &&
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB)
|
||||
Ses_DB_RemovePar ();
|
||||
|
||||
Hie_FreeMyHierarchy ();
|
||||
|
|
|
@ -1509,7 +1509,7 @@ void Hie_PutIconToSelectMyHierarchy (__attribute__((unused)) void *Args)
|
|||
/****************** Select one node from my hierarchy ************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
void Hie_ReqSelectOneNodeFromMyHierarchy (void)
|
||||
void Hie_SelOneNodeFromMyHierarchy (void)
|
||||
{
|
||||
/***** Fill the list with the courses I belong to, if not filled *****/
|
||||
Hie_GetMyHierarchy (Hie_CRS);
|
||||
|
|
|
@ -97,6 +97,6 @@ unsigned Hie_GetNumUsrsWhoClaimToBelongTo (Hie_Level_t Level,
|
|||
void Hie_PutIconToSelectMyHierarchyInBreadcrumb (void);
|
||||
void Hie_PutIconToSelectMyHierarchy (__attribute__((unused)) void *Args);
|
||||
|
||||
void Hie_ReqSelectOneNodeFromMyHierarchy (void);
|
||||
void Hie_SelOneNodeFromMyHierarchy (void);
|
||||
|
||||
#endif
|
||||
|
|
|
@ -158,8 +158,8 @@ void Lay_WriteStartOfPage (void)
|
|||
BrowserTab = Act_GetBrowserTab (Gbl.Action.Act);
|
||||
switch (BrowserTab)
|
||||
{
|
||||
case Act_BRW_NEW_TAB:
|
||||
case Act_BRW_2ND_TAB:
|
||||
case Act_NEW_TAB:
|
||||
case Act_2ND_TAB:
|
||||
Gbl.Prefs.Theme = The_THEME_WHITE; // In a new tab, use white background
|
||||
break;
|
||||
default:
|
||||
|
@ -281,7 +281,7 @@ void Lay_WriteStartOfPage (void)
|
|||
/***** HTML body *****/
|
||||
switch (BrowserTab)
|
||||
{
|
||||
case Act_BRW_1ST_TAB:
|
||||
case Act_1ST_TAB:
|
||||
HTM_TxtF ("<body class=\"BODY_%s\" onload=\"init();\">\n",
|
||||
The_GetSuffix ());
|
||||
HTM_DIV_Begin ("id=\"zoomLyr\" class=\"ZOOM ZOOM_%s\"",
|
||||
|
@ -292,8 +292,8 @@ void Lay_WriteStartOfPage (void)
|
|||
HTM_DIV_End ();
|
||||
HTM_DIV_End ();
|
||||
break;
|
||||
case Act_BRW_NEW_TAB:
|
||||
case Act_BRW_2ND_TAB:
|
||||
case Act_NEW_TAB:
|
||||
case Act_2ND_TAB:
|
||||
HTM_Txt ("<body onload=\"init();\"");
|
||||
switch (Gbl.Action.Act)
|
||||
{
|
||||
|
@ -430,7 +430,7 @@ void Lay_WriteEndOfPage (void)
|
|||
HTM_DIV_End (); // main_zone_central_container
|
||||
|
||||
/***** Write page footer *****/
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB)
|
||||
Lay_WriteFootFromHTMLFile ();
|
||||
|
||||
/***** End of main zone and page *****/
|
||||
|
@ -769,7 +769,7 @@ static void Lay_WriteScriptInit (void)
|
|||
bool RefreshMatchStd = false;
|
||||
bool RefreshMatchTch = false;
|
||||
|
||||
RefreshConnected = Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB &&
|
||||
RefreshConnected = Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB &&
|
||||
(Gbl.Prefs.SideCols & Lay_SHOW_RIGHT_COLUMN); // Right column visible
|
||||
|
||||
switch (Gbl.Action.Act)
|
||||
|
@ -884,7 +884,7 @@ static void Lay_WriteScriptParsAJAX (void)
|
|||
Gbl.Hierarchy.Node[Hie_CRS].HieCod);
|
||||
|
||||
/***** Parameter to refresh connected users *****/
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB)
|
||||
// Refresh parameter
|
||||
HTM_TxtF ("const refreshParamNxtActCon = \"act=%ld\";\n",
|
||||
Act_GetActCod (ActRefCon));
|
||||
|
|
|
@ -232,7 +232,7 @@ void Log_GetAndShowLastClicks (void)
|
|||
Action = Act_GetActionFromActCod (ActCod);
|
||||
|
||||
/* Use a special color for this row depending on the action */
|
||||
ClassRow = (Act_GetBrowserTab (Action) == Act_DOWNLD_FILE) ? "DAT_SMALL_YELLOW" :
|
||||
ClassRow = (Act_GetBrowserTab (Action) == Act_DWN_FIL) ? "DAT_SMALL_YELLOW" :
|
||||
(ActCod == Act_GetActCod (ActLogIn ) ||
|
||||
ActCod == Act_GetActCod (ActLogInNew)) ? "DAT_SMALL_GREEN" :
|
||||
(ActCod == Act_GetActCod (ActLogOut )) ? "DAT_SMALL_RED" :
|
||||
|
|
12
swad_main.c
12
swad_main.c
|
@ -127,8 +127,8 @@ int main (void)
|
|||
/***** Get number of sessions *****/
|
||||
switch (Act_GetBrowserTab (Gbl.Action.Act))
|
||||
{
|
||||
case Act_BRW_1ST_TAB:
|
||||
case Act_AJAX_RFRESH:
|
||||
case Act_1ST_TAB:
|
||||
case Act_AJAX_RF:
|
||||
Ses_GetNumSessions ();
|
||||
break;
|
||||
default:
|
||||
|
@ -158,7 +158,7 @@ int main (void)
|
|||
if (FunctionPriori != NULL)
|
||||
FunctionPriori ();
|
||||
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_204_NO_CONT)
|
||||
if (Act_GetBrowserTab (Gbl.Action.Act) == Act_204_NOC)
|
||||
/***** Write HTTP Status 204 No Content *****/
|
||||
Lay_WriteHTTPStatus204NoContent ();
|
||||
|
||||
|
@ -188,9 +188,9 @@ int main (void)
|
|||
/* When updating a small zone via AJAX, all output is already done */
|
||||
switch (Act_GetBrowserTab (Gbl.Action.Act))
|
||||
{
|
||||
case Act_AJAX_NORMAL:
|
||||
case Act_AJAX_RFRESH:
|
||||
case Act_WEB_SERVICE:
|
||||
case Act_AJAX_NR:
|
||||
case Act_AJAX_RF:
|
||||
case Act_WEB_SVC:
|
||||
/* All the output is made, so don't write anymore */
|
||||
Gbl.Layout.DivsEndWritten =
|
||||
Gbl.Layout.HTMLEndWritten = true;
|
||||
|
|
200
swad_menu.c
200
swad_menu.c
|
@ -68,127 +68,149 @@ const char *Mnu_MenuIcons[Mnu_NUM_MENUS] =
|
|||
#define MAX_MENU_ID 16
|
||||
|
||||
// Actions not initialized are 0 by default
|
||||
static const Act_Action_t Mnu_MenuActions[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
|
||||
static const struct Mnu_Menu
|
||||
{
|
||||
Act_Action_t Action;
|
||||
const char *Icon;
|
||||
} Mnu_Menu[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
|
||||
{
|
||||
[TabUnk] = {
|
||||
},
|
||||
[TabStr] = {
|
||||
[ 0] = ActFrmLogIn,
|
||||
[ 1] = ActReqSch,
|
||||
[ 2] = ActSeeGblTL,
|
||||
[ 3] = ActSeeSocPrf,
|
||||
[ 4] = ActSeeCal,
|
||||
[ 5] = ActSeeNtf,
|
||||
[ 0] = {ActFrmLogIn ,"power-off" },
|
||||
[ 1] = {ActReqSch ,"search" },
|
||||
[ 2] = {ActSeeGblTL ,"comment-dots" },
|
||||
[ 3] = {ActSeeSocPrf ,"user-circle" },
|
||||
[ 4] = {ActSeeCal ,"calendar" },
|
||||
[ 5] = {ActSeeNtf ,"bell" },
|
||||
},
|
||||
[TabSys] = {
|
||||
[ 0] = ActSeeSysInf,
|
||||
[ 1] = ActSeeCty,
|
||||
[ 2] = ActSeePen,
|
||||
[ 3] = ActSeeLnk,
|
||||
[ 4] = ActSeePlg,
|
||||
[ 5] = ActMtn,
|
||||
[ 0] = {ActSeeSysInf ,"info" },
|
||||
[ 1] = {ActSeeCty ,"globe-americas" },
|
||||
[ 2] = {ActSeePen ,"sitemap" },
|
||||
[ 3] = {ActSeeLnk ,"up-right-from-square" },
|
||||
[ 4] = {ActSeePlg ,"puzzle-piece" },
|
||||
[ 5] = {ActMtn ,"tools" },
|
||||
},
|
||||
[TabCty] = {
|
||||
[ 0] = ActSeeCtyInf,
|
||||
[ 1] = ActSeeIns,
|
||||
[ 0] = {ActSeeCtyInf ,"info" },
|
||||
[ 1] = {ActSeeIns ,"university" },
|
||||
},
|
||||
[TabIns] = {
|
||||
[ 0] = ActSeeInsInf,
|
||||
[ 1] = ActSeeCtr,
|
||||
[ 2] = ActSeePlc,
|
||||
[ 3] = ActSeeDpt,
|
||||
[ 4] = ActSeeHld,
|
||||
[ 0] = {ActSeeInsInf ,"info" },
|
||||
[ 1] = {ActSeeCtr ,"building" },
|
||||
[ 2] = {ActSeePlc ,"map-marker-alt" },
|
||||
[ 3] = {ActSeeDpt ,"users" },
|
||||
[ 4] = {ActSeeHld ,"calendar-day" },
|
||||
},
|
||||
[TabCtr] = {
|
||||
[ 0] = ActSeeCtrInf,
|
||||
[ 1] = ActSeeDeg,
|
||||
[ 2] = ActSeeBld,
|
||||
[ 3] = ActSeeRoo,
|
||||
[ 0] = {ActSeeCtrInf ,"info" },
|
||||
[ 1] = {ActSeeDeg ,"graduation-cap" },
|
||||
[ 2] = {ActSeeBld ,"building" },
|
||||
[ 3] = {ActSeeRoo ,"chalkboard-teacher" },
|
||||
},
|
||||
[TabDeg] = {
|
||||
[ 0] = ActSeeDegInf,
|
||||
[ 1] = ActSeeCrs,
|
||||
[ 0] = {ActSeeDegInf ,"info" },
|
||||
[ 1] = {ActSeeCrs ,"chalkboard-teacher" },
|
||||
},
|
||||
[TabCrs] = {
|
||||
[ 0] = ActSeeCrsInf,
|
||||
[ 1] = ActSeePrg,
|
||||
[ 2] = ActSeeTchGui,
|
||||
[ 3] = ActSeeSyl,
|
||||
[ 4] = ActSeeBib,
|
||||
[ 5] = ActSeeFAQ,
|
||||
[ 6] = ActSeeCrsLnk,
|
||||
[ 7] = ActSeeAss,
|
||||
[ 8] = ActSeeCrsTT,
|
||||
[ 0] = {ActSeeCrsInf ,"info" },
|
||||
[ 1] = {ActSeePrg ,"clipboard-list" },
|
||||
[ 2] = {ActSeeTchGui ,"book-open" },
|
||||
[ 3] = {ActSeeSyl ,"list-ol" },
|
||||
[ 4] = {ActSeeBib ,"book" },
|
||||
[ 5] = {ActSeeFAQ ,"question" },
|
||||
[ 6] = {ActSeeCrsLnk ,"up-right-from-square" },
|
||||
[ 7] = {ActSeeAss ,"check" },
|
||||
[ 8] = {ActSeeCrsTT ,"clock" },
|
||||
},
|
||||
[TabAss] = {
|
||||
[ 0] = ActSeeAllAsg,
|
||||
[ 1] = ActSeeAllPrj,
|
||||
[ 2] = ActSeeAllCfe,
|
||||
[ 3] = ActEdiTstQst,
|
||||
[ 4] = ActReqTst,
|
||||
[ 5] = ActSeeAllExa,
|
||||
[ 6] = ActSeeAllGam,
|
||||
[ 7] = ActSeeAllRub,
|
||||
[ 0] = {ActSeeAllAsg ,"edit" },
|
||||
[ 1] = {ActSeeAllPrj ,"file-invoice" },
|
||||
[ 2] = {ActSeeAllCfe ,"bullhorn" },
|
||||
[ 3] = {ActEdiTstQst ,"clipboard-question" },
|
||||
[ 4] = {ActReqTst ,"check" },
|
||||
[ 5] = {ActSeeAllExa ,"file-signature" },
|
||||
[ 6] = {ActSeeAllGam ,"gamepad" },
|
||||
[ 7] = {ActSeeAllRub ,"tasks" },
|
||||
},
|
||||
[TabFil] = {
|
||||
[ 0] = ActSeeAdmDocIns,
|
||||
[ 1] = ActAdmShaIns,
|
||||
[ 2] = ActSeeAdmDocCtr,
|
||||
[ 3] = ActAdmShaCtr,
|
||||
[ 4] = ActSeeAdmDocDeg,
|
||||
[ 5] = ActAdmShaDeg,
|
||||
[ 6] = ActSeeAdmDocCrsGrp,
|
||||
[ 7] = ActAdmTchCrsGrp,
|
||||
[ 8] = ActAdmShaCrsGrp,
|
||||
[ 9] = ActAdmAsgWrkUsr,
|
||||
[10] = ActReqAsgWrkCrs,
|
||||
[11] = ActSeeAdmMrk,
|
||||
[12] = ActAdmBrf,
|
||||
[ 0] = {ActSeeAdmDocIns ,"folder-open" },
|
||||
[ 1] = {ActAdmShaIns ,"folder-open" },
|
||||
[ 2] = {ActSeeAdmDocCtr ,"folder-open" },
|
||||
[ 3] = {ActAdmShaCtr ,"folder-open" },
|
||||
[ 4] = {ActSeeAdmDocDeg ,"folder-open" },
|
||||
[ 5] = {ActAdmShaDeg ,"folder-open" },
|
||||
[ 6] = {ActSeeAdmDocCrsGrp ,"folder-open" },
|
||||
[ 7] = {ActAdmTchCrsGrp ,"folder-open" },
|
||||
[ 8] = {ActAdmShaCrsGrp ,"folder-open" },
|
||||
[ 9] = {ActAdmAsgWrkUsr ,"folder-open" },
|
||||
[10] = {ActReqAsgWrkCrs ,"folder-open" },
|
||||
[11] = {ActSeeAdmMrk ,"list-alt" },
|
||||
[12] = {ActAdmBrf ,"briefcase" },
|
||||
},
|
||||
[TabUsr] = {
|
||||
[ 0] = ActReqSelGrp,
|
||||
[ 1] = ActLstStd,
|
||||
[ 2] = ActLstTch,
|
||||
[ 3] = ActLstOth,
|
||||
[ 4] = ActSeeAllAtt,
|
||||
[ 5] = ActReqSignUp,
|
||||
[ 6] = ActSeeSignUpReq,
|
||||
[ 7] = ActLstCon,
|
||||
[ 0] = {ActReqSelGrp ,"sitemap" },
|
||||
[ 1] = {ActLstStd ,"users" },
|
||||
[ 2] = {ActLstTch ,"user-tie" },
|
||||
[ 3] = {ActLstOth ,"user-friends" },
|
||||
[ 4] = {ActSeeAllAtt ,"calendar-check" },
|
||||
[ 5] = {ActReqSignUp ,"hand-point-up" },
|
||||
[ 6] = {ActSeeSignUpReq ,"hand-point-up" },
|
||||
[ 7] = {ActLstCon ,"user-clock" },
|
||||
},
|
||||
[TabMsg] = {
|
||||
[ 0] = ActSeeAnn,
|
||||
[ 1] = ActSeeAllNot,
|
||||
[ 2] = ActSeeFor,
|
||||
[ 3] = ActSeeChtRms,
|
||||
[ 4] = ActSeeRcvMsg,
|
||||
[ 5] = ActReqMaiUsr,
|
||||
[ 0] = {ActSeeAnn ,"bullhorn" },
|
||||
[ 1] = {ActSeeAllNot ,"sticky-note" },
|
||||
[ 2] = {ActSeeFor ,"comments" },
|
||||
[ 3] = {ActSeeChtRms ,"comments" },
|
||||
[ 4] = {ActSeeRcvMsg ,"envelope" },
|
||||
[ 5] = {ActReqMaiUsr ,"at" },
|
||||
},
|
||||
[TabAna] = {
|
||||
[ 0] = ActReqUseGbl,
|
||||
[ 1] = ActSeePhoDeg,
|
||||
[ 2] = ActReqStaCrs,
|
||||
[ 3] = ActSeeAllSvy,
|
||||
[ 4] = ActReqAccGbl,
|
||||
[ 5] = ActReqMyUsgRep,
|
||||
[ 6] = ActMFUAct,
|
||||
[ 0] = {ActReqUseGbl ,"chart-pie" },
|
||||
[ 1] = {ActSeePhoDeg ,"graduation-cap" },
|
||||
[ 2] = {ActReqStaCrs ,"tasks" },
|
||||
[ 3] = {ActSeeAllSvy ,"poll" },
|
||||
[ 4] = {ActReqAccGbl ,"chart-line" },
|
||||
[ 5] = {ActReqMyUsgRep ,"file-alt" },
|
||||
[ 6] = {ActMFUAct ,"heart" },
|
||||
},
|
||||
[TabPrf] = {
|
||||
[ 0] = ActFrmRolSes,
|
||||
[ 1] = ActMyCrs,
|
||||
[ 2] = ActSeeMyTT,
|
||||
[ 3] = ActSeeMyAgd,
|
||||
[ 4] = ActFrmMyAcc,
|
||||
[ 5] = ActReqEdiRecSha,
|
||||
[ 6] = ActReqEdiSet,
|
||||
[ 0] = {ActFrmRolSes ,"power-off" },
|
||||
[ 1] = {ActMyCrs ,"sitemap" },
|
||||
[ 2] = {ActSeeMyTT ,"clock" },
|
||||
[ 3] = {ActSeeMyAgd ,"calendar" },
|
||||
[ 4] = {ActFrmMyAcc ,"at" },
|
||||
[ 5] = {ActReqEdiRecSha ,"address-card" },
|
||||
[ 6] = {ActReqEdiSet ,"cog" },
|
||||
},
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/****************************** Private prototypes ***************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
static void Mnu_PutIconsMenu (__attribute__((unused)) void *Args);
|
||||
|
||||
/*****************************************************************************/
|
||||
/***** Get icon associated to a number of option in menu of current tab ******/
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *Mnu_GetIconFromNumOptInMenu (unsigned NumOptInMenu)
|
||||
{
|
||||
return Mnu_Menu[Gbl.Action.Tab][NumOptInMenu].Icon;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/********************** Get icon associated to an action *********************/
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *Mnu_GetIconFromAction (Act_Action_t Action)
|
||||
{
|
||||
return Mnu_Menu[Act_GetTab (Action)][Act_GetIndexInMenu (Action)].Icon;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
/******* When I change to another tab, go to the first option allowed ********/
|
||||
/*****************************************************************************/
|
||||
|
@ -203,7 +225,7 @@ Act_Action_t Mnu_GetFirstActionAvailableInCurrentTab (void)
|
|||
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
|
||||
NumOptInMenu++)
|
||||
{
|
||||
if ((Action = Mnu_MenuActions[Gbl.Action.Tab][NumOptInMenu]) == 0)
|
||||
if ((Action = Mnu_Menu[Gbl.Action.Tab][NumOptInMenu].Action) == 0)
|
||||
return ActUnk;
|
||||
if (Act_CheckIfIHavePermissionToExecuteAction (Action))
|
||||
return Action;
|
||||
|
@ -240,7 +262,7 @@ void Mnu_WriteMenuThisTab (void)
|
|||
NumOptInMenu < Act_MAX_OPTIONS_IN_MENU_PER_TAB;
|
||||
NumOptInMenu++)
|
||||
{
|
||||
NumAct = Mnu_MenuActions[Gbl.Action.Tab][NumOptInMenu];
|
||||
NumAct = Mnu_Menu[Gbl.Action.Tab][NumOptInMenu].Action;
|
||||
if (NumAct == 0) // At the end of each tab, actions are initialized to 0, so 0 marks the end of the menu
|
||||
break;
|
||||
if (Act_CheckIfIHavePermissionToExecuteAction (NumAct))
|
||||
|
@ -267,12 +289,12 @@ void Mnu_WriteMenuThisTab (void)
|
|||
" style=\"background-image:url('%s/%s/%s');\"",
|
||||
ClassIcoMenu[Gbl.Prefs.IconSet],The_GetSuffix (),
|
||||
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet],
|
||||
Act_GetIcon (NumAct));
|
||||
Ico_GetIcon (Mnu_GetIconFromNumOptInMenu (NumOptInMenu)));
|
||||
else
|
||||
HTM_DIV_Begin ("class=\"MENU_ICO\""
|
||||
" style=\"background-image:url('%s/%s/%s');\"",
|
||||
Cfg_URL_ICON_SETS_PUBLIC,Ico_IconSetId[Gbl.Prefs.IconSet],
|
||||
Act_GetIcon (NumAct));
|
||||
Ico_GetIcon (Mnu_GetIconFromNumOptInMenu (NumOptInMenu)));
|
||||
HTM_DIV_End ();
|
||||
HTM_DIV_Begin ("class=\"MENU_TXT MENU_TXT_%s\"",
|
||||
The_GetSuffix ());
|
||||
|
|
|
@ -45,6 +45,9 @@ typedef enum
|
|||
/***************************** Public prototypes *****************************/
|
||||
/*****************************************************************************/
|
||||
|
||||
const char *Mnu_GetIconFromNumOptInMenu (unsigned NumOptInMenu);
|
||||
const char *Mnu_GetIconFromAction (Act_Action_t Action);
|
||||
|
||||
Act_Action_t Mnu_GetFirstActionAvailableInCurrentTab (void);
|
||||
void Mnu_WriteMenuThisTab (void);
|
||||
|
||||
|
|
|
@ -776,11 +776,11 @@ void Par_GetMainPars (void)
|
|||
/***** Some preliminary adjusts depending on action *****/
|
||||
switch (Act_GetBrowserTab (Gbl.Action.Act))
|
||||
{
|
||||
case Act_AJAX_NORMAL:
|
||||
case Act_AJAX_NR:
|
||||
Gbl.Action.UsesAJAX = true;
|
||||
Gbl.Action.IsAJAXAutoRefresh = false;
|
||||
break;
|
||||
case Act_AJAX_RFRESH:
|
||||
case Act_AJAX_RF:
|
||||
Gbl.Action.UsesAJAX = true;
|
||||
Gbl.Action.IsAJAXAutoRefresh = true;
|
||||
break;
|
||||
|
|
12
swad_photo.c
12
swad_photo.c
|
@ -1073,9 +1073,9 @@ void Pho_BuildHTMLUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL,
|
|||
unsigned NumFollowers;
|
||||
bool PhotoExists;
|
||||
Act_BrowserTab_t BrowserTab = Act_GetBrowserTab (Gbl.Action.Act);
|
||||
bool BrowserTabIs1stTab = (BrowserTab == Act_BRW_1ST_TAB ||
|
||||
BrowserTab == Act_AJAX_NORMAL ||
|
||||
BrowserTab == Act_AJAX_RFRESH);
|
||||
bool BrowserTabIs1stTab = (BrowserTab == Act_1ST_TAB ||
|
||||
BrowserTab == Act_AJAX_NR ||
|
||||
BrowserTab == Act_AJAX_RF);
|
||||
bool PutZoomCode = (Zoom == Pho_ZOOM) && // Make zoom
|
||||
BrowserTabIs1stTab; // Only in main browser tab (or AJAX)
|
||||
char IdCaption[Frm_MAX_BYTES_ID + 1];
|
||||
|
@ -1279,9 +1279,9 @@ void Pho_ShowUsrPhoto (const struct Usr_Data *UsrDat,const char *PhotoURL,
|
|||
const char *ClassPhoto,Pho_Zoom_t Zoom)
|
||||
{
|
||||
Act_BrowserTab_t BrowserTab = Act_GetBrowserTab (Gbl.Action.Act);
|
||||
bool BrowserTabIs1stTab = (BrowserTab == Act_BRW_1ST_TAB ||
|
||||
BrowserTab == Act_AJAX_NORMAL ||
|
||||
BrowserTab == Act_AJAX_RFRESH);
|
||||
bool BrowserTabIs1stTab = (BrowserTab == Act_1ST_TAB ||
|
||||
BrowserTab == Act_AJAX_NR ||
|
||||
BrowserTab == Act_AJAX_RF);
|
||||
Frm_PutForm_t PutFormPublicProfile = (!Frm_CheckIfInside () && // Only if not inside another form
|
||||
BrowserTabIs1stTab) ? Frm_PUT_FORM : // Only in main browser tab (or AJAX)
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
|
|
@ -2075,7 +2075,7 @@ void Rec_ShowSharedUsrRecord (Rec_SharedRecordViewType_t TypeOfView,
|
|||
Rec_RecordHelp[Rec_SHA_RECORD_LIST] = Rec_RecordListHelp[UsrDat->Roles.InCurrentCrs];
|
||||
|
||||
PutFormLinks = (!Frm_CheckIfInside () && // Only if not inside another form
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB) ? Frm_PUT_FORM : // Only in main browser tab
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB) ? Frm_PUT_FORM : // Only in main browser tab
|
||||
Frm_DONT_PUT_FORM;
|
||||
|
||||
Ins.HieCod = UsrDat->InsCod;
|
||||
|
@ -2347,7 +2347,7 @@ static void Rec_PutIconsCommands (__attribute__((unused)) void *Args)
|
|||
};
|
||||
|
||||
if (!Frm_CheckIfInside () && // Only if not inside another form
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB && // Only in main browser tab
|
||||
Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB && // Only in main browser tab
|
||||
Gbl.Usrs.Me.Logged) // Only if I am logged
|
||||
{
|
||||
ICanViewUsrProfile = Pri_ShowingIsAllowed (Rec_Record.UsrDat->BaPrfVisibility,
|
||||
|
|
|
@ -680,14 +680,14 @@ static void Sta_WriteSelectorAction (const struct Sta_Stats *Stats)
|
|||
Action == Stats->NumAction ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%u: %s",
|
||||
"%04u: %s",
|
||||
(unsigned) Action,Act_GetActionText (Action));
|
||||
else
|
||||
HTM_OPTION (HTM_Type_UNSIGNED,&ActionUnsigned,
|
||||
Action == Stats->NumAction ? HTM_OPTION_SELECTED :
|
||||
HTM_OPTION_UNSELECTED,
|
||||
HTM_OPTION_ENABLED,
|
||||
"%u: %s > %s > %s",
|
||||
"%04u: %s > %s > %s",
|
||||
(unsigned) Action,Tab_GetTxt (Tab),
|
||||
Act_GetTitleAction (Action),
|
||||
Act_GetActionText (Action));
|
||||
|
|
11536
swad_text_action.c
11536
swad_text_action.c
File diff suppressed because it is too large
Load Diff
|
@ -538,6 +538,9 @@ void Tmt_ShowTimeTable (struct Tmt_Timetable *Timetable,long UsrCod)
|
|||
case ActPrnRecSevTch:
|
||||
Timetable->View = Vie_PRINT;
|
||||
break;
|
||||
default:
|
||||
Err_WrongActionExit ();
|
||||
break;
|
||||
}
|
||||
|
||||
/***** If editing ==> configure and allocate timetable *****/
|
||||
|
|
|
@ -276,7 +276,7 @@ void Usr_InformAboutNumClicksBeforePhoto (void)
|
|||
{
|
||||
if (Gbl.Usrs.Me.NumAccWithoutPhoto >= Pho_MAX_CLICKS_WITHOUT_PHOTO)
|
||||
Ale_ShowAlert (Ale_WARNING,Txt_You_must_send_your_photo_because_);
|
||||
else if (Act_GetBrowserTab (Gbl.Action.Act) == Act_BRW_1ST_TAB)
|
||||
else if (Act_GetBrowserTab (Gbl.Action.Act) == Act_1ST_TAB)
|
||||
Ale_ShowAlertAndButton (ActReqMyPho,NULL,NULL,
|
||||
NULL,NULL,
|
||||
Btn_CONFIRM_BUTTON,Txt_Upload_photo,
|
||||
|
|
Loading…
Reference in New Issue