From c71db656795e82055d114764ad93f71a968a2f28 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 21 Jul 2013 21:20:44 +0100 Subject: added tpl_classes() to return useful layout classes --- inc/template.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index a87650b84..087e2f9df 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1748,5 +1748,23 @@ function tpl_media() { echo ''.NL; } +/** + * Return useful layout classes + * + * @author Anika Henke + */ +function tpl_classes() { + global $ACT, $conf, $ID, $INFO; + $classes = array( + 'dokuwiki', + 'mode_'.$ACT, + 'tpl_'.$conf['template'], + ($_SERVER['REMOTE_USER']) ? 'loggedIn' : '', + ($INFO['exists']) ? '' : 'notFound', + ($ID == $conf['start']) ? 'home' : '', + ); + return join(' ', $classes); +} + //Setup VIM: ex: et ts=4 : -- cgit v1.2.3 From cd997f938b450010efa93aa8a65ecbed9a68a32e Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 31 Jul 2013 14:04:56 +0200 Subject: include updateVersion in CSS/JS tseed to force reload on update --- inc/template.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index a87650b84..b8129f914 100644 --- a/inc/template.php +++ b/inc/template.php @@ -291,12 +291,10 @@ function tpl_metaheaders($alt = true) { $head = array(); // prepare seed for js and css - $tseed = 0; + $tseed = $updateVersion; $depends = getConfigFiles('main'); - foreach($depends as $f) { - $time = @filemtime($f); - if($time > $tseed) $tseed = $time; - } + foreach($depends as $f) $tseed .= @filemtime($f); + $tseed = md5($tseed); // the usual stuff $head['meta'][] = array('name'=> 'generator', 'content'=> 'DokuWiki'); -- cgit v1.2.3 From b1af90141d42f8844159ff4fad76968a8ee78687 Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 1 Aug 2013 16:32:28 +0200 Subject: Improve nofollow behaviour for ?do=index In response to FS#2766 - make namespace links in the browser sitemap nofollow - remove nofollow from browser sitemap link on the wiki start page when sitemap.xml generation is disabled --- inc/template.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index b8129f914..54407c2ab 100644 --- a/inc/template.php +++ b/inc/template.php @@ -541,6 +541,7 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals * @var string $accesskey * @var string $id * @var string $method + * @var bool $nofollow * @var array $params */ extract($data); @@ -555,10 +556,11 @@ function tpl_actionlink($type, $pre = '', $suf = '', $inner = '', $return = fals $akey = 'accesskey="'.$accesskey.'" '; $addTitle = ' ['.strtoupper($accesskey).']'; } + $rel = $nofollow ? 'rel="nofollow" ' : ''; $out = tpl_link( $linktarget, $pre.(($inner) ? $inner : $caption).$suf, 'class="action '.$type.'" '. - $akey.'rel="nofollow" '. + $akey.$rel. 'title="'.hsc($caption).$addTitle.'"', 1 ); } @@ -595,6 +597,7 @@ function tpl_get_action($type) { global $INFO; global $REV; global $ACT; + global $conf; // check disabled actions and fix the badly named ones if($type == 'history') $type = 'revisions'; @@ -604,6 +607,7 @@ function tpl_get_action($type) { $id = $ID; $method = 'get'; $params = array('do' => $type); + $nofollow = true; switch($type) { case 'edit': // most complicated type - we need to decide on current action @@ -641,6 +645,10 @@ function tpl_get_action($type) { break; case 'index': $accesskey = 'x'; + // allow searchbots to get to the sitemap from the homepage (when dokuwiki isn't providing a sitemap.xml) + if ($conf['start'] == $ID && !$conf['sitemap']) { + $nofollow = false; + } break; case 'top': $accesskey = 't'; @@ -711,7 +719,7 @@ function tpl_get_action($type) { return '[unknown %s type]'; break; } - return compact('accesskey', 'type', 'id', 'method', 'params'); + return compact('accesskey', 'type', 'id', 'method', 'params', 'nofollow'); } /** -- cgit v1.2.3 From 9805efa058358e0fcbd3976fa553901cabe0b2e0 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 17:20:25 +0100 Subject: added aria roles to search and acl manager --- 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 a87650b84..0f2144275 100644 --- a/inc/template.php +++ b/inc/template.php @@ -766,7 +766,7 @@ function tpl_searchform($ajax = true, $autocomplete = true) { // don't print the search form if search action has been disabled if(!actionOK('search')) return false; - print '