#include swad_setting.h

This commit is contained in:
acanas 2021-10-24 20:32:09 +02:00
parent 4d46a06d38
commit b43d01c99f
4 changed files with 52 additions and 40 deletions

View File

@ -602,13 +602,14 @@ TODO: FIX BUG, URGENT! En las fechas como par
TODO: En las encuestas, que los estudiantes no puedan ver los resultados hasta que no finalice el plazo.
*/
#define Log_PLATFORM_VERSION "SWAD 21.41.1 (2021-10-24)"
#define Log_PLATFORM_VERSION "SWAD 21.41.2 (2021-10-24)"
#define CSS_FILE "swad20.45.css"
#define JS_FILE "swad20.69.1.js"
/*
TODO: Rename CENTRE to CENTER in help wiki.
TODO: Rename ASSESSMENT.Announcements to ASSESSMENT.Calls_for_exams
Version 21.41.2: Oct 24, 2021 Query moved to module swad_setting_database. (320777 lines)
Version 21.41.1: Oct 24, 2021 Queries moved to module swad_tag_database. (320767 lines)
Version 21.41: Oct 24, 2021 New module swad_tag_database for database queries related to question tags. (320721 lines)
Version 21.40.1: Oct 24, 2021 Queries moved to module swad_center_database. (320621 lines)

View File

@ -57,20 +57,6 @@ void Set_DB_UpdateMySettingsAboutLanguage (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/************** Update layout of side colums on user data table **************/
/*****************************************************************************/
void Set_DB_UpdateMySettingsAboutSideCols (void)
{
DB_QueryUPDATE ("can not update your setting about side columns",
"UPDATE usr_data"
" SET SideCols=%u"
" WHERE UsrCod=%ld",
Gbl.Prefs.SideCols,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/******************** Update my settings about date format *******************/
/*****************************************************************************/
@ -127,6 +113,34 @@ void Set_DB_UpdateMySettingsAboutMenu (Mnu_Menu_t Menu)
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/*********************** Update my settings about theme **********************/
/*****************************************************************************/
void Set_DB_UpdateMySettingsAboutTheme (const char *ThemeId)
{
DB_QueryUPDATE ("can not update your setting about theme",
"UPDATE usr_data"
" SET Theme='%s'"
" WHERE UsrCod=%ld",
ThemeId,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/************** Update layout of side colums on user data table **************/
/*****************************************************************************/
void Set_DB_UpdateMySettingsAboutSideCols (void)
{
DB_QueryUPDATE ("can not update your setting about side columns",
"UPDATE usr_data"
" SET SideCols=%u"
" WHERE UsrCod=%ld",
Gbl.Prefs.SideCols,
Gbl.Usrs.Me.UsrDat.UsrCod);
}
/*****************************************************************************/
/***************** Update my settings about photo visibility *****************/
/*****************************************************************************/

View File

@ -41,11 +41,12 @@
//--------------------------- Global user settings ----------------------------
void Set_DB_UpdateMySettingsAboutLanguage (void);
void Set_DB_UpdateMySettingsAboutSideCols (void);
void Set_DB_UpdateMySettingsAboutDateFormat (Dat_Format_t DateFormat);
void Set_DB_UpdateMySettingsAboutFirstDayOfWeek (unsigned FirstDayOfWeek);
void Set_DB_UpdateMySettingsAboutIconSet (const char *IconSetId);
void Set_DB_UpdateMySettingsAboutMenu (Mnu_Menu_t Menu);
void Set_DB_UpdateMySettingsAboutTheme (const char *ThemeId);
void Set_DB_UpdateMySettingsAboutSideCols (void);
void Set_DB_UpdateMySettingsAboutPhoto (void);
void Set_DB_UpdateMySettingsAboutBasicProfile (void);
void Set_DB_UpdateMySettingsAboutExtendedProfile (void);

View File

@ -37,6 +37,7 @@
#include "swad_layout.h"
#include "swad_parameter.h"
#include "swad_setting.h"
#include "swad_setting_database.h"
#include "swad_theme.h"
/*****************************************************************************/
@ -321,24 +322,24 @@ void The_PutIconsToSelectTheme (void)
Box_BoxBegin (NULL,Txt_Theme_SKIN,
The_PutIconsTheme,NULL,
Hlp_PROFILE_Settings_theme,Box_NOT_CLOSABLE);
Set_BeginSettingsHead ();
Set_BeginOneSettingSelector ();
for (Theme = (The_Theme_t) 0;
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
Theme++)
{
HTM_DIV_Begin ("class=\"%s\"",Theme == Gbl.Prefs.Theme ? "PREF_ON" :
"PREF_OFF");
Frm_BeginForm (ActChgThe);
Par_PutHiddenParamString (NULL,"Theme",The_ThemeId[Theme]);
snprintf (Icon,sizeof (Icon),"%s/%s/theme_32x20.gif",
Cfg_ICON_FOLDER_THEMES,The_ThemeId[Theme]);
Ico_PutSettingIconLink (Icon,The_ThemeNames[Theme]);
Frm_EndForm ();
HTM_DIV_End ();
}
Set_EndOneSettingSelector ();
Set_EndSettingsHead ();
Set_BeginSettingsHead ();
Set_BeginOneSettingSelector ();
for (Theme = (The_Theme_t) 0;
Theme <= (The_Theme_t) (The_NUM_THEMES - 1);
Theme++)
{
HTM_DIV_Begin ("class=\"%s\"",Theme == Gbl.Prefs.Theme ? "PREF_ON" :
"PREF_OFF");
Frm_BeginForm (ActChgThe);
Par_PutHiddenParamString (NULL,"Theme",The_ThemeId[Theme]);
snprintf (Icon,sizeof (Icon),"%s/%s/theme_32x20.gif",
Cfg_ICON_FOLDER_THEMES,The_ThemeId[Theme]);
Ico_PutSettingIconLink (Icon,The_ThemeNames[Theme]);
Frm_EndForm ();
HTM_DIV_End ();
}
Set_EndOneSettingSelector ();
Set_EndSettingsHead ();
Box_BoxEnd ();
}
@ -370,12 +371,7 @@ void The_ChangeTheme (void)
/***** Store theme in database *****/
if (Gbl.Usrs.Me.Logged)
DB_QueryUPDATE ("can not update your setting about theme",
"UPDATE usr_data"
" SET Theme='%s'"
" WHERE UsrCod=%ld",
The_ThemeId[Gbl.Prefs.Theme],
Gbl.Usrs.Me.UsrDat.UsrCod);
Set_DB_UpdateMySettingsAboutTheme (The_ThemeId[Gbl.Prefs.Theme]);
/***** Set settings from current IP *****/
Set_SetSettingsFromIP ();