diff options
author | ArthurHoaro <arthur@hoa.ro> | 2020-07-22 18:12:10 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2020-07-23 21:19:21 +0200 |
commit | fabff3835da26e6c95cea56b2a01a03749dec7c8 (patch) | |
tree | 4818fb25f92ff9ed15d3d25b78d2dfc9c064fc3a /application/render | |
parent | a8c11451e8d885a243c1ad52012093ba8d121e2c (diff) | |
download | Shaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.tar.gz Shaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.tar.zst Shaarli-fabff3835da26e6c95cea56b2a01a03749dec7c8.zip |
Move PHP and config init to dedicated file
in order to keep index.php as minimal as possible
Diffstat (limited to 'application/render')
-rw-r--r-- | application/render/PageBuilder.php | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/application/render/PageBuilder.php b/application/render/PageBuilder.php index 85e1d59d..471724c0 100644 --- a/application/render/PageBuilder.php +++ b/application/render/PageBuilder.php | |||
@@ -158,10 +158,6 @@ class PageBuilder | |||
158 | */ | 158 | */ |
159 | protected function finalize(): void | 159 | protected function finalize(): void |
160 | { | 160 | { |
161 | //FIXME - DEV _ REMOVE ME | ||
162 | $this->assign('base_path', '/Shaarli'); | ||
163 | $this->assign('asset_path', '/Shaarli/tpl/default'); | ||
164 | |||
165 | // TODO: use the SessionManager | 161 | // TODO: use the SessionManager |
166 | $messageKeys = [ | 162 | $messageKeys = [ |
167 | SessionManager::KEY_SUCCESS_MESSAGES, | 163 | SessionManager::KEY_SUCCESS_MESSAGES, |
@@ -248,20 +244,4 @@ class PageBuilder | |||
248 | 244 | ||
249 | return $this->tpl->draw($page, true); | 245 | return $this->tpl->draw($page, true); |
250 | } | 246 | } |
251 | |||
252 | /** | ||
253 | * Render a 404 page (uses the template : tpl/404.tpl) | ||
254 | * usage: $PAGE->render404('The link was deleted') | ||
255 | * | ||
256 | * @param string $message A message to display what is not found | ||
257 | */ | ||
258 | public function render404($message = '') | ||
259 | { | ||
260 | if (empty($message)) { | ||
261 | $message = t('The page you are trying to reach does not exist or has been deleted.'); | ||
262 | } | ||
263 | header($_SERVER['SERVER_PROTOCOL'] . ' ' . t('404 Not Found')); | ||
264 | $this->tpl->assign('error_message', $message); | ||
265 | $this->renderPage('404'); | ||
266 | } | ||
267 | } | 247 | } |