From 00e3e3940de140e6fe6ce3c558c71a47f676b456 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sat, 3 Aug 2013 17:17:58 +0200 Subject: fix the default ordering of media files to be "natural". also allow the order to be specified in more places. --- inc/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index ca1c8d9d5..c8520dc26 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1229,7 +1229,7 @@ function tpl_localeFN($id) { * @param bool $fromajax - set true when calling this function via ajax * @author Andreas Gohr */ -function tpl_mediaContent($fromajax = false) { +function tpl_mediaContent($fromajax = false, $sort='natural') { global $IMG; global $AUTH; global $INUSE; @@ -1259,7 +1259,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 { -- cgit v1.2.3 From dcd4911e24c6e01c3b83310ecf90ee7c01ed7ad4 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Tue, 17 Sep 2013 16:45:51 +0200 Subject: Fix tpl_basedir to use the supplied template Previously only the path for the configured template was returned and the parameter was ignored. --- inc/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 8f41ce65b..6eadd37e6 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.'/'; } /** -- cgit v1.2.3 From 9c438d6c2f958e38aa324a04ed37b9a072872038 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Tue, 17 Sep 2013 16:46:45 +0200 Subject: Fix the js and css cache seed to contain the update version --- inc/template.php | 1 + 1 file changed, 1 insertion(+) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 6eadd37e6..c08767e52 100644 --- a/inc/template.php +++ b/inc/template.php @@ -290,6 +290,7 @@ function tpl_metaheaders($alt = true) { global $QUERY; global $lang; global $conf; + global $updateVersion; // prepare the head array $head = array(); -- cgit v1.2.3 From a04f2bd5a2eae55dbbdbbcffbe7b500b689138e7 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 15 Oct 2013 16:08:45 +0200 Subject: not assign object from plugin_load by reference --- inc/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index c08767e52..868ef300c 100644 --- a/inc/template.php +++ b/inc/template.php @@ -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); } } -- cgit v1.2.3 From 443e135d59e9d227eec818dabf9ee64d7a73d474 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Wed, 16 Oct 2013 22:04:01 +0100 Subject: replace boolean conditional checks on possibly uninitialized vars with \!empty/empty/isset as appropriate --- inc/template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 868ef300c..b42c9d934 100644 --- a/inc/template.php +++ b/inc/template.php @@ -401,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).';'; @@ -680,12 +680,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; @@ -1412,7 +1412,7 @@ function tpl_actiondropdown($empty = '', $button = '>') { echo '
'; echo ''; if($REV) echo ''; - if ($_SERVER['REMOTE_USER']) { + if (!empty($_SERVER['REMOTE_USER'])) { echo ''; } @@ -1794,7 +1794,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' : '', ); -- cgit v1.2.3 From 4c4b65c86f4906b0cdd7b3115636ec829bb7099f Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Sun, 20 Oct 2013 22:04:48 +0200 Subject: Fix handling of the legacy subscription action name --- inc/template.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index b42c9d934..e967bf27d 100644 --- a/inc/template.php +++ b/inc/template.php @@ -606,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; @@ -701,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; -- cgit v1.2.3 From a1288caece2153c08e04252643c89815c1be2a66 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Thu, 31 Oct 2013 23:56:08 +0100 Subject: localize some meta header titels. Fixes FS#2409 --- inc/template.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index e967bf27d..41f398016 100644 --- a/inc/template.php +++ b/inc/template.php @@ -318,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']) { @@ -336,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, '&') ); } -- cgit v1.2.3