diff options
author | VirtualTam <virtualtam@flibidi.net> | 2018-12-03 00:46:04 +0100 |
---|---|---|
committer | VirtualTam <virtualtam@flibidi.net> | 2019-01-12 22:47:48 +0100 |
commit | 8c0f19c7971e1a4534347ce9d6d82a0a45799711 (patch) | |
tree | 51cc8c616b9614bf81c011161908319634a82b47 /application | |
parent | 51753e403fa69c0ce124ede27d300477e3e799ca (diff) | |
download | Shaarli-8c0f19c7971e1a4534347ce9d6d82a0a45799711.tar.gz Shaarli-8c0f19c7971e1a4534347ce9d6d82a0a45799711.tar.zst Shaarli-8c0f19c7971e1a4534347ce9d6d82a0a45799711.zip |
namespacing: \Shaarli\Render\{PageBuilder,ThemeUtils}
Signed-off-by: VirtualTam <virtualtam@flibidi.net>
Diffstat (limited to 'application')
-rw-r--r-- | application/render/PageBuilder.php (renamed from application/PageBuilder.php) | 20 | ||||
-rw-r--r-- | application/render/ThemeUtils.php (renamed from application/ThemeUtils.php) | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/application/PageBuilder.php b/application/render/PageBuilder.php index 2ca95832..1df95bfb 100644 --- a/application/PageBuilder.php +++ b/application/render/PageBuilder.php | |||
@@ -1,5 +1,11 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Shaarli\Render; | ||
4 | |||
5 | use ApplicationUtils; | ||
6 | use Exception; | ||
7 | use LinkDB; | ||
8 | use RainTPL; | ||
3 | use Shaarli\Config\ConfigManager; | 9 | use Shaarli\Config\ConfigManager; |
4 | use Shaarli\Thumbnailer; | 10 | use Shaarli\Thumbnailer; |
5 | 11 | ||
@@ -37,7 +43,9 @@ class PageBuilder | |||
37 | */ | 43 | */ |
38 | protected $token; | 44 | protected $token; |
39 | 45 | ||
40 | /** @var bool $isLoggedIn Whether the user is logged in **/ | 46 | /** |
47 | * @var bool $isLoggedIn Whether the user is logged in | ||
48 | */ | ||
41 | protected $isLoggedIn = false; | 49 | protected $isLoggedIn = false; |
42 | 50 | ||
43 | /** | 51 | /** |
@@ -101,7 +109,7 @@ class PageBuilder | |||
101 | ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt')) | 109 | ApplicationUtils::getVersionHash(SHAARLI_VERSION, $this->conf->get('credentials.salt')) |
102 | ); | 110 | ); |
103 | $this->tpl->assign('index_url', index_url($_SERVER)); | 111 | $this->tpl->assign('index_url', index_url($_SERVER)); |
104 | $visibility = ! empty($_SESSION['visibility']) ? $_SESSION['visibility'] : ''; | 112 | $visibility = !empty($_SESSION['visibility']) ? $_SESSION['visibility'] : ''; |
105 | $this->tpl->assign('visibility', $visibility); | 113 | $this->tpl->assign('visibility', $visibility); |
106 | $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); | 114 | $this->tpl->assign('untaggedonly', !empty($_SESSION['untaggedonly'])); |
107 | $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli')); | 115 | $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli')); |
@@ -126,7 +134,7 @@ class PageBuilder | |||
126 | $this->tpl->assign('thumbnails_width', $this->conf->get('thumbnails.width')); | 134 | $this->tpl->assign('thumbnails_width', $this->conf->get('thumbnails.width')); |
127 | $this->tpl->assign('thumbnails_height', $this->conf->get('thumbnails.height')); | 135 | $this->tpl->assign('thumbnails_height', $this->conf->get('thumbnails.height')); |
128 | 136 | ||
129 | if (! empty($_SESSION['warnings'])) { | 137 | if (!empty($_SESSION['warnings'])) { |
130 | $this->tpl->assign('global_warnings', $_SESSION['warnings']); | 138 | $this->tpl->assign('global_warnings', $_SESSION['warnings']); |
131 | unset($_SESSION['warnings']); | 139 | unset($_SESSION['warnings']); |
132 | } | 140 | } |
@@ -189,16 +197,16 @@ class PageBuilder | |||
189 | 197 | ||
190 | /** | 198 | /** |
191 | * Render a 404 page (uses the template : tpl/404.tpl) | 199 | * Render a 404 page (uses the template : tpl/404.tpl) |
192 | * usage : $PAGE->render404('The link was deleted') | 200 | * usage: $PAGE->render404('The link was deleted') |
193 | * | 201 | * |
194 | * @param string $message A messate to display what is not found | 202 | * @param string $message A message to display what is not found |
195 | */ | 203 | */ |
196 | public function render404($message = '') | 204 | public function render404($message = '') |
197 | { | 205 | { |
198 | if (empty($message)) { | 206 | if (empty($message)) { |
199 | $message = t('The page you are trying to reach does not exist or has been deleted.'); | 207 | $message = t('The page you are trying to reach does not exist or has been deleted.'); |
200 | } | 208 | } |
201 | header($_SERVER['SERVER_PROTOCOL'] .' '. t('404 Not Found')); | 209 | header($_SERVER['SERVER_PROTOCOL'] . ' ' . t('404 Not Found')); |
202 | $this->tpl->assign('error_message', $message); | 210 | $this->tpl->assign('error_message', $message); |
203 | $this->renderPage('404'); | 211 | $this->renderPage('404'); |
204 | } | 212 | } |
diff --git a/application/ThemeUtils.php b/application/render/ThemeUtils.php index 16f2f6a2..86096c64 100644 --- a/application/ThemeUtils.php +++ b/application/render/ThemeUtils.php | |||
@@ -1,6 +1,6 @@ | |||
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | namespace Shaarli; | 3 | namespace Shaarli\Render; |
4 | 4 | ||
5 | /** | 5 | /** |
6 | * Class ThemeUtils | 6 | * Class ThemeUtils |