From bae36d947e411cb24d82cb836b2d761f594b7f2c Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 13 May 2007 09:21:27 +0200 Subject: disable alternative links for disabled actions When export_raw or export_xhtml is disabled no rel darcs-hash:20070513072127-7ad00-e2a2451102cbaaef7de4a12982bd14da4b90b866.gz --- inc/template.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'inc') diff --git a/inc/template.php b/inc/template.php index 76e016878..bbd77d586 100644 --- a/inc/template.php +++ b/inc/template.php @@ -203,10 +203,16 @@ function tpl_metaheaders($alt=true){ $head['link'][] = array( 'rel'=>'alternate', 'type'=>'application/rss+xml', 'title'=>'Current Namespace', 'href'=>DOKU_BASE.'feed.php?mode=list&ns='.$INFO['namespace']); - $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/html', 'title'=>'Plain HTML', - 'href'=>exportlink($ID, 'xhtml', '', false, '&')); - $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/plain', 'title'=>'Wiki Markup', - 'href'=>exportlink($ID, 'raw', '', false, '&')); + + if(actionOK('export_xhtml')){ + $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/html', 'title'=>'Plain HTML', + 'href'=>exportlink($ID, 'xhtml', '', false, '&')); + } + + if(actionOK('export_raw')){ + $head['link'][] = array( 'rel'=>'alternate', 'type'=>'text/plain', 'title'=>'Wiki Markup', + 'href'=>exportlink($ID, 'raw', '', false, '&')); + } } // setup robot tags apropriate for different modes -- cgit v1.2.3