summaryrefslogtreecommitdiff
path: root/inc/template.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/template.php')
-rw-r--r--inc/template.php36
1 files changed, 17 insertions, 19 deletions
diff --git a/inc/template.php b/inc/template.php
index ea73b01b6..41f398016 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -54,7 +54,7 @@ function tpl_incdir($tpl='') {
function tpl_basedir($tpl='') {
global $conf;
if(!$tpl) $tpl = $conf['template'];
- return DOKU_BASE.'lib/tpl/'.$conf['template'].'/';
+ return DOKU_BASE.'lib/tpl/'.$tpl.'/';
}
/**
@@ -223,7 +223,7 @@ function tpl_toc($return = false) {
if(in_array($class, $pluginlist)) {
// attempt to load the plugin
/** @var $plugin DokuWiki_Admin_Plugin */
- $plugin =& plugin_load('admin', $class);
+ $plugin = plugin_load('admin', $class);
}
}
if( ($plugin !== null) && (!$plugin->forAdminOnly() || $INFO['isadmin']) ) {
@@ -257,7 +257,7 @@ function tpl_admin() {
if(in_array($class, $pluginlist)) {
// attempt to load the plugin
/** @var $plugin DokuWiki_Admin_Plugin */
- $plugin =& plugin_load('admin', $class);
+ $plugin = plugin_load('admin', $class);
}
}
@@ -290,6 +290,7 @@ function tpl_metaheaders($alt = true) {
global $QUERY;
global $lang;
global $conf;
+ global $updateVersion;
// prepare the head array
$head = array();
@@ -317,11 +318,11 @@ function tpl_metaheaders($alt = true) {
if($alt) {
$head['link'][] = array(
'rel' => 'alternate', 'type'=> 'application/rss+xml',
- 'title'=> 'Recent Changes', 'href'=> DOKU_BASE.'feed.php'
+ 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php'
);
$head['link'][] = array(
'rel' => 'alternate', 'type'=> 'application/rss+xml',
- 'title'=> 'Current Namespace',
+ 'title'=> $lang['currentns'],
'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']
);
if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']) {
@@ -335,21 +336,21 @@ function tpl_metaheaders($alt = true) {
if($ACT == 'search') {
$head['link'][] = array(
'rel' => 'alternate', 'type'=> 'application/rss+xml',
- 'title'=> 'Search Result',
+ 'title'=> $lang['searchresult'],
'href' => DOKU_BASE.'feed.php?mode=search&q='.$QUERY
);
}
if(actionOK('export_xhtml')) {
$head['link'][] = array(
- 'rel' => 'alternate', 'type'=> 'text/html', 'title'=> 'Plain HTML',
+ 'rel' => 'alternate', 'type'=> 'text/html', 'title'=> $lang['plainhtml'],
'href'=> exportlink($ID, 'xhtml', '', false, '&')
);
}
if(actionOK('export_raw')) {
$head['link'][] = array(
- 'rel' => 'alternate', 'type'=> 'text/plain', 'title'=> 'Wiki Markup',
+ 'rel' => 'alternate', 'type'=> 'text/plain', 'title'=> $lang['wikimarkup'],
'href'=> exportlink($ID, 'raw', '', false, '&')
);
}
@@ -400,7 +401,7 @@ function tpl_metaheaders($alt = true) {
// make $INFO and other vars available to JavaScripts
$json = new JSON();
$script = "var NS='".$INFO['namespace']."';";
- if($conf['useacl'] && $_SERVER['REMOTE_USER']) {
+ if($conf['useacl'] && !empty($_SERVER['REMOTE_USER'])) {
$script .= "var SIG='".toolbar_signature()."';";
}
$script .= 'var JSINFO = '.$json->encode($JSINFO).';';
@@ -605,6 +606,7 @@ function tpl_get_action($type) {
// check disabled actions and fix the badly named ones
if($type == 'history') $type = 'revisions';
+ if ($type == 'subscription') $type = 'subscribe';
if(!actionOK($type)) return false;
$accesskey = null;
@@ -679,12 +681,12 @@ function tpl_get_action($type) {
}
break;
case 'register':
- if($_SERVER['REMOTE_USER']) {
+ if(!empty($_SERVER['REMOTE_USER'])) {
return false;
}
break;
case 'resendpwd':
- if($_SERVER['REMOTE_USER']) {
+ if(!empty($_SERVER['REMOTE_USER'])) {
return false;
}
break;
@@ -700,10 +702,6 @@ function tpl_get_action($type) {
$params['rev'] = $REV;
$params['sectok'] = getSecurityToken();
break;
- /** @noinspection PhpMissingBreakStatementInspection */
- case 'subscription':
- $type = 'subscribe';
- $params['do'] = 'subscribe';
case 'subscribe':
if(!$_SERVER['REMOTE_USER']) {
return false;
@@ -1233,7 +1231,7 @@ function tpl_localeFN($id) {
* @param bool $fromajax - set true when calling this function via ajax
* @author Andreas Gohr <andi@splitbrain.org>
*/
-function tpl_mediaContent($fromajax = false) {
+function tpl_mediaContent($fromajax = false, $sort='natural') {
global $IMG;
global $AUTH;
global $INUSE;
@@ -1263,7 +1261,7 @@ function tpl_mediaContent($fromajax = false) {
if($do == 'filesinuse') {
media_filesinuse($INUSE, $IMG);
} elseif($do == 'filelist') {
- media_filelist($NS, $AUTH, $JUMPTO);
+ media_filelist($NS, $AUTH, $JUMPTO,false,$sort);
} elseif($do == 'searchlist') {
media_searchlist($INPUT->str('q'), $NS, $AUTH);
} else {
@@ -1411,7 +1409,7 @@ function tpl_actiondropdown($empty = '', $button = '&gt;') {
echo '<div class="no">';
echo '<input type="hidden" name="id" value="'.$ID.'" />';
if($REV) echo '<input type="hidden" name="rev" value="'.$REV.'" />';
- if ($_SERVER['REMOTE_USER']) {
+ if (!empty($_SERVER['REMOTE_USER'])) {
echo '<input type="hidden" name="sectok" value="'.getSecurityToken().'" />';
}
@@ -1793,7 +1791,7 @@ function tpl_classes() {
'dokuwiki',
'mode_'.$ACT,
'tpl_'.$conf['template'],
- $_SERVER['REMOTE_USER'] ? 'loggedIn' : '',
+ !empty($_SERVER['REMOTE_USER']) ? 'loggedIn' : '',
$INFO['exists'] ? '' : 'notFound',
($ID == $conf['start']) ? 'home' : '',
);