From ebb2880dfcfd16b07744c6a2f98edb82133bfb04 Mon Sep 17 00:00:00 2001 From: Christophe HENRY Date: Wed, 13 Mar 2013 21:27:03 +0100 Subject: [PATCH] Adds a configuration variable "titleLink" which allows to customize the link on the title. --- index.php | 4 ++++ tpl/configure.html | 3 ++- tpl/page.header.html | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index fdc4fbac..5dd0353b 100644 --- a/index.php +++ b/index.php @@ -105,6 +105,7 @@ function stripslashes_deep($value) { $value = is_array($value) ? array_map('stri if (empty($GLOBALS['disablesessionprotection'])) $GLOBALS['disablesessionprotection']=false; if (empty($GLOBALS['disablejquery'])) $GLOBALS['disablejquery']=false; if (empty($GLOBALS['privateLinkByDefault'])) $GLOBALS['privateLinkByDefault']=false; +if (empty($GLOBALS['titleLink'])) $GLOBALS['titleLink']='?'; // I really need to rewrite Shaarli with a proper configuation manager. // Run config screen if first run: @@ -657,6 +658,7 @@ private function initialize() $this->tpl->assign('pagetitle','Shaarli'); $this->tpl->assign('privateonly',!empty($_SESSION['privateonly'])); // Show only private links ? if (!empty($GLOBALS['title'])) $this->tpl->assign('pagetitle',$GLOBALS['title']); + if (!empty($GLOBALS['titleLink'])) $this->tpl->assign('titleLink',$GLOBALS['titleLink']); if (!empty($GLOBALS['pagetitle'])) $this->tpl->assign('pagetitle',$GLOBALS['pagetitle']); $this->tpl->assign('shaarlititle',empty($GLOBALS['title']) ? 'Shaarli': $GLOBALS['title'] ); return; @@ -1395,6 +1397,7 @@ function renderPage() $tz = $_POST['continent'].'/'.$_POST['city']; $GLOBALS['timezone'] = $tz; $GLOBALS['title']=$_POST['title']; + $GLOBALS['titleLink']=$_POST['titleLink']; $GLOBALS['redirector']=$_POST['redirector']; $GLOBALS['disablesessionprotection']=!empty($_POST['disablesessionprotection']); $GLOBALS['disablejquery']=!empty($_POST['disablejquery']); @@ -2257,6 +2260,7 @@ function writeConfig() if (is_file($GLOBALS['config']['CONFIG_FILE']) && !isLoggedIn()) die('You are not authorized to alter config.'); // Only logged in user can alter config. $config='Page title: + Title link: Timezone:{$timezone_form} Redirector
(e.g. http://anonym.to/? will mask the HTTP_REFERER) @@ -29,4 +30,4 @@ {include="page.footer"} - \ No newline at end of file + diff --git a/tpl/page.header.html b/tpl/page.header.html index 125b365b..37a18f70 100644 --- a/tpl/page.header.html +++ b/tpl/page.header.html @@ -2,7 +2,7 @@
Shaare your links...
{if="!empty($linkcount)"}{$linkcount} links{/if}
- {$shaarlititle|htmlspecialchars} + {$shaarlititle|htmlspecialchars} {if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"} {ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}