swad-core/swad_maintenance.c

97 lines
3.5 KiB
C
Raw Permalink Normal View History

2020-01-30 20:47:00 +01:00
// swad_maintenance.c: platform maintenance
2014-12-01 23:55:08 +01:00
/*
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-2024 Antonio Ca<EFBFBD>as Vargas
2014-12-01 23:55:08 +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_list.h"
2020-01-30 20:47:00 +01:00
#include "swad_course.h"
2014-12-01 23:55:08 +01:00
#include "swad_database.h"
#include "swad_match_print.h"
2020-01-30 20:47:00 +01:00
#include "swad_menu.h"
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/***************************** Private prototypes ****************************/
/*****************************************************************************/
2020-01-30 20:47:00 +01:00
static void Mtn_PutLinkToSetUp (void);
/*****************************************************************************/
/******************************** Maintenance ********************************/
/*****************************************************************************/
void Mtn_Maintenance (void)
{
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Mtn_PutLinkToSetUp (); // Set up
Crs_PutLinkToRemoveOldCrss (); // Remove old courses
2020-01-30 20:47:00 +01:00
Mnu_ContextMenuEnd ();
}
/*****************************************************************************/
/************************ Put link to set up platform ************************/
/*****************************************************************************/
static void Mtn_PutLinkToSetUp (void)
{
extern const char *Txt_Set_up;
/***** Put form to set up platform *****/
2020-03-26 02:54:30 +01:00
Lay_PutContextualLinkIconText (ActSetUp,NULL,
NULL,NULL,
"bolt.svg",Ico_BLACK,
Txt_Set_up,NULL);
2020-01-30 20:47:00 +01:00
}
2014-12-01 23:55:08 +01:00
/*****************************************************************************/
/****************************** Initial set up *******************************/
/*****************************************************************************/
2020-01-30 20:47:00 +01:00
void Mtn_SetUp (void)
2014-12-01 23:55:08 +01:00
{
2020-01-30 20:47:00 +01:00
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Crs_PutLinkToRemoveOldCrss (); // Remove old courses
2020-01-30 20:47:00 +01:00
Mnu_ContextMenuEnd ();
/***** Create database tables if not exist *****/
2014-12-01 23:55:08 +01:00
DB_CreateTablesIfNotExist ();
}
2020-01-30 20:47:00 +01:00
/*****************************************************************************/
/****************************** Initial set up *******************************/
/*****************************************************************************/
void Mtn_RemoveOldCrss (void)
{
/***** Contextual menu *****/
Mnu_ContextMenuBegin ();
Mtn_PutLinkToSetUp (); // Set up
2020-01-30 20:47:00 +01:00
Mnu_ContextMenuEnd ();
/***** Write form to remove old courses *****/
Crs_AskRemoveOldCrss ();
}