From abfd2c94f5c5f11c6d6748b4e07e6f3b634ce5b1 Mon Sep 17 00:00:00 2001 From: slawkens Date: Sun, 18 Oct 2020 06:54:54 +0200 Subject: [PATCH] Move template_header and change_template to twig --- system/functions.php | 39 +++++-------------- .../templates/forms.change_template.html.twig | 4 ++ system/templates/templates.header.html.twig | 21 ++++++++++ 3 files changed, 35 insertions(+), 29 deletions(-) create mode 100644 system/templates/forms.change_template.html.twig create mode 100644 system/templates/templates.header.html.twig diff --git a/system/functions.php b/system/functions.php index 903570db..f3bff021 100644 --- a/system/functions.php +++ b/system/functions.php @@ -472,33 +472,16 @@ function template_place_holder($type) */ function template_header($is_admin = false) { - global $title_full, $config; + global $title_full, $config, $twig; $charset = isset($config['charset']) ? $config['charset'] : 'utf-8'; - $ret = ' - - - '; - if(!$is_admin) - $ret .= ' - - ' . $title_full . ''; - - $ret .= ' - - - - - - -'; - - if($config['recaptcha_enabled']) - $ret .= ""; - return $ret; + return $twig->render('templates.header.html.twig', + [ + 'charset' => $charset, + 'title' => $title_full, + 'is_admin' => $is_admin + ] + ); } /** @@ -565,10 +548,8 @@ function template_form() foreach($templates as $key => $value) $options .= ''; - return '
- - - '; + global $twig; + return $twig->render('forms.change_template.html.twig', ['options' => $options]); } function getStyle($i) diff --git a/system/templates/forms.change_template.html.twig b/system/templates/forms.change_template.html.twig new file mode 100644 index 00000000..a0006483 --- /dev/null +++ b/system/templates/forms.change_template.html.twig @@ -0,0 +1,4 @@ +
+ + + \ No newline at end of file diff --git a/system/templates/templates.header.html.twig b/system/templates/templates.header.html.twig new file mode 100644 index 00000000..6438076a --- /dev/null +++ b/system/templates/templates.header.html.twig @@ -0,0 +1,21 @@ + + + +{% if not is_admin %} + +{{ title }} +{% endif %} + + + + + + +{% if config.recaptcha_enabled %} + +{% endif %} \ No newline at end of file