mirror of
https://github.com/NamelessMC/Nameless
synced 2026-08-18 06:29:04 -04:00
* Add Smarty and Twig template engines * Update composer.json * Convert Widgets class to template engine and PHPStan fixes * Fix widget initialisation * Fix panel widget initialisation * chore: remove debug return * feat: convert 403/404 pages to new template system and general tidy * chore: style fixes * feat: update latest pages to new template engine * feat: template base should not be nullable in onPageLoad * feat: set template base directory upon initialisation and allow custom smarty security directories * chore: fix style
48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Privacy policy page
|
|
*
|
|
* @author Samerton
|
|
* @license MIT
|
|
* @version 2.2.0
|
|
*
|
|
* @var Cache $cache
|
|
* @var FakeSmarty $smarty
|
|
* @var Language $language
|
|
* @var Navigation $cc_nav
|
|
* @var Navigation $navigation
|
|
* @var Navigation $staffcp_nav
|
|
* @var Pages $pages
|
|
* @var TemplateBase $template
|
|
* @var User $user
|
|
* @var Widgets $widgets
|
|
*/
|
|
|
|
// Always define page name
|
|
const PAGE = 'privacy';
|
|
$page_title = $language->get('general', 'privacy_policy');
|
|
require_once ROOT_PATH . '/core/templates/frontend_init.php';
|
|
|
|
// Retrieve privacy policy from database
|
|
$policy = DB::getInstance()->get('privacy_terms', ['name', 'privacy']);
|
|
if (!$policy->count()) {
|
|
$policy = Output::getPurified(Settings::get('privacy_policy'));
|
|
} else {
|
|
$policy = Output::getPurified($policy->first()->value);
|
|
}
|
|
|
|
$template->getEngine()->addVariables([
|
|
'PRIVACY_POLICY' => $language->get('general', 'privacy_policy'),
|
|
'POLICY' => $policy
|
|
]);
|
|
|
|
// Load modules + template
|
|
Module::loadPage($user, $pages, $cache, $smarty, [$navigation, $cc_nav, $staffcp_nav], $widgets, $template);
|
|
|
|
$template->onPageLoad();
|
|
|
|
require ROOT_PATH . '/core/templates/navbar.php';
|
|
require ROOT_PATH . '/core/templates/footer.php';
|
|
|
|
// Display template
|
|
$template->displayTemplate('privacy');
|