Adds a configuration variable "titleLink" which allows to customize the
link on the title. Conflicts: tpl/page.header.html
This commit is contained in:
parent
ed5a80e732
commit
6888cc6f90
4 changed files with 10 additions and 2 deletions
|
@ -23,7 +23,7 @@ a {
|
|||
}
|
||||
|
||||
a:hover {
|
||||
color: #F57900
|
||||
color: #F57900;
|
||||
}
|
||||
|
||||
pre code {
|
||||
|
|
|
@ -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='<?php $GLOBALS[\'login\']='.var_export($GLOBALS['login'],true).'; $GLOBALS[\'hash\']='.var_export($GLOBALS['hash'],true).'; $GLOBALS[\'salt\']='.var_export($GLOBALS['salt'],true).'; ';
|
||||
$config .='$GLOBALS[\'timezone\']='.var_export($GLOBALS['timezone'],true).'; date_default_timezone_set('.var_export($GLOBALS['timezone'],true).'); $GLOBALS[\'title\']='.var_export($GLOBALS['title'],true).';';
|
||||
$config .= '$GLOBALS[\'titleLink\']='.var_export($GLOBALS['titleLink'],true).'; ';
|
||||
$config .= '$GLOBALS[\'redirector\']='.var_export($GLOBALS['redirector'],true).'; ';
|
||||
$config .= '$GLOBALS[\'disablesessionprotection\']='.var_export($GLOBALS['disablesessionprotection'],true).'; ';
|
||||
$config .= '$GLOBALS[\'disablejquery\']='.var_export($GLOBALS['disablejquery'],true).'; ';
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
|
||||
<tr><td><b>Page title:</b></td><td><input type="text" name="title" id="title" size="50" value="{$title}"></td></tr>
|
||||
|
||||
<tr><td><b>title link:</b></td><td><input type="text" name="titleLink" id="titleLink" size="50" value="{$titleLink}"></td></tr>
|
||||
|
||||
<tr><td valign="top"><b>Timezone:</b></td><td valign="top">{$timezone_form}</td></tr>
|
||||
|
||||
<tr><td valign="top"><b>Redirector</b></td><td><input type="text" name="redirector" id="redirector" size="50" value="{$redirector}"><br>(e.g. <i>http://anonym.to/?</i> will mask the HTTP_REFERER)</td></tr>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div id="logo" title="Share your links !" onclick="document.location='?';"></div>
|
||||
<div class="nomobile shareYourLink">Shaare your links...<br>
|
||||
{if="!empty($linkcount)"}{$linkcount} links{/if}</div>
|
||||
<span id="shaarli_title"><a href="?">{$shaarlititle|htmlspecialchars}</a></span>
|
||||
<span id="shaarli_title"><a href="{$titleLink}">{$shaarlititle|htmlspecialchars}</a></span>
|
||||
|
||||
{if="!empty($_GET['source']) && $_GET['source']=='bookmarklet'"}
|
||||
{ignore} When called as a popup from bookmarklet, do not display menu. {/ignore}
|
||||
|
|
Loading…
Reference in a new issue