-
-#include "swad_box.h"
-#include "swad_calendar.h"
-#include "swad_config.h"
-#include "swad_cookie.h"
-#include "swad_database.h"
-#include "swad_date.h"
-#include "swad_form.h"
-#include "swad_global.h"
-#include "swad_language.h"
-#include "swad_layout.h"
-#include "swad_notification.h"
-#include "swad_menu.h"
-#include "swad_parameter.h"
-#include "swad_preference.h"
-#include "swad_privacy.h"
-
-/*****************************************************************************/
-/*************** External global variables from others modules ***************/
-/*****************************************************************************/
-
-extern struct Globals Gbl;
-
-/*****************************************************************************/
-/****************************** Private constants ****************************/
-/*****************************************************************************/
-
-/*****************************************************************************/
-/****************************** Private prototypes ***************************/
-/*****************************************************************************/
-
-static void Pre_PutIconsToSelectSideCols (void);
-static void Pre_PutIconsSideColumns (void);
-static void Pre_UpdateSideColsOnUsrDataTable (void);
-
-/*****************************************************************************/
-/***************************** Edit preferences ******************************/
-/*****************************************************************************/
-
-void Pre_EditPrefs (void)
- {
- extern const char *Hlp_PROFILE_Preferences_internationalization;
- extern const char *Hlp_PROFILE_Preferences_design;
- extern const char *Txt_Internationalization;
- extern const char *Txt_Design;
-
- /***** Internationalization: language, first day of week, date format *****/
- Box_StartBox (NULL,Txt_Internationalization,NULL,
- Hlp_PROFILE_Preferences_internationalization,Box_NOT_CLOSABLE);
- fprintf (Gbl.F.Out,"");
- Lan_PutBoxToSelectLanguage (); // 1. Language
- fprintf (Gbl.F.Out,"
"
- "");
- Cal_PutIconsToSelectFirstDayOfWeek (); // 2. First day of week
- fprintf (Gbl.F.Out,"
"
- "");
- Dat_PutBoxToSelectDateFormat (); // 3. Date format
- fprintf (Gbl.F.Out,"
");
- Box_EndBox ();
-
- /***** Design: icon set, menu, theme, side columns *****/
- Box_StartBox (NULL,Txt_Design,NULL,
- Hlp_PROFILE_Preferences_design,Box_NOT_CLOSABLE);
- fprintf (Gbl.F.Out,"");
- Ico_PutIconsToSelectIconSet (); // 4. Icon set
- fprintf (Gbl.F.Out,"
"
- "");
- Mnu_PutIconsToSelectMenu (); // 5. Menu
- fprintf (Gbl.F.Out,"
"
- "");
- The_PutIconsToSelectTheme (); // 6. Theme
- fprintf (Gbl.F.Out,"
"
- "");
- Pre_PutIconsToSelectSideCols (); // 7. Side columns
- fprintf (Gbl.F.Out,"
");
- Box_EndBox ();
-
- if (Gbl.Usrs.Me.Logged)
- {
- /***** Form to set my preferences on privacy *****/
- Pri_EditMyPrivacy ();
-
- /***** Form to set my preferences on cookies *****/
- Coo_EditMyPrefsOnCookies ();
-
- /***** Automatic email to notify of new events *****/
- Ntf_PutFormChangeNotifSentByEMail ();
- }
- }
-
-/*****************************************************************************/
-/******************* Get preferences changed from current IP *****************/
-/*****************************************************************************/
-
-void Pre_GetPrefsFromIP (void)
- {
- unsigned long NumRows;
- MYSQL_RES *mysql_res;
- MYSQL_ROW row;
-
- if (Gbl.IP[0])
- {
- /***** Get preferences from database *****/
- NumRows = DB_QuerySELECT (&mysql_res,"can not get preferences",
- "SELECT FirstDayOfWeek,DateFormat,Theme,IconSet,Menu,SideCols"
- " FROM IP_prefs WHERE IP='%s'",
- Gbl.IP);
- if (NumRows)
- {
- if (NumRows != 1)
- Lay_ShowErrorAndExit ("Internal error while getting preferences.");
-
- /***** Get preferences from database *****/
- row = mysql_fetch_row (mysql_res);
-
- /* Get first day of week (row[0]) */
- Gbl.Prefs.FirstDayOfWeek = Cal_GetFirstDayOfWeekFromStr (row[0]);
-
- /* Get date format (row[1]) */
- Gbl.Prefs.DateFormat = Dat_GetDateFormatFromStr (row[1]);
-
- /* Get theme (row[2]) */
- Gbl.Prefs.Theme = The_GetThemeFromStr (row[2]);
-
- /* Get icon set (row[3]) */
- Gbl.Prefs.IconSet = Ico_GetIconSetFromStr (row[3]);
-
- /* Get menu (row[4]) */
- Gbl.Prefs.Menu = Mnu_GetMenuFromStr (row[4]);
-
- /* Get if user wants to show side columns (row[5]) */
- if (sscanf (row[5],"%u",&Gbl.Prefs.SideCols) == 1)
- {
- if (Gbl.Prefs.SideCols > Lay_SHOW_BOTH_COLUMNS)
- Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
- }
- else
- Gbl.Prefs.SideCols = Cfg_DEFAULT_COLUMNS;
- }
- }
- }
-
-/*****************************************************************************/
-/************************ Set preferences from current IP ********************/
-/*****************************************************************************/
-
-void Pre_SetPrefsFromIP (void)
- {
- extern const char *The_ThemeId[The_NUM_THEMES];
- extern const char *Ico_IconSetId[Ico_NUM_ICON_SETS];
-
- /***** Update preferences from current IP in database *****/
- DB_QueryREPLACE ("can not store preferences from current IP address",
- "REPLACE INTO IP_prefs"
- " (IP,UsrCod,LastChange,"
- "FirstDayOfWeek,DateFormat,Theme,IconSet,Menu,SideCols)"
- " VALUES"
- " ('%s',%ld,NOW(),"
- "%u,%u,'%s','%s',%u,%u)",
- Gbl.IP,Gbl.Usrs.Me.UsrDat.UsrCod,
- Gbl.Prefs.FirstDayOfWeek,
- (unsigned) Gbl.Prefs.DateFormat,
- The_ThemeId[Gbl.Prefs.Theme],
- Ico_IconSetId[Gbl.Prefs.IconSet],
- (unsigned) Gbl.Prefs.Menu,
- Gbl.Prefs.SideCols);
-
- /***** If a user is logged, update its preferences in database for all its IP's *****/
- if (Gbl.Usrs.Me.Logged)
- DB_QueryUPDATE ("can not update your preferences",
- "UPDATE IP_prefs"
- " SET FirstDayOfWeek=%u,DateFormat=%u,"
- "Theme='%s',IconSet='%s',Menu=%u,SideCols=%u"
- " WHERE UsrCod=%ld",
- Gbl.Prefs.FirstDayOfWeek,
- (unsigned) Gbl.Prefs.DateFormat,
- The_ThemeId[Gbl.Prefs.Theme],
- Ico_IconSetId[Gbl.Prefs.IconSet],
- (unsigned) Gbl.Prefs.Menu,
- Gbl.Prefs.SideCols,
- Gbl.Usrs.Me.UsrDat.UsrCod);
- }
-
-/*****************************************************************************/
-/*********************** Remove old preferences from IP **********************/
-/*****************************************************************************/
-
-void Pre_RemoveOldPrefsFromIP (void)
- {
- /***** Remove old preferences *****/
- DB_QueryDELETE ("can not remove old preferences",
- "DELETE LOW_PRIORITY FROM IP_prefs"
- " WHERE LastChange",
- SideCols == Gbl.Prefs.SideCols ? "PREF_ON" :
- "PREF_OFF");
- Frm_StartForm (ActChgCol);
- Par_PutHiddenParamUnsigned ("SideCols",SideCols);
- snprintf (Icon,sizeof (Icon),
- "layout%u%u_32x20.gif",
- SideCols >> 1,SideCols & 1);
- Ico_PutPrefIconLink (Icon,Txt_LAYOUT_SIDE_COLUMNS[SideCols]);
- Frm_EndForm ();
- fprintf (Gbl.F.Out,"");
- }
- Pre_EndOnePrefSelector ();
- Pre_EndPrefsHead ();
- Box_EndBox ();
- }
-
-/*****************************************************************************/
-/************* Put contextual icons in side-columns preference ***************/
-/*****************************************************************************/
-
-static void Pre_PutIconsSideColumns (void)
- {
- /***** Put icon to show a figure *****/
- Gbl.Figures.FigureType = Fig_SIDE_COLUMNS;
- Fig_PutIconToShowFigure ();
- }
-
-/*****************************************************************************/
-/*********************** Change layout of side columns ***********************/
-/*****************************************************************************/
-
-void Pre_ChangeSideCols (void)
- {
- /***** Get param side-columns *****/
- Gbl.Prefs.SideCols = Pre_GetParamSideCols ();
-
- /***** Store side colums in database *****/
- if (Gbl.Usrs.Me.Logged)
- Pre_UpdateSideColsOnUsrDataTable ();
-
- /***** Set preferences from current IP *****/
- Pre_SetPrefsFromIP ();
- }
-
-/*****************************************************************************/
-/*************************** Hide left side column ***************************/
-/*****************************************************************************/
-
-void Pre_HideLeftCol (void)
- {
- Gbl.Prefs.SideCols &= ~Lay_SHOW_LEFT_COLUMN; // And with 1...101 to hide left column
- if (Gbl.Usrs.Me.Logged)
- Pre_UpdateSideColsOnUsrDataTable ();
-
- /***** Set preferences from current IP *****/
- Pre_SetPrefsFromIP ();
- }
-
-/*****************************************************************************/
-/*************************** Hide right side column **************************/
-/*****************************************************************************/
-
-void Pre_HideRightCol (void)
- {
- Gbl.Prefs.SideCols &= ~Lay_SHOW_RIGHT_COLUMN; // And with 1...110 to hide right column
- if (Gbl.Usrs.Me.Logged)
- Pre_UpdateSideColsOnUsrDataTable ();
-
- /***** Set preferences from current IP *****/
- Pre_SetPrefsFromIP ();
- }
-
-/*****************************************************************************/
-/**************************** Show left side column **************************/
-/*****************************************************************************/
-
-void Pre_ShowLeftCol (void)
- {
- Gbl.Prefs.SideCols |= Lay_SHOW_LEFT_COLUMN; // Or with 10 to show left column
- if (Gbl.Usrs.Me.Logged)
- Pre_UpdateSideColsOnUsrDataTable ();
-
- /***** Set preferences from current IP *****/
- Pre_SetPrefsFromIP ();
- }
-
-/*****************************************************************************/
-/**************************** Show right side column *************************/
-/*****************************************************************************/
-
-void Pre_ShowRightCol (void)
- {
- Gbl.Prefs.SideCols |= Lay_SHOW_RIGHT_COLUMN; // Or with 01 to show right column
- if (Gbl.Usrs.Me.Logged)
- Pre_UpdateSideColsOnUsrDataTable ();
-
- /***** Set preferences from current IP *****/
- Pre_SetPrefsFromIP ();
- }
-
-/*****************************************************************************/
-/************** Update layout of side colums on user data table **************/
-/*****************************************************************************/
-
-static void Pre_UpdateSideColsOnUsrDataTable (void)
- {
- DB_QueryUPDATE ("can not update your preference about side columns",
- "UPDATE usr_data SET SideCols=%u"
- " WHERE UsrCod=%ld",
- Gbl.Prefs.SideCols,Gbl.Usrs.Me.UsrDat.UsrCod);
- }
-
-/*****************************************************************************/
-/************** Get parameter used to show/hide side columns *****************/
-/*****************************************************************************/
-
-unsigned Pre_GetParamSideCols (void)
- {
- return (unsigned) Par_GetParToUnsignedLong ("SideCols",
- 0,
- Lay_SHOW_BOTH_COLUMNS,
- Cfg_DEFAULT_COLUMNS);
- }
-
-/*****************************************************************************/
-/********** Head to select one or several preferences using icons ************/
-/*****************************************************************************/
-/*
- +-- Container for several pref. selectors ---+
- | +One pref.selector+ +One pref.selector+ |
- | | +-----+ +-----+ | | +-----+ +-----+ | |
- | | |Icon | |Icon | | | |Icon | |Icon | | |
- | | |opt.A| |opt.B| | | |opt.A| |opt.B| | |
- | | +-----+ +-----+ | | +-----+ +-----+ | |
- | +-----------------+ +-----------------+ |
- +--------------------------------------------+
-*/
-void Pre_StartPrefsHead (void)
- {
- fprintf (Gbl.F.Out,"");
- }
-
-void Pre_EndPrefsHead (void)
- {
- fprintf (Gbl.F.Out,"
");
- }
-
-void Pre_StartOnePrefSelector (void)
- {
- fprintf (Gbl.F.Out,"");
- }
-
-void Pre_EndOnePrefSelector (void)
- {
- fprintf (Gbl.F.Out,"
");
- }
diff --git a/swad_preference.h b/swad_preference.h
deleted file mode 100644
index 8118145b..00000000
--- a/swad_preference.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// swad_preference.h: user's preferences
-
-#ifndef _SWAD_PRE
-#define _SWAD_PRE
-/*
- 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-2019 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 .
-*/
-/*****************************************************************************/
-/********************************* Headers ***********************************/
-/*****************************************************************************/
-
-/*****************************************************************************/
-/***************************** Public constants ******************************/
-/*****************************************************************************/
-
-/*****************************************************************************/
-/******************************* Public types ********************************/
-/*****************************************************************************/
-
-/*****************************************************************************/
-/***************************** Public prototypes *****************************/
-/*****************************************************************************/
-
-void Pre_EditPrefs (void);
-
-void Pre_GetPrefsFromIP (void);
-void Pre_SetPrefsFromIP (void);
-void Pre_RemoveOldPrefsFromIP (void);
-
-void Pre_ChangeSideCols (void);
-void Pre_HideLeftCol (void);
-void Pre_HideRightCol (void);
-void Pre_ShowLeftCol (void);
-void Pre_ShowRightCol (void);
-unsigned Pre_GetParamSideCols (void);
-
-void Pre_StartPrefsHead (void);
-void Pre_EndPrefsHead (void);
-void Pre_StartOnePrefSelector (void);
-void Pre_EndOnePrefSelector (void);
-
-#endif
diff --git a/swad_privacy.c b/swad_privacy.c
index 88656c0e..18c42071 100644
--- a/swad_privacy.c
+++ b/swad_privacy.c
@@ -78,26 +78,26 @@ static void Pri_PutFormVisibility (const char *TxtLabel,
void Pri_EditMyPrivacy (void)
{
- extern const char *Hlp_PROFILE_Preferences_privacy;
- extern const char *Txt_Please_review_your_privacy_preferences;
+ extern const char *Hlp_PROFILE_Settings_privacy;
+ extern const char *Txt_Please_check_your_privacy_settings;
extern const char *Txt_Privacy;
extern const char *Txt_Photo;
extern const char *Txt_Basic_public_profile;
extern const char *Txt_Extended_public_profile;
extern const char *Txt_Timeline;
- /***** Start section with preferences on privacy *****/
+ /***** Start section with settings on privacy *****/
Lay_StartSection (Pri_PRIVACY_ID);
- /***** If any of my preferences about privacy is unknown *****/
+ /***** If any of my settings about privacy is unknown *****/
if (Gbl.Usrs.Me.UsrDat.PhotoVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.BaPrfVisibility == Pri_VISIBILITY_UNKNOWN ||
Gbl.Usrs.Me.UsrDat.ExPrfVisibility == Pri_VISIBILITY_UNKNOWN)
- Ale_ShowAlert (Ale_WARNING,Txt_Please_review_your_privacy_preferences);
+ Ale_ShowAlert (Ale_WARNING,Txt_Please_check_your_privacy_settings);
/***** Start box and table *****/
Box_StartBoxTable (NULL,Txt_Privacy,Pri_PutIconsPrivacy,
- Hlp_PROFILE_Preferences_privacy,Box_NOT_CLOSABLE,2);
+ Hlp_PROFILE_Settings_privacy,Box_NOT_CLOSABLE,2);
/***** Edit photo visibility *****/
Pri_PutFormVisibility (Txt_Photo,
@@ -126,12 +126,12 @@ void Pri_EditMyPrivacy (void)
/***** End table and box *****/
Box_EndBoxTable ();
- /***** End section with preferences on privacy *****/
+ /***** End section with settings on privacy *****/
Lay_EndSection ();
}
/*****************************************************************************/
-/***************** Put contextual icons in privacy preference ****************/
+/****************** Put contextual icons in privacy setting ******************/
/*****************************************************************************/
static void Pri_PutIconsPrivacy (void)
diff --git a/swad_profile.c b/swad_profile.c
index efae99ab..37470708 100644
--- a/swad_profile.c
+++ b/swad_profile.c
@@ -39,11 +39,11 @@
#include "swad_nickname.h"
#include "swad_notification.h"
#include "swad_parameter.h"
-#include "swad_preference.h"
#include "swad_privacy.h"
#include "swad_profile.h"
#include "swad_role.h"
#include "swad_role_type.h"
+#include "swad_setting.h"
#include "swad_theme.h"
#include "swad_timeline.h"
#include "swad_user.h"
@@ -357,7 +357,7 @@ void Prf_ChangeBasicProfileVis (void)
Pri_BASIC_PROFILE_ALLOWED_VIS);
/***** Store public/private photo in database *****/
- DB_QueryUPDATE ("can not update your preference"
+ DB_QueryUPDATE ("can not update your setting"
" about public profile visibility",
"UPDATE usr_data SET BaPrfVisibility='%s'"
" WHERE UsrCod=%ld",
@@ -365,7 +365,7 @@ void Prf_ChangeBasicProfileVis (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show form again *****/
- Pre_EditPrefs ();
+ Set_EditSettings ();
}
void Prf_ChangeExtendedProfileVis (void)
@@ -377,7 +377,7 @@ void Prf_ChangeExtendedProfileVis (void)
Pri_EXTENDED_PROFILE_ALLOWED_VIS);
/***** Store public/private photo in database *****/
- DB_QueryUPDATE ("can not update your preference"
+ DB_QueryUPDATE ("can not update your setting"
" about public profile visibility",
"UPDATE usr_data SET ExPrfVisibility='%s'"
" WHERE UsrCod=%ld",
@@ -385,7 +385,7 @@ void Prf_ChangeExtendedProfileVis (void)
Gbl.Usrs.Me.UsrDat.UsrCod);
/***** Show form again *****/
- Pre_EditPrefs ();
+ Set_EditSettings ();
}
/*****************************************************************************/
diff --git a/swad_project.c b/swad_project.c
index f1e37156..6cd7b876 100644
--- a/swad_project.c
+++ b/swad_project.c
@@ -41,8 +41,8 @@
#include "swad_pagination.h"
#include "swad_parameter.h"
#include "swad_photo.h"
-#include "swad_preference.h"
#include "swad_project.h"
+#include "swad_setting.h"
#include "swad_string.h"
#include "swad_table.h"
@@ -268,7 +268,7 @@ static void Prj_ShowProjectsInCurrentPage (void)
/***** Put forms to choice which projects to show *****/
/* 1st. row */
- Pre_StartPrefsHead ();
+ Set_StartSettingsHead ();
Prj_ShowFormToFilterByMy_All ();
Prj_ShowFormToFilterByPreassignedNonPreassig ();
switch (Gbl.Usrs.Me.Role.Logged)
@@ -281,7 +281,7 @@ static void Prj_ShowProjectsInCurrentPage (void)
default: // Students will see only visible projects
break;
}
- Pre_EndPrefsHead ();
+ Set_EndSettingsHead ();
/* 2nd. row */
Prj_ShowFormToFilterByDpt ();
@@ -368,7 +368,7 @@ static void Prj_ShowFormToFilterByMy_All (void)
"sitemap.svg", // Prj_ALL_PROJECTS
};
- Pre_StartOnePrefSelector ();
+ Set_StartOneSettingSelector ();
for (My_All = (Prj_WhoseProjects_t) 0;
My_All <= (Prj_WhoseProjects_t) (Prj_NUM_WHOSE_PROJECTS - 1);
My_All++)
@@ -385,12 +385,12 @@ static void Prj_ShowFormToFilterByMy_All (void)
Gbl.Prjs.SelectedOrder,
Gbl.Prjs.CurrentPage,
-1L);
- Ico_PutPrefIconLink (WhoseProjectsIcon[My_All],
+ Ico_PutSettingIconLink (WhoseProjectsIcon[My_All],
Txt_PROJECT_MY_ALL_PROJECTS[My_All]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"");
}
- Pre_EndOnePrefSelector ();
+ Set_EndOneSettingSelector ();
}
/*****************************************************************************/
@@ -403,7 +403,7 @@ static void Prj_ShowFormToFilterByPreassignedNonPreassig (void)
struct Prj_Filter Filter;
Prj_PreassignedNonpreassig_t PreNon;
- Pre_StartOnePrefSelector ();
+ Set_StartOneSettingSelector ();
for (PreNon = (Prj_PreassignedNonpreassig_t) 0;
PreNon <= (Prj_PreassignedNonpreassig_t) (Prj_NUM_PREASSIGNED_NONPREASSIG - 1);
PreNon++)
@@ -420,12 +420,12 @@ static void Prj_ShowFormToFilterByPreassignedNonPreassig (void)
Gbl.Prjs.SelectedOrder,
Gbl.Prjs.CurrentPage,
-1L);
- Ico_PutPrefIconLink (PreassignedNonpreassigImage[PreNon],
+ Ico_PutSettingIconLink (PreassignedNonpreassigImage[PreNon],
Txt_PROJECT_PREASSIGNED_NONPREASSIGNED_PLURAL[PreNon]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"");
}
- Pre_EndOnePrefSelector ();
+ Set_EndOneSettingSelector ();
}
/*****************************************************************************/
@@ -443,7 +443,7 @@ static void Prj_ShowFormToFilterByHidden (void)
"eye.svg", // Prj_VISIBL
};
- Pre_StartOnePrefSelector ();
+ Set_StartOneSettingSelector ();
for (HidVis = (Prj_HiddenVisibl_t) 0;
HidVis <= (Prj_HiddenVisibl_t) (Prj_NUM_HIDDEN_VISIBL - 1);
HidVis++)
@@ -460,12 +460,12 @@ static void Prj_ShowFormToFilterByHidden (void)
Gbl.Prjs.SelectedOrder,
Gbl.Prjs.CurrentPage,
-1L);
- Ico_PutPrefIconLink (HiddenVisiblIcon[HidVis],
+ Ico_PutSettingIconLink (HiddenVisiblIcon[HidVis],
Txt_PROJECT_HIDDEN_VISIBL_PROJECTS[HidVis]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"");
}
- Pre_EndOnePrefSelector ();
+ Set_EndOneSettingSelector ();
}
/*****************************************************************************/
diff --git a/swad_record.c b/swad_record.c
index 0cad1167..1105c52a 100644
--- a/swad_record.c
+++ b/swad_record.c
@@ -44,11 +44,11 @@
#include "swad_network.h"
#include "swad_parameter.h"
#include "swad_photo.h"
-#include "swad_preference.h"
#include "swad_privacy.h"
#include "swad_QR.h"
#include "swad_record.h"
#include "swad_role.h"
+#include "swad_setting.h"
#include "swad_table.h"
#include "swad_user.h"
diff --git a/swad_setup.c b/swad_setup.c
index 20e2dd52..05432924 100644
--- a/swad_setup.c
+++ b/swad_setup.c
@@ -51,7 +51,7 @@
/****************************** Initial set up *******************************/
/*****************************************************************************/
-void Set_Setup (void)
+void SUp_SetUp (void)
{
/***** Create tables in database *****/
DB_CreateTablesIfNotExist ();
diff --git a/swad_setup.h b/swad_setup.h
index 859f8fb6..c6830a4b 100644
--- a/swad_setup.h
+++ b/swad_setup.h
@@ -1,7 +1,7 @@
// swad_setup.h: initial setup after installation
-#ifndef _SWAD_SET
-#define _SWAD_SET
+#ifndef _SWAD_SUP
+#define _SWAD_SUP
/*
SWAD (Shared Workspace At a Distance in Spanish),
is a web platform developed at the University of Granada (Spain),
@@ -35,6 +35,6 @@
/***************************** Public prototypes *****************************/
/*****************************************************************************/
-void Set_Setup (void);
+void SUp_SetUp (void);
#endif
diff --git a/swad_survey.c b/swad_survey.c
index 80bf5f93..ca90147a 100644
--- a/swad_survey.c
+++ b/swad_survey.c
@@ -40,8 +40,8 @@
#include "swad_notification.h"
#include "swad_pagination.h"
#include "swad_parameter.h"
-#include "swad_preference.h"
#include "swad_role.h"
+#include "swad_setting.h"
#include "swad_survey.h"
#include "swad_table.h"
@@ -230,9 +230,9 @@ static void Svy_ListAllSurveys (struct SurveyQuestion *SvyQst)
/***** Select whether show only my groups or all groups *****/
if (Gbl.CurrentCrs.Grps.NumGrps)
{
- Pre_StartPrefsHead ();
+ Set_StartSettingsHead ();
Grp_ShowFormToSelWhichGrps (ActSeeAllSvy,Svy_ParamsWhichGroupsToShow);
- Pre_EndPrefsHead ();
+ Set_EndSettingsHead ();
}
if (Gbl.Svys.Num)
diff --git a/swad_test.c b/swad_test.c
index 9c953c0f..7b37f8f6 100644
--- a/swad_test.c
+++ b/swad_test.c
@@ -7317,7 +7317,7 @@ void Tst_SelUsrsToSeeUsrsTestResults (void)
/***** Get and update type of list,
number of columns in class photo
- and preference about view photos *****/
+ and preference about viewing photos *****/
Usr_GetAndUpdatePrefsAboutUsrList ();
/***** Get groups to show ******/
diff --git a/swad_text.c b/swad_text.c
index 1ec7b069..440223e9 100644
--- a/swad_text.c
+++ b/swad_text.c
@@ -19778,7 +19778,7 @@ const char *Txt_MENU_TITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Cartão"
#endif
,
- // 6: ActReqEdiPrf
+ // 6: ActReqEdiSet
#if L==1 // ca
"Configuració"
#elif L==2 // de
@@ -21645,25 +21645,25 @@ const char *Txt_MENU_SUBTITLE[Tab_NUM_TABS][Act_MAX_OPTIONS_IN_MENU_PER_TAB] =
"Cartão"
#endif
,
- // 6: ActReqEdiPrf
+ // 6: ActReqEdiSet
#if L==1 // ca
- "Les meves preferències (idioma, colors, notificacions …)"
+ "Els meus ajustos (idioma, colors, notificacions…)"
#elif L==2 // de
- "Einstellungen"
+ "Meine Einstellungen (Sprache, Farben, Benachrichtigungen…)"
#elif L==3 // en
- "Preferences"
+ "My settings (language, colors, notifications…)"
#elif L==4 // es
- "Mis preferencias (idioma, colores, notificaciones…)"
+ "Mis ajustes (idioma, colores, notificaciones…)"
#elif L==5 // fr
- "Préférences"
+ "Mes paramètres (langue, couleurs, notifications…)"
#elif L==6 // gn
- "Mis preferencias (idioma, colores, notificaciones…)" // Okoteve traducción
+ "Mis ajustes (idioma, colores, notificaciones…)" // Okoteve traducción
#elif L==7 // it
- "Preferenze"
+ "Le mie impostazioni (lingua, colori, notifiche…)"
#elif L==8 // pl
- "Preferencje"
+ "Moje ustawienia (język, kolory, powiadomienia…)"
#elif L==9 // pt
- "Preferências"
+ "Minhas configurações (idioma, cores, notificações…)"
#endif
,
NULL, // 7
@@ -29161,25 +29161,25 @@ const char *Txt_Please_fill_in_your_record_card_including_your_sex =
" incluindo o seu sexo.";
#endif
-const char *Txt_Please_review_your_privacy_preferences =
+const char *Txt_Please_check_your_privacy_settings =
#if L==1 // ca
- "Si us plau, revisi les seves preferències de privacitat.";
+ "Si us plau, comproveu la seva configuració de privacitat.";
#elif L==2 // de
"Bitte überprüfen Sie Ihre Datenschutzeinstellungen.";
#elif L==3 // en
- "Please review your privacy preferences.";
+ "Please review your privacy settings.";
#elif L==4 // es
- "Por favor, revise sus preferencias de privacidad.";
+ "Por favor, revise sus ajustes de privacidad.";
#elif L==5 // fr
- "S'il vous plaît revoir vos préférences de privacité.";
+ "S'il vous plaît, vérifiez vos paramètres de privacité.";
#elif L==6 // gn
- "Por favor, revise sus preferencias de privacidad."; // Okoteve traducción
+ "Por favor, revise sus ajustes de privacidad."; // Okoteve traducción
#elif L==7 // it
- "Si prega di rivedere le vostre preferenze di privatezza.";
+ "Per favore, controlla le tue impostazioni sulla privacy.";
#elif L==8 // pl
- "Proszę sprawdzić ustawienia prywatności.";
+ "Sprawdź ustawienia prywatności.";
#elif L==9 // pt
- "Por favor, revise suas preferências de privacidade.";
+ "Por favor, verifique suas configurações de privacidade.";
#endif
const char *Txt_Please_select_the_country_of_your_institution =
@@ -56537,25 +56537,25 @@ const char *Txt_Your_personal_data_have_been_updated =
"Seus dados pessoais foram atualizados.";
#endif
-const char *Txt_Your_preferences_about_notifications_have_changed =
+const char *Txt_Your_settings_about_notifications_have_changed =
#if L==1 // ca
- "Les seves preferències sobre les notificacions han canviat.";
+ "La seva configuració de les notificacions ha canviat.";
#elif L==2 // de
- "Your preferences about notifications have changed."; // Need Übersetzung
+ "Ihre Einstellungen zu Benachrichtigungen haben sich geändert.";
#elif L==3 // en
- "Your preferences about notifications have changed.";
+ "Your settings about notifications have changed.";
#elif L==4 // es
- "Sus preferencias sobre las notificaciones han cambiado.";
+ "Sus ajustes sobre las notificaciones han cambiado.";
#elif L==5 // fr
- "Your preferences about notifications have changed."; // Besoin de traduction
+ "Vos paramètres concernant les notifications ont changé.";
#elif L==6 // gn
- "Sus preferencias sobre las notificaciones han cambiado."; // Okoteve traducción
+ "Sus ajustes sobre las notificaciones han cambiado."; // Okoteve traducción
#elif L==7 // it
- "Le tue preferenze sulle notifiche sono cambiate.";
+ "Le tue impostazioni sulle notifiche sono cambiate.";
#elif L==8 // pl
- "Your preferences about notifications have changed."; // Potrzebujesz tlumaczenie
+ "Twoje ustawienia dotyczące powiadomień uległy zmianie.";
#elif L==9 // pt
- "Suas preferências sobre notificações foram alteradas.";
+ "Suas configurações sobre notificações foram alteradas.";
#endif
const char *Txt_Your_record_card_in_this_course_has_been_updated =
diff --git a/swad_text_no_html.c b/swad_text_no_html.c
index 1f82298d..99b12e6f 100644
--- a/swad_text_no_html.c
+++ b/swad_text_no_html.c
@@ -320,23 +320,23 @@ const char *Txt_If_you_no_longer_wish_to_receive_email_notifications_NO_HTML[1 +
{
"",
"Si no desitgeu rebre més avisos per correu,"
- " desactiveu la opció corresponent en les preferències del seu perfil.",
+ " desactiveu la opció corresponent en els ajustos del seu perfil.",
"Wenn Sie nicht mehr erhalten möchten, E-Mail-Benachrichtigungen,"
- " Deaktivieren Sie die Option in den Einstellungen Ihres Profils.",
+ " Deaktivieren Sie die Option in Ihren Profileinstellungen.",
"If you no longer wish to receive email notifications,"
- " uncheck the option in the preferences of your profile.",
+ " uncheck the option in your profile settings.",
"Si no desea recibir más avisos por correo,"
- " desactive la opción correspondiente en las preferencias de su perfil.",
+ " desactive la opción correspondiente en los ajustes de su perfil.",
"Si vous ne souhaitez plus recevoir de notifications par email,"
- " décochez l'option dans les préférences de votre profil.",
+ " décochez l'option dans les paramètres de votre profil.",
"Si no desea recibir más avisos por correo,"
- " desactive la opción correspondiente en las preferencias de su perfil.", // Okoteve traducción
+ " desactive la opción correspondiente en los ajustes de su perfil.", // Okoteve traducción
"Se non desideri più ricevere notifiche via email,"
- " deselezionare l'opzione nelle preferenze del tuo profilo.",
+ " deselezionare l'opzione nelle impostazioni del tuo profilo.",
"Jesli nie chcesz otrzymywac powiadomien email,"
- " usuń zaznaczenie opcje w ustawieniach swojego profilu.",
+ " odznacz opcję w ustawieniach swojego profilu.",
"Se já não desejar receber notificações por email,"
- " desmarque a opção nas preferências do seu perfil.",
+ " desmarque a opção nas configurações do seu perfil.",
};
const char *Txt_Institutions_NO_HTML =
diff --git a/swad_theme.c b/swad_theme.c
index 2bdb56bb..26d84d86 100644
--- a/swad_theme.c
+++ b/swad_theme.c
@@ -35,7 +35,7 @@
#include "swad_global.h"
#include "swad_layout.h"
#include "swad_parameter.h"
-#include "swad_preference.h"
+#include "swad_setting.h"
#include "swad_theme.h"
/*****************************************************************************/
@@ -261,15 +261,15 @@ static void The_PutIconsTheme (void);
void The_PutIconsToSelectTheme (void)
{
- extern const char *Hlp_PROFILE_Preferences_theme;
+ extern const char *Hlp_PROFILE_Settings_theme;
extern const char *Txt_Theme_SKIN;
The_Theme_t Theme;
char Icon[PATH_MAX + 1];
Box_StartBox (NULL,Txt_Theme_SKIN,The_PutIconsTheme,
- Hlp_PROFILE_Preferences_theme,Box_NOT_CLOSABLE);
- Pre_StartPrefsHead ();
- Pre_StartOnePrefSelector ();
+ Hlp_PROFILE_Settings_theme,Box_NOT_CLOSABLE);
+ Set_StartSettingsHead ();
+ Set_StartOneSettingSelector ();
for (Theme = (The_Theme_t) 0;
Theme < The_NUM_THEMES;
Theme++)
@@ -283,17 +283,17 @@ void The_PutIconsToSelectTheme (void)
"%s/%s/theme_32x20.gif",
Cfg_ICON_FOLDER_THEMES,
The_ThemeId[Theme]);
- Ico_PutPrefIconLink (Icon,The_ThemeNames[Theme]);
+ Ico_PutSettingIconLink (Icon,The_ThemeNames[Theme]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"");
}
- Pre_EndOnePrefSelector ();
- Pre_EndPrefsHead ();
+ Set_EndOneSettingSelector ();
+ Set_EndSettingsHead ();
Box_EndBox ();
}
/*****************************************************************************/
-/***************** Put contextual icons in theme preference ******************/
+/****************** Put contextual icons in theme setting ********************/
/*****************************************************************************/
static void The_PutIconsTheme (void)
@@ -324,14 +324,14 @@ void The_ChangeTheme (void)
/***** Store theme in database *****/
if (Gbl.Usrs.Me.Logged)
- DB_QueryUPDATE ("can not update your preference about theme",
+ 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 preferences from current IP *****/
- Pre_SetPrefsFromIP ();
+ /***** Set settings from current IP *****/
+ Set_SetSettingsFromIP ();
}
/*****************************************************************************/
diff --git a/swad_timeline.c b/swad_timeline.c
index d4f3ecd9..e03363f4 100644
--- a/swad_timeline.c
+++ b/swad_timeline.c
@@ -45,8 +45,8 @@
#include "swad_notice.h"
#include "swad_notification.h"
#include "swad_parameter.h"
-#include "swad_preference.h"
#include "swad_profile.h"
+#include "swad_setting.h"
#include "swad_timeline.h"
/*****************************************************************************/
@@ -1135,9 +1135,9 @@ static void TL_PutFormWhichUsrs (void)
"users.svg", // TL_USRS_ALL
};
- /***** Preference selector for which users *****/
- Pre_StartPrefsHead ();
- Pre_StartOnePrefSelector ();
+ /***** Setting selector for which users *****/
+ Set_StartSettingsHead ();
+ Set_StartOneSettingSelector ();
for (WhichUsrs = (TL_WhichUsrs_t) 1;
WhichUsrs < TL_NUM_WHICH_USRS;
WhichUsrs++)
@@ -1147,12 +1147,12 @@ static void TL_PutFormWhichUsrs (void)
"PREF_OFF");
Frm_StartForm (ActSeeSocTmlGbl);
Par_PutHiddenParamUnsigned ("WhichUsrs",WhichUsrs);
- Ico_PutPrefIconLink (Icon[WhichUsrs],Txt_TIMELINE_WHICH_USERS[WhichUsrs]);
+ Ico_PutSettingIconLink (Icon[WhichUsrs],Txt_TIMELINE_WHICH_USERS[WhichUsrs]);
Frm_EndForm ();
fprintf (Gbl.F.Out,"");
}
- Pre_EndOnePrefSelector ();
- Pre_EndPrefsHead ();
+ Set_EndOneSettingSelector ();
+ Set_EndSettingsHead ();
/***** Show warning if I do not follow anyone *****/
if (Gbl.Timeline.WhichUsrs == TL_USRS_FOLLOWED)
diff --git a/swad_timetable.c b/swad_timetable.c
index bfdb435c..e559adff 100644
--- a/swad_timetable.c
+++ b/swad_timetable.c
@@ -38,7 +38,7 @@
#include "swad_global.h"
#include "swad_language.h"
#include "swad_parameter.h"
-#include "swad_preference.h"
+#include "swad_setting.h"
#include "swad_timetable.h"
/*****************************************************************************/
@@ -371,8 +371,8 @@ void TT_ShowClassTimeTable (void)
TT_ShowTimeTableGrpsSelected ();
else
{
- /***** Preference selector *****/
- Pre_StartPrefsHead ();
+ /***** Setting selector *****/
+ Set_StartSettingsHead ();
/* Select whether show only my groups or all groups */
if ( Gbl.TimeTable.Type == TT_MY_TIMETABLE ||
@@ -384,7 +384,7 @@ void TT_ShowClassTimeTable (void)
Cal_ShowFormToSelFirstDayOfWeek (ActChgTT1stDay[Gbl.TimeTable.Type],
Grp_PutParamWhichGrps);
- Pre_EndPrefsHead ();
+ Set_EndSettingsHead ();
}
/***** Show the time table *****/
diff --git a/swad_user.c b/swad_user.c
index 2a930abd..39b90d99 100644
--- a/swad_user.c
+++ b/swad_user.c
@@ -57,11 +57,11 @@
#include "swad_notification.h"
#include "swad_parameter.h"
#include "swad_password.h"
-#include "swad_preference.h"
#include "swad_privacy.h"
#include "swad_QR.h"
#include "swad_record.h"
#include "swad_role.h"
+#include "swad_setting.h"
#include "swad_tab.h"
#include "swad_table.h"
#include "swad_user.h"
@@ -549,7 +549,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
"NotifNtfEvents," // row[24]
"EmailNtfEvents," // row[25]
- // Preferences (usually not necessary
+ // Settings (usually not necessary
// when getting another user's data)
"Language," // row[26]
"FirstDayOfWeek," // row[27]
@@ -666,7 +666,7 @@ void Usr_GetUsrDataFromUsrCod (struct UsrData *UsrDat,Usr_GetPrefs_t GetPrefs)
if (UsrDat->NtfEvents.SendEmail >= (1 << Ntf_NUM_NOTIFY_EVENTS)) // Maximum binary value for NotifyEvents is 000...0011...11
UsrDat->NtfEvents.SendEmail = 0;
- /***** Get user's preferences *****/
+ /***** Get user's settings *****/
if (GetPrefs == Usr_GET_PREFS)
{
/* Get language (row[26]) */
@@ -2999,8 +2999,8 @@ void Usr_ChkUsrAndGetUsrData (void)
Act_AdjustCurrentAction ();
Ses_CreateSession ();
- /* Set preferences from current IP */
- Pre_SetPrefsFromIP ();
+ /* Set settings from current IP */
+ Set_SetSettingsFromIP ();
/* Send message via email to confirm the new email address */
Mai_SendMailMsgToConfirmEmail ();
@@ -3040,7 +3040,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Act_AdjustCurrentAction ();
Ses_CreateSession ();
- Pre_SetPrefsFromIP (); // Set preferences from current IP
+ Set_SetSettingsFromIP (); // Set settings from current IP
}
else
{
@@ -3065,7 +3065,7 @@ void Usr_ChkUsrAndGetUsrData (void)
Act_AdjustCurrentAction ();
Ses_CreateSession ();
- Pre_SetPrefsFromIP (); // Set preferences from current IP
+ Set_SetSettingsFromIP (); // Set settings from current IP
}
else
FormLogin.PutForm = true;
@@ -3314,7 +3314,7 @@ static void Usr_ShowAlertThereAreMoreThanOneUsr (void)
}
/*****************************************************************************/
-/********************* Set my preferences and my roles ***********************/
+/********************** Set my settings and my roles *************************/
/*****************************************************************************/
static void Usr_SetMyPrefsAndRoles (void)
@@ -3329,7 +3329,7 @@ static void Usr_SetMyPrefsAndRoles (void)
if (Gbl.Usrs.Me.UsrDat.Prefs.Language == Lan_LANGUAGE_UNKNOWN) // I have not chosen language
Lan_UpdateMyLanguageToCurrentLanguage (); // Update my language in database
- /***** Set preferences from my preferences *****/
+ /***** Set settings from my settings *****/
Gbl.Prefs.FirstDayOfWeek = Gbl.Usrs.Me.UsrDat.Prefs.FirstDayOfWeek;
Gbl.Prefs.DateFormat = Gbl.Usrs.Me.UsrDat.Prefs.DateFormat;
Gbl.Prefs.Menu = Gbl.Usrs.Me.UsrDat.Prefs.Menu;
@@ -5948,8 +5948,8 @@ void Usr_FreeListOtherRecipients (void)
void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction)
{
- Pre_StartPrefsHead ();
- Pre_StartOnePrefSelector ();
+ Set_StartSettingsHead ();
+ Set_StartOneSettingSelector ();
/***** Select Usr_LIST_AS_CLASS_PHOTO *****/
fprintf (Gbl.F.Out,"",
@@ -5982,8 +5982,8 @@ void Usr_ShowFormsToSelectUsrListType (Act_Action_t NextAction)
Frm_EndForm ();
fprintf (Gbl.F.Out,"
");
- Pre_EndOnePrefSelector ();
- Pre_EndPrefsHead ();
+ Set_EndOneSettingSelector ();
+ Set_EndSettingsHead ();
}
/*****************************************************************************/
@@ -6509,7 +6509,7 @@ void Usr_ListAllDataGsts (void)
/***** Get and update type of list,
number of columns in class photo
- and preference about view photos *****/
+ and preference about viewing photos *****/
Usr_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/
@@ -6627,7 +6627,7 @@ void Usr_ListAllDataStds (void)
/***** Get and update type of list,
number of columns in class photo
- and preference about view photos *****/
+ and preference about viewing photos *****/
Usr_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/
@@ -6865,7 +6865,7 @@ void Usr_ListAllDataTchs (void)
/***** Get and update type of list,
number of columns in class photo
- and preference about view photos *****/
+ and preference about viewing photos *****/
Usr_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/
@@ -7133,7 +7133,7 @@ void Usr_ListDataAdms (void)
/***** Get and update type of list,
number of columns in class photo
- and preference about view photos *****/
+ and preference about viewing photos *****/
Usr_GetAndUpdatePrefsAboutUsrList ();
/***** Get scope *****/
@@ -7222,9 +7222,9 @@ void Usr_ListDataAdms (void)
}
/*****************************************************************************/
-/****************** Put hidden parameters with type of list, *****************/
-/****************** number of columns in class photo *************************/
-/****************** and preference about view photos *************************/
+/**************** Put hidden parameters with type of list, *******************/
+/**************** number of columns in class photo *******************/
+/**************** and preference about viewing photos *******************/
/*****************************************************************************/
void Usr_PutParamsPrefsAboutUsrList (void)
@@ -7235,9 +7235,9 @@ void Usr_PutParamsPrefsAboutUsrList (void)
}
/*****************************************************************************/
-/********************* Get and update type of list, **********************/
-/********************* number of columns in class photo **********************/
-/********************* and preference about view photos **********************/
+/****************** Get and update type of list, **********************/
+/****************** number of columns in class photo **********************/
+/****************** and preference about viewing photos **********************/
/*****************************************************************************/
void Usr_GetAndUpdatePrefsAboutUsrList (void)
@@ -7248,7 +7248,7 @@ void Usr_GetAndUpdatePrefsAboutUsrList (void)
/***** Get and update number of columns in class photo *****/
Usr_GetAndUpdateColsClassPhoto ();
- /***** Get and update preference about view photos *****/
+ /***** Get and update preference about viewing photos *****/
Usr_GetAndUpdatePrefAboutListWithPhotos ();
}