From 9dbc42be48ffc78ee555848c79a1d5b9fb8964a5 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 22 Feb 2017 11:11:05 +0100 Subject: [PATCH 1/2] output newline after logo images --- Template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Template.php b/Template.php index 374b57d..0e375cd 100644 --- a/Template.php +++ b/Template.php @@ -116,7 +116,7 @@ class Template { $attributes[$attr] = $media; // return the full tag - return '<' . $tag . ' ' . buildAttributes($attributes) . ' />'; + return '<' . $tag . ' ' . buildAttributes($attributes) . ' />' . "\n"; } /** From e17d84d6e90778c4973aa621a4a37fbf7d8bc9fd Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Wed, 22 Feb 2017 11:11:36 +0100 Subject: [PATCH 2/2] fix alt pre/postfixes for logo alt tags need to mention what kind of stugg is shown. It changes depending on if it's liknked or not. --- Template.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/Template.php b/Template.php index 0e375cd..f1f71f4 100644 --- a/Template.php +++ b/Template.php @@ -127,12 +127,20 @@ class Template { public function mainLogo() { global $conf; + // homepage logo should not link to itself (BITV accessibility requirement) + $linkit = (strcmp(wl(), $_SERVER['REQUEST_URI']) !== 0); + if($linkit) { + $title = $conf['title'] . tpl_getLang('adjunct_linked_logo_text'); + } else { + $title = tpl_getLang('adjunct_start_logo_text') . $conf['title']; + } + $desktop = self::getResizedImgTag( 'img', array( 'class' => 'mobile-hide', 'src' => array(tpl_getConf('logo'), 'wiki:logo-wide.png', 'wiki:logo.png'), - 'alt' => tpl_getLang('adjunct_start_logo_text') . $conf['title'], + 'alt' => $title, ), 0, 0 ); @@ -141,18 +149,18 @@ class Template { array( 'class' => 'mobile-only', 'src' => array('wiki:logo-32x32.png', 'wiki:favicon.png', 'wiki:logo-square.png', 'wiki:logo.png', tpl_getConf('logo')), - 'alt' => tpl_getLang('adjunct_start_logo_text') . $conf['title'], + 'alt' => $title, ), 32, 32 ); // homepage logo should not link to itself (BITV accessibility requirement) - if(strcmp(wl(), $_SERVER['REQUEST_URI']) === 0) { - echo $desktop; - echo $mobile; - } else { + if($linkit) { tpl_link(wl(), $desktop, 'accesskey="h" title="[H]"'); tpl_link(wl(), $mobile, 'accesskey="h" title="[H]"'); + } else { + echo $desktop; + echo $mobile; } } }