aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-07-19 18:03:09 +0200
committerArthurHoaro <arthur@hoa.ro>2016-07-19 18:03:09 +0200
commit97ef33bb7296cea995b19932a95c6aaec7242dc6 (patch)
treea3680753390ed7c446e2fb78aba18cb7e2a0907c
parent0c4c7ae818336d5b0f94562e551ca1a3f34d3435 (diff)
downloadShaarli-97ef33bb7296cea995b19932a95c6aaec7242dc6.tar.gz
Shaarli-97ef33bb7296cea995b19932a95c6aaec7242dc6.tar.zst
Shaarli-97ef33bb7296cea995b19932a95c6aaec7242dc6.zip
Fixes #600 - Shaarli's title is not set with the new config manager
- Fixed title config key - Page title (in head tag) is no longer set through the config manager
-rw-r--r--application/PageBuilder.php10
-rw-r--r--index.php12
2 files changed, 7 insertions, 15 deletions
diff --git a/application/PageBuilder.php b/application/PageBuilder.php
index 7cd88370..1ca0260a 100644
--- a/application/PageBuilder.php
+++ b/application/PageBuilder.php
@@ -68,18 +68,12 @@ class PageBuilder
68 $this->tpl->assign('source', index_url($_SERVER)); 68 $this->tpl->assign('source', index_url($_SERVER));
69 $this->tpl->assign('version', shaarli_version); 69 $this->tpl->assign('version', shaarli_version);
70 $this->tpl->assign('scripturl', index_url($_SERVER)); 70 $this->tpl->assign('scripturl', index_url($_SERVER));
71 $this->tpl->assign('pagetitle', 'Shaarli');
72 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links? 71 $this->tpl->assign('privateonly', !empty($_SESSION['privateonly'])); // Show only private links?
73 if ($this->conf->exists('general.title')) { 72 $this->tpl->assign('pagetitle', $this->conf->get('general.title', 'Shaarli'));
74 $this->tpl->assign('pagetitle', $this->conf->get('general.title'));
75 }
76 if ($this->conf->exists('general.header_link')) { 73 if ($this->conf->exists('general.header_link')) {
77 $this->tpl->assign('titleLink', $this->conf->get('general.header_link')); 74 $this->tpl->assign('titleLink', $this->conf->get('general.header_link'));
78 } 75 }
79 if ($this->conf->exists('pagetitle')) { 76 $this->tpl->assign('shaarlititle', $this->conf->get('general.title', 'Shaarli'));
80 $this->tpl->assign('pagetitle', $this->conf->get('pagetitle'));
81 }
82 $this->tpl->assign('shaarlititle', $this->conf->get('title', 'Shaarli'));
83 $this->tpl->assign('openshaarli', $this->conf->get('security.open_shaarli', false)); 77 $this->tpl->assign('openshaarli', $this->conf->get('security.open_shaarli', false));
84 $this->tpl->assign('showatom', $this->conf->get('feed.show_atom', false)); 78 $this->tpl->assign('showatom', $this->conf->get('feed.show_atom', false));
85 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false)); 79 $this->tpl->assign('hide_timestamps', $this->conf->get('privacy.hide_timestamps', false));
diff --git a/index.php b/index.php
index b9576de8..19d54db8 100644
--- a/index.php
+++ b/index.php
@@ -1675,10 +1675,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1675 $keys[] = $key; 1675 $keys[] = $key;
1676 } 1676 }
1677 1677
1678 // If there is only a single link, we change on-the-fly the title of the page. 1678
1679 if (count($linksToDisplay) == 1) {
1680 $conf->set('pagetitle', $linksToDisplay[$keys[0]]['title'] .' - '. $conf->get('general.title'));
1681 }
1682 1679
1683 // Select articles according to paging. 1680 // Select articles according to paging.
1684 $pagecount = ceil(count($keys) / $_SESSION['LINKS_PER_PAGE']); 1681 $pagecount = ceil(count($keys) / $_SESSION['LINKS_PER_PAGE']);
@@ -1740,9 +1737,10 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1740 'links' => $linkDisp, 1737 'links' => $linkDisp,
1741 'tags' => $LINKSDB->allTags(), 1738 'tags' => $LINKSDB->allTags(),
1742 ); 1739 );
1743 // FIXME! temporary fix - see #399. 1740
1744 if ($conf->exists('pagetitle') && count($linkDisp) == 1) { 1741 // If there is only a single link, we change on-the-fly the title of the page.
1745 $data['pagetitle'] = $conf->get('pagetitle'); 1742 if (count($linksToDisplay) == 1) {
1743 $data['pagetitle'] = $linksToDisplay[$keys[0]]['title'] .' - '. $conf->get('general.title');
1746 } 1744 }
1747 1745
1748 $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn())); 1746 $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn()));