From 6888cc6f90383153009a614f50bf0d963cdce494 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. Conflicts: tpl/page.header.html --- inc/user.css | 2 +- index.php | 6 ++++++ tpl/configure.html | 2 ++ tpl/page.header.html | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/inc/user.css b/inc/user.css index 3fe248c..f2a90fd 100644 --- a/inc/user.css +++ b/inc/user.css @@ -23,7 +23,7 @@ a { } a:hover { - color: #F57900 + color: #F57900; } pre code { diff --git a/index.php b/index.php index f156401..0609b56 100644 --- a/index.php +++ b/index.php @@ -106,6 +106,9 @@ if (empty($GLOBALS['redirector'])) $GLOBALS['redirector']=''; 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: @@ -647,6 +650,7 @@ class pageBuilder $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; @@ -1377,6 +1381,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']); @@ -2184,6 +2189,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) diff --git a/tpl/page.header.html b/tpl/page.header.html index 4072ede..d7e5311 100644 --- a/tpl/page.header.html +++ b/tpl/page.header.html @@ -2,7 +2,7 @@ - {$shaarlititle|htmlspecialchars} + {$shaarlititle|htmlspecialchars} {if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"} {ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}