mirror of https://github.com/acanas/swad-core.git
Version 23.26.1: Oct 05, 2023 Code refactoring.
This commit is contained in:
parent
33b2b50c3c
commit
450f429c32
|
@ -0,0 +1,101 @@
|
||||||
|
// swad_hidden_visible.c: types and constants related to hidden/visible
|
||||||
|
|
||||||
|
/*
|
||||||
|
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.
|
||||||
|
Copyright (C) 1999-2023 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
|
||||||
|
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_hidden_visible.h"
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************************** Public constants *****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
/* Hidden in database fields */
|
||||||
|
const char HidVis_YN[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = 'Y',
|
||||||
|
[HidVis_VISIBLE] = 'N',
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *HidVis_DateGreenClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "DATE_GREEN_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "DATE_GREEN",
|
||||||
|
};
|
||||||
|
const char *HidVis_DateRedClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "DATE_RED_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "DATE_RED",
|
||||||
|
};
|
||||||
|
const char *HidVis_DateBlueClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "DATE_BLUE_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "DATE_BLUE",
|
||||||
|
};
|
||||||
|
const char *HidVis_TitleClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "ASG_TITLE_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "ASG_TITLE",
|
||||||
|
};
|
||||||
|
const char *HidVis_GroupClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "ASG_GRP_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "ASG_GRP",
|
||||||
|
};
|
||||||
|
const char *HidVis_LabelClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "ASG_LABEL_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "ASG_LABEL",
|
||||||
|
};
|
||||||
|
const char *HidVis_DataClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "DAT_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "DAT",
|
||||||
|
};
|
||||||
|
const char *HidVis_MsgClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = "MSG_AUT_LIGHT",
|
||||||
|
[HidVis_VISIBLE] = "MSG_AUT",
|
||||||
|
};
|
||||||
|
const char *HidVis_PrgClass[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = " PRG_HIDDEN",
|
||||||
|
[HidVis_VISIBLE] = "",
|
||||||
|
};
|
||||||
|
const char *HidVis_ShownStyle[HidVis_NUM_HIDDEN_VISIBLE] =
|
||||||
|
{
|
||||||
|
[HidVis_HIDDEN ] = " style=\"display:none;\"",
|
||||||
|
[HidVis_VISIBLE] = "",
|
||||||
|
};
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/**************** Get if hidden or visible from a character ******************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
HidVis_HiddenOrVisible_t HidVid_GetHiddenOrVisible (char Ch)
|
||||||
|
{
|
||||||
|
return (Ch == 'Y') ? HidVis_HIDDEN :
|
||||||
|
HidVis_VISIBLE;
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,49 @@
|
||||||
|
// swad_hidden_visible.h: types and constants related to hidden/visible
|
||||||
|
|
||||||
|
#ifndef _SWAD_HID_VIS
|
||||||
|
#define _SWAD_HID_VIS
|
||||||
|
/*
|
||||||
|
SWAD (Shared Workspace At a Distance in Spanish),
|
||||||
|
is a web platform developed at the University of Granada (Spain),
|
||||||
|
and used to support university teaching.
|
||||||
|
|
||||||
|
This file is part of SWAD core.
|
||||||
|
Copyright (C) 1999-2023 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
|
||||||
|
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/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/***************************** Public constants ******************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#define HidVis_NUM_HIDDEN_VISIBLE 2
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/******************************* Public types ********************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
HidVis_HIDDEN = 0,
|
||||||
|
HidVis_VISIBLE = 1,
|
||||||
|
} HidVis_HiddenOrVisible_t;
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/****************************** Public prototypes ****************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
HidVis_HiddenOrVisible_t HidVid_GetHiddenOrVisible (char c);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue