aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/PageBuilder.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/PageBuilder.php')
-rw-r--r--application/PageBuilder.php28
1 files changed, 16 insertions, 12 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 82580787..cf13c714 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -29,21 +29,22 @@ class PageBuilder
29 private function initialize() 29 private function initialize()
30 { 30 {
31 $this->tpl = new RainTPL(); 31 $this->tpl = new RainTPL();
32 $conf = ConfigManager::getInstance();
32 33
33 try { 34 try {
34 $version = ApplicationUtils::checkUpdate( 35 $version = ApplicationUtils::checkUpdate(
35 shaarli_version, 36 shaarli_version,
36 $GLOBALS['config']['UPDATECHECK_FILENAME'], 37 $conf->get('config.UPDATECHECK_FILENAME'),
37 $GLOBALS['config']['UPDATECHECK_INTERVAL'], 38 $conf->get('config.UPDATECHECK_INTERVAL'),
38 $GLOBALS['config']['ENABLE_UPDATECHECK'], 39 $conf->get('config.ENABLE_UPDATECHECK'),
39 isLoggedIn(), 40 isLoggedIn(),
40 $GLOBALS['config']['UPDATECHECK_BRANCH'] 41 $conf->get('config.UPDATECHECK_BRANCH')
41 ); 42 );
42 $this->tpl->assign('newVersion', escape($version)); 43 $this->tpl->assign('newVersion', escape($version));
43 $this->tpl->assign('versionError', ''); 44 $this->tpl->assign('versionError', '');
44 45
45 } catch (Exception $exc) { 46 } catch (Exception $exc) {
46 logm($GLOBALS['config']['LOG_FILE'], $_SERVER['REMOTE_ADDR'], $exc->getMessage()); 47 logm($conf->get('config.LOG_FILE'), $_SERVER['REMOTE_ADDR'], $exc->getMessage());
47 $this->tpl->assign('newVersion', ''); 48 $this->tpl->assign('newVersion', '');
48 $this->tpl->assign('versionError', escape($exc->getMessage())); 49 $this->tpl->assign('versionError', escape($exc->getMessage()));
49 } 50 }
@@ -62,16 +63,19 @@ class PageBuilder
62 $this->tpl->assign('scripturl', index_url($_SERVER)); 63 $this->tpl->assign('scripturl', index_url($_SERVER));
63 $this->tpl->assign('pagetitle', 'Shaarli'); 64 $this->tpl->assign('pagetitle', 'Shaarli');
64 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links? 65 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links?
65 if (!empty($GLOBALS['title'])) { 66 if ($conf->exists('title')) {
66 $this->tpl->assign('pagetitle', $GLOBALS['title']); 67 $this->tpl->assign('pagetitle', $conf->get('title'));
67 } 68 }
68 if (!empty($GLOBALS['titleLink'])) { 69 if ($conf->exists('titleLink')) {
69 $this->tpl->assign('titleLink', $GLOBALS['titleLink']); 70 $this->tpl->assign('titleLink', $conf->get('titleLink'));
70 } 71 }
71 if (!empty($GLOBALS['pagetitle'])) { 72 if ($conf->exists('pagetitle')) {
72 $this->tpl->assign('pagetitle', $GLOBALS['pagetitle']); 73 $this->tpl->assign('pagetitle', $conf->get('pagetitle'));
73 } 74 }
74 $this->tpl->assign('shaarlititle', empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title']); 75 $this->tpl->assign('shaarlititle', $conf->get('title', 'Shaarli'));
76 $this->tpl->assign('openshaarli', $conf->get('config.OPEN_SHAARLI', false));
77 $this->tpl->assign('showatom', $conf->get('config.SHOW_ATOM', false));
78 // FIXME! Globals
75 if (!empty($GLOBALS['plugin_errors'])) { 79 if (!empty($GLOBALS['plugin_errors'])) {
76 $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']); 80 $this->tpl->assign('plugin_errors', $GLOBALS['plugin_errors']);
77 } 81 }