Use the traditional "template" config key, update unit-tests

This commit is contained in:
Ribas160
2025-02-10 18:19:36 +02:00
parent bce449de10
commit 5b54f2cdb0
5 changed files with 28 additions and 12 deletions

View File

@@ -46,7 +46,7 @@ class Configuration
'syntaxhighlightingtheme' => '',
'sizelimit' => 10485760,
'templateselection' => false,
'templatedefault' => '',
'template' => 'bootstrap',
'info' => 'More information on the <a href=\'https://privatebin.info/\'>project page</a>.',
'notice' => '',
'languageselection' => false,
@@ -79,13 +79,13 @@ class Configuration
'markdown' => 'Markdown',
),
'available_templates' => array(
'bootstrap5',
'bootstrap',
'bootstrap-page',
'bootstrap-dark',
'bootstrap-dark-page',
'bootstrap-compact',
'bootstrap-compact-page',
'bootstrap5',
'page',
),
'traffic' => array(

View File

@@ -213,9 +213,10 @@ class Controller
$this->_conf = new Configuration;
$templates = $this->_conf->getSection('available_templates');
$template = $this->_conf->getKey('templatedefault');
$template = $this->_conf->getKey('template');
TemplateSwitcher::setAvailableTemplates($templates);
TemplateSwitcher::setTemplateFallback($template);
// force default template, if template selection is disabled and a default is set
if (!$this->_conf->getKey('templateselection') && !empty($template)) {
$_COOKIE['template'] = $template;

View File

@@ -26,7 +26,7 @@ class TemplateSwitcher {
* @static
* @var string
*/
protected static $_templateFallback = "bootstrap";
protected static $_templateFallback;
/**