aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthur <arthur@hoa.ro>2016-07-23 10:31:33 +0200
committerGitHub <noreply@github.com>2016-07-23 10:31:33 +0200
commit8562009682b788ce8fb9da0f312bd6cd5cc53b3a (patch)
treef9a18df935dc74ecb7af4847282a5baac1d34198
parentd5307a4e001e755ebbcead04172e9a3ac49a14da (diff)
parent97ef33bb7296cea995b19932a95c6aaec7242dc6 (diff)
downloadShaarli-8562009682b788ce8fb9da0f312bd6cd5cc53b3a.tar.gz
Shaarli-8562009682b788ce8fb9da0f312bd6cd5cc53b3a.tar.zst
Shaarli-8562009682b788ce8fb9da0f312bd6cd5cc53b3a.zip
Merge pull request #601 from ArthurHoaro/hotfix/title-missing
Fixes #600 - Shaarli's title is not set with the new 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 00012e22..576a93de 100644
--- a/index.php
+++ b/index.php
@@ -1676,10 +1676,7 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1676 $keys[] = $key; 1676 $keys[] = $key;
1677 } 1677 }
1678 1678
1679 // If there is only a single link, we change on-the-fly the title of the page. 1679
1680 if (count($linksToDisplay) == 1) {
1681 $conf->set('pagetitle', $linksToDisplay[$keys[0]]['title'] .' - '. $conf->get('general.title'));
1682 }
1683 1680
1684 // Select articles according to paging. 1681 // Select articles according to paging.
1685 $pagecount = ceil(count($keys) / $_SESSION['LINKS_PER_PAGE']); 1682 $pagecount = ceil(count($keys) / $_SESSION['LINKS_PER_PAGE']);
@@ -1741,9 +1738,10 @@ function buildLinkList($PAGE,$LINKSDB, $conf, $pluginManager)
1741 'links' => $linkDisp, 1738 'links' => $linkDisp,
1742 'tags' => $LINKSDB->allTags(), 1739 'tags' => $LINKSDB->allTags(),
1743 ); 1740 );
1744 // FIXME! temporary fix - see #399. 1741
1745 if ($conf->exists('pagetitle') && count($linkDisp) == 1) { 1742 // If there is only a single link, we change on-the-fly the title of the page.
1746 $data['pagetitle'] = $conf->get('pagetitle'); 1743 if (count($linksToDisplay) == 1) {
1744 $data['pagetitle'] = $linksToDisplay[$keys[0]]['title'] .' - '. $conf->get('general.title');
1747 } 1745 }
1748 1746
1749 $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn())); 1747 $pluginManager->executeHooks('render_linklist', $data, array('loggedin' => isLoggedIn()));