From 8c0f19c7971e1a4534347ce9d6d82a0a45799711 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Mon, 3 Dec 2018 00:46:04 +0100 Subject: [PATCH] namespacing: \Shaarli\Render\{PageBuilder,ThemeUtils} Signed-off-by: VirtualTam --- application/{ => render}/PageBuilder.php | 20 ++++++++++++++------ application/{ => render}/ThemeUtils.php | 2 +- composer.json | 1 + index.php | 4 ++-- tests/{ => render}/ThemeUtilsTest.php | 2 +- 5 files changed, 19 insertions(+), 10 deletions(-) rename application/{ => render}/PageBuilder.php (93%) rename application/{ => render}/ThemeUtils.php (96%) rename tests/{ => render}/ThemeUtilsTest.php (98%) diff --git a/application/PageBuilder.php b/application/render/PageBuilder.php similarity index 93% rename from application/PageBuilder.php rename to application/render/PageBuilder.php index 2ca95832..1df95bfb 100644 --- a/application/PageBuilder.php +++ b/application/render/PageBuilder.php @@ -1,5 +1,11 @@ conf->get('credentials.salt')) ); $this->tpl->assign('index_url', index_url($_SERVER)); - $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : ''; + $visibility = !empty($_SESSION['visibility']) ? $_SESSION['visibility'] : ''; $this->tpl->assign('visibility', $visibility); $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli')); @@ -126,7 +134,7 @@ class PageBuilder $this->tpl->assign('thumbnails_width', $this->conf->get('thumbnails.width')); $this->tpl->assign('thumbnails_height', $this->conf->get('thumbnails.height')); - if (! empty($_SESSION['warnings'])) { + if (!empty($_SESSION['warnings'])) { $this->tpl->assign('global_warnings', $_SESSION['warnings']); unset($_SESSION['warnings']); } @@ -189,16 +197,16 @@ class PageBuilder /** * Render a 404 page (uses the template : tpl/404.tpl) - * usage : $PAGE->render404('The link was deleted') + * usage: $PAGE->render404('The link was deleted') * - * @param string $message A messate to display what is not found + * @param string $message A message to display what is not found */ public function render404($message = '') { if (empty($message)) { $message = t('The page you are trying to reach does not exist or has been deleted.'); } - header($_SERVER['SERVER_PROTOCOL'] .' '. t('404 Not Found')); + header($_SERVER['SERVER_PROTOCOL'] . ' ' . t('404 Not Found')); $this->tpl->assign('error_message', $message); $this->renderPage('404'); } diff --git a/application/ThemeUtils.php b/application/render/ThemeUtils.php similarity index 96% rename from application/ThemeUtils.php rename to application/render/ThemeUtils.php index 16f2f6a2..86096c64 100644 --- a/application/ThemeUtils.php +++ b/application/render/ThemeUtils.php @@ -1,6 +1,6 @@