Exemple #1
0
    $SESSION->lang = DEFAULT_LANGUAGE;
}
\Locale::setDefault($SESSION->lang);
$l10n->setLanguage($SESSION->lang);
//============================================================================================
// Load the page requested by the user
//============================================================================================
if (!isset($_GET['page'])) {
    $render = true;
    $thisPage = 'Settings';
    $settings = \Ventus\Utilities\Functions::fetchSettings();
    $l10n->addResource(__DIR__ . '/l10n/settings.json');
    $l10n->localizeArray($settings, 'description');
    $viewFile = 'views/settings.php';
} elseif ($_GET['page'] === 'update-setting') {
    \Ventus\Utilities\Functions::updateSetting($_POST['setting_key'], $_POST['setting_value']);
    $loggers['audit']->info("Application setting updated: {$_POST['setting_key']} => {$_POST['setting_value']}");
}
/**
 * View rendering
 */
if (isset($render) && $render) {
    require FS_PHP . '/header.php';
    require FS_PHP . '/nav.php';
    if (isset($viewFile) && file_exists($viewFile)) {
        require $viewFile;
    } else {
        require FS_PHP . '/error.php';
    }
    require FS_PHP . '/footer.php';
}