ZwiiCampus/core/module/maintenance/maintenance.php

57 lines
1.7 KiB
PHP
Raw Normal View History

<?php
/**
* This file is part of Zwii.
* For full copyright and license information, please see the LICENSE
* file that was distributed with this source code.
*
* @author Rémi Jean <remi.jean@outlook.com>
* @copyright Copyright (C) 2008-2018, Rémi Jean
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2023, Frédéric Tempez
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
* @link http://zwiicms.fr/
*/
class maintenance extends common
{
public static $actions = [
'index' => self::GROUP_STUDENT
];
/**
* Maintenance
*/
public function index()
{
// Redirection vers l'accueil après rafraîchissement et que la maintenance est terminée.
if ($this->getData(['config', 'maintenance']) == False) {
header('Location:' . helper::baseUrl());
exit();
}
// Page perso définie et existante
if (
2023-09-05 15:31:35 +02:00
$this->getData(['config', 'page302']) !== 'none'
and $this->getData(['page', $this->getData(['config', 'page302'])])
) {
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
2023-09-05 15:31:35 +02:00
'title' => $this->getData(['page', $this->getData(['config', 'page302']), 'hideTitle'])
? ''
2023-09-05 15:31:35 +02:00
: $this->getData(['page', $this->getData(['config', 'page302']), 'title']),
//'content' => $this->getdata(['page',$this->getData(['config','page302']),'content']),
2023-09-13 18:29:25 +02:00
'content' => $this->getPage($this->getData(['config', 'page302']), self::$siteContent),
'view' => 'index'
]);
} else {
// Valeurs en sortie
$this->addOutput([
'display' => self::DISPLAY_LAYOUT_LIGHT,
'title' => helper::translate('Maintenance en cours...'),
'view' => 'index'
]);
}
}
}