2018-11-09 20:48:17 +01:00
|
|
|
|
// swad_form.h: forms to go to actions
|
|
|
|
|
|
|
|
|
|
#ifndef _SWAD_FRM
|
|
|
|
|
#define _SWAD_FRM
|
|
|
|
|
/*
|
|
|
|
|
SWAD (Shared Workspace At a Distance),
|
|
|
|
|
is a web platform developed at the University of Granada (Spain),
|
|
|
|
|
and used to support university teaching.
|
|
|
|
|
|
|
|
|
|
This file is part of SWAD core.
|
2023-03-10 17:21:04 +01:00
|
|
|
|
Copyright (C) 1999-2023 Antonio Ca<EFBFBD>as Vargas
|
2018-11-09 20:48:17 +01:00
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU Affero General Public License as
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/********************************** Headers **********************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "swad_action.h"
|
2023-05-11 18:35:16 +02:00
|
|
|
|
#include "swad_button.h"
|
2018-11-09 20:48:17 +01:00
|
|
|
|
#include "swad_constant.h"
|
|
|
|
|
#include "swad_cryptography.h"
|
2023-10-10 00:27:25 +02:00
|
|
|
|
#include "swad_parameter_code.h"
|
2018-11-09 20:48:17 +01:00
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2023-04-04 14:32:01 +02:00
|
|
|
|
/************************** Public constants and types ***********************/
|
2018-11-09 20:48:17 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#define Frm_MAX_BYTES_ID (32 + Cry_BYTES_ENCRYPTED_STR_SHA256_BASE64 + 10)
|
|
|
|
|
|
|
|
|
|
#define Frm_MAX_BYTES_PARAM_ACTION 256
|
|
|
|
|
#define Frm_MAX_BYTES_PARAM_SESSION (256 + Cns_BYTES_SESSION_ID)
|
|
|
|
|
#define Frm_MAX_BYTES_PARAM_LOCATION 256
|
|
|
|
|
#define Frm_MAX_BYTES_PARAMS_STR (Frm_MAX_BYTES_PARAM_ACTION + Frm_MAX_BYTES_PARAM_SESSION + Frm_MAX_BYTES_PARAM_LOCATION)
|
|
|
|
|
|
2023-04-04 14:32:01 +02:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
|
|
|
|
Frm_DONT_PUT_FORM_TO_GO,
|
|
|
|
|
Frm_PUT_FORM_TO_GO,
|
|
|
|
|
} Frm_PutFormToGo_t;
|
|
|
|
|
|
2018-11-09 20:48:17 +01:00
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
/***************************** Public prototypes *****************************/
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2022-10-18 08:41:54 +02:00
|
|
|
|
bool Frm_CheckIfInside (void);
|
|
|
|
|
|
2021-03-02 00:54:26 +01:00
|
|
|
|
void Frm_BeginFormGoTo (Act_Action_t NextAction);
|
|
|
|
|
void Frm_BeginForm (Act_Action_t NextAction);
|
|
|
|
|
void Frm_BeginFormOnSubmit (Act_Action_t NextAction,const char *OnSubmit);
|
|
|
|
|
void Frm_BeginFormAnchorOnSubmit (Act_Action_t NextAction,const char *Anchor,const char *OnSubmit);
|
|
|
|
|
void Frm_BeginFormId (Act_Action_t NextAction,const char *Id);
|
2022-10-15 15:12:40 +02:00
|
|
|
|
void Frm_BeginFormAnchor (Act_Action_t NextAction,const char *Anchor);
|
2021-03-02 00:54:26 +01:00
|
|
|
|
void Frm_BeginFormNoAction (void);
|
2023-09-19 08:56:19 +02:00
|
|
|
|
void Frm_SetParsForm (char ParsStr[Frm_MAX_BYTES_PARAMS_STR + 1],
|
|
|
|
|
Act_Action_t NextAction,
|
2023-03-10 00:13:55 +01:00
|
|
|
|
bool PutParLocationIfNoSession);
|
2018-11-09 20:48:17 +01:00
|
|
|
|
void Frm_EndForm (void);
|
|
|
|
|
|
2023-05-11 18:35:16 +02:00
|
|
|
|
void Frm_BeginFormTable (Act_Action_t NextAction,const char *Anchor,
|
|
|
|
|
void (*FuncPars) (void *Args),void *Args);
|
|
|
|
|
void Frm_EndFormTable (Btn_Button_t Button);
|
|
|
|
|
|
2018-11-09 20:48:17 +01:00
|
|
|
|
void Frm_SetUniqueId (char UniqueId[Frm_MAX_BYTES_ID + 1]);
|
|
|
|
|
|
2019-04-20 21:11:44 +02:00
|
|
|
|
void Frm_SetAnchorStr (long Cod,char **Anchor);
|
2023-04-06 19:59:33 +02:00
|
|
|
|
void Frm_FreeAnchorStr (char **Anchor);
|
2018-11-09 20:48:17 +01:00
|
|
|
|
|
2019-12-27 15:45:19 +01:00
|
|
|
|
void Frm_LabelColumn (const char *TDClass,const char *Id,const char *Label);
|
2019-12-26 22:29:04 +01:00
|
|
|
|
|
2023-10-10 00:27:25 +02:00
|
|
|
|
void Frm_PutShortAndFullNames (Act_Action_t ActionRename[Cns_NUM_SHRT_FULL_NAMES],
|
|
|
|
|
ParCod_Param_t ParCod,long Cod,
|
|
|
|
|
const char *Name[Cns_NUM_SHRT_FULL_NAMES],
|
|
|
|
|
bool PutForm);
|
|
|
|
|
|
2019-04-20 21:11:44 +02:00
|
|
|
|
#endif
|