From d7fc45a72d9b0d0853fc12732dd56d174522f93c Mon Sep 17 00:00:00 2001 From: slawkens Date: Sat, 6 Jun 2020 07:17:09 +0200 Subject: [PATCH] Very first version of admin bar --- admin/template/template.php | 10 +++ index.php | 8 +++ system/templates/admin-bar.html.twig | 102 +++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 system/templates/admin-bar.html.twig diff --git a/admin/template/template.php b/admin/template/template.php index 6ca893fc..c2c1b745 100644 --- a/admin/template/template.php +++ b/admin/template/template.php @@ -199,6 +199,16 @@ echo $content; } ?> +display('admin-bar.html.twig', [ + 'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId() + ]); +} +?> diff --git a/index.php b/index.php index 32e8599c..4f334416 100644 --- a/index.php +++ b/index.php @@ -357,6 +357,14 @@ if($config['backward_support']) { $topic = $title; } +/** + * @var OTS_Account $account_logged + */ +if ($logged && admin()) { + $content .= $twig->render('admin-bar.html.twig', [ + 'username' => USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId() + ]); +} $title_full = (isset($title) ? $title . $config['title_separator'] : '') . $config['lua']['serverName']; require $template_path . '/' . $template_index; diff --git a/system/templates/admin-bar.html.twig b/system/templates/admin-bar.html.twig new file mode 100644 index 00000000..2775ad50 --- /dev/null +++ b/system/templates/admin-bar.html.twig @@ -0,0 +1,102 @@ + + +
+ + +