From 88945224671d69f8fae0a3d4ab1acf003d7d747d Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Thu, 13 Mar 2014 19:43:33 +0000 Subject: Add encoding fix to tpl_img_getTag() Run jpeg meta tags through cleanText for a conversion to UTF-8 from latin-1 if possible. MediaManager already uses this conversion. Addresses a side issue of FS#1988 --- 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 88964fada..ddbce8abb 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1018,7 +1018,7 @@ function tpl_img_getTag($tags, $alt = '', $src = null) { static $meta = null; if(is_null($meta)) $meta = new JpegMeta($src); if($meta === false) return $alt; - $info = $meta->getField($tags); + $info = cleanText($meta->getField($tags)); if($info == false) return $alt; return $info; } -- cgit v1.2.3 From 54be1338e56b721dd24c049153eea295b6f386d5 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Tue, 18 Mar 2014 13:19:05 +0100 Subject: allow disabling the rss feed --- inc/template.php | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 8bd3234cc..a3808aa81 100644 --- a/inc/template.php +++ b/inc/template.php @@ -318,15 +318,17 @@ function tpl_metaheaders($alt = true) { } if($alt) { - $head['link'][] = array( - 'rel' => 'alternate', 'type'=> 'application/rss+xml', - 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php' - ); - $head['link'][] = array( - 'rel' => 'alternate', 'type'=> 'application/rss+xml', - 'title'=> $lang['currentns'], - 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace'] - ); + if(actionOK('rss')) { + $head['link'][] = array( + 'rel' => 'alternate', 'type'=> 'application/rss+xml', + 'title'=> $lang['btn_recent'], 'href'=> DOKU_BASE.'feed.php' + ); + $head['link'][] = array( + 'rel' => 'alternate', 'type'=> 'application/rss+xml', + 'title'=> $lang['currentns'], + 'href' => DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace'] + ); + } if(($ACT == 'show' || $ACT == 'search') && $INFO['writable']) { $head['link'][] = array( 'rel' => 'edit', @@ -335,7 +337,7 @@ function tpl_metaheaders($alt = true) { ); } - if($ACT == 'search') { + if(actionOK('rss') && $ACT == 'search') { $head['link'][] = array( 'rel' => 'alternate', 'type'=> 'application/rss+xml', 'title'=> $lang['searchresult'], -- cgit v1.2.3 From fde860be8cb3ed16b2b0843b77b093a60397083e Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Fri, 16 May 2014 00:09:32 +0200 Subject: Move colon from code to language strings --- inc/template.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 35b54b4c3..2455adb96 100644 --- a/inc/template.php +++ b/inc/template.php @@ -836,7 +836,7 @@ function tpl_breadcrumbs($sep = '•') { $crumbs_sep = ' '.$sep.' '; //render crumbs, highlight the last one - print ''.$lang['breadcrumb'].':'; + print ''.$lang['breadcrumb'].''; $last = count($crumbs); $i = 0; foreach($crumbs as $id => $name) { @@ -876,7 +876,7 @@ function tpl_youarehere($sep = ' » ') { $parts = explode(':', $ID); $count = count($parts); - echo ''.$lang['youarehere'].': '; + echo ''.$lang['youarehere'].' '; // always print the startpage echo ''; @@ -920,7 +920,7 @@ function tpl_userinfo() { global $INPUT; if($INPUT->server->str('REMOTE_USER')) { - print $lang['loggedinas'].': '.userlink(); + print $lang['loggedinas'].' '.userlink(); return true; } return false; @@ -962,7 +962,7 @@ function tpl_pageinfo($ret = false) { $out .= ''.$fn.''; $out .= ' · '; $out .= $lang['lastmod']; - $out .= ': '; + $out .= ' '; $out .= $date; if($INFO['editor']) { $out .= ' '.$lang['by'].' '; @@ -973,7 +973,7 @@ function tpl_pageinfo($ret = false) { if($INFO['locked']) { $out .= ' · '; $out .= $lang['lockedby']; - $out .= ': '; + $out .= ' '; $out .= ''.editorinfo($INFO['locked']).''; } if($ret) { @@ -1062,9 +1062,9 @@ function tpl_img_meta() { echo '
'; foreach($tags as $tag) { $label = $lang[$tag['langkey']]; - if(!$label) $label = $tag['langkey']; + if(!$label) $label = $tag['langkey'] . ':'; - echo '
'.$label.':
'; + echo '
'.$label.'
'; if ($tag['type'] == 'date') { echo dformat($tag['value']); } else { -- cgit v1.2.3 From e8a2a143c4b67d54a907322b992320c2c778dafa Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Wed, 25 Jun 2014 15:55:20 +0200 Subject: Quick fix for #765 - ACL checks in the media manager ajax calls This should be superseded by a proper rewrite of the media manager code --- 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 2455adb96..c02c9f1ae 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1428,14 +1428,14 @@ function tpl_mediaFileList() { * @author Kate Arzamastseva */ function tpl_mediaFileDetails($image, $rev) { - global $AUTH, $NS, $conf, $DEL, $lang; + global $conf, $DEL, $lang; /** @var Input $INPUT */ global $INPUT; $removed = (!file_exists(mediaFN($image)) && file_exists(mediaMetaFN($image, '.changes')) && $conf['mediarevisions']); if(!$image || (!file_exists(mediaFN($image)) && !$removed) || $DEL) return; if($rev && !file_exists(mediaFN($image, $rev))) $rev = false; - if(isset($NS) && getNS($image) != $NS) return; + $ns = getNS($image); $do = $INPUT->str('mediado'); $opened_tab = $INPUT->str('tab_details'); @@ -1471,13 +1471,13 @@ function tpl_mediaFileDetails($image, $rev) { echo '
'.NL; if($opened_tab == 'view') { - media_tab_view($image, $NS, $AUTH, $rev); + media_tab_view($image, $ns, null, $rev); } elseif($opened_tab == 'edit' && !$removed) { - media_tab_edit($image, $NS, $AUTH); + media_tab_edit($image, $ns); } elseif($opened_tab == 'history' && $conf['mediarevisions']) { - media_tab_history($image, $NS, $AUTH); + media_tab_history($image, $ns); } echo '
'.NL; -- cgit v1.2.3 From 1fcaffa7efc29ea2239d34a92a265499caa36d65 Mon Sep 17 00:00:00 2001 From: Jurgen Date: Tue, 29 Jul 2014 10:01:27 +0200 Subject: Update template.php Removed creation of 'date', 'content'=> date('Y-m-d\TH:i:sO', $REV)); - } else { - $head['meta'][] = array('name'=> 'date', 'content'=> date('Y-m-d\TH:i:sO', $INFO['lastmod'])); - } - // keywords (explicit or implicit) if(!empty($INFO['meta']['subject'])) { $head['meta'][] = array('name'=> 'keywords', 'content'=> join(',', $INFO['meta']['subject'])); -- cgit v1.2.3 From 01f9be51e2f5b61e20deb8f9c92eccb62fa12a17 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sat, 2 Aug 2014 14:24:04 +0100 Subject: set canonical URL to root when on start page --- inc/template.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc/template.php') diff --git a/inc/template.php b/inc/template.php index 8b39529c5..7f3c68534 100644 --- a/inc/template.php +++ b/inc/template.php @@ -369,7 +369,11 @@ function tpl_metaheaders($alt = true) { } else { $head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,nofollow'); } - $head['link'][] = array('rel'=> 'canonical', 'href'=> wl($ID, '', true, '&')); + $canonicalUrl = wl($ID, '', true, '&'); + if ($ID == $conf['start']) { + $canonicalUrl = DOKU_URL; + } + $head['link'][] = array('rel'=> 'canonical', 'href'=> $canonicalUrl); } else { $head['meta'][] = array('name'=> 'robots', 'content'=> 'noindex,follow'); } -- cgit v1.2.3