mc-cms-namelessmc/modules/Core/pages/privacy.php
Sam db647d9b4e
Add Smarty and Twig template engines (#3452)
* 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
2025-02-24 18:44:29 +00:00

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');