Do not add aria-label to icons and images with titles if aria-hidden is set

This commit is contained in:
Johannes Meyer 2015-02-27 12:12:24 +01:00
parent f2259557c8
commit 4f0bddd7da
2 changed files with 4 additions and 4 deletions

View File

@ -32,7 +32,7 @@ class Help extends Zend_Form_Decorator_Abstract
* *
* @param bool $state * @param bool $state
* *
* @return Feedback * @return Help
*/ */
public function setAccessible($state = true) public function setAccessible($state = true)
{ {
@ -85,7 +85,7 @@ class Help extends Zend_Form_Decorator_Abstract
. '</span>' . $content; . '</span>' . $content;
} }
$content = $this->getView()->icon('help', $description) . $content; $content = $this->getView()->icon('help', $description, array('aria-hidden' => 'true')) . $content;
} }
return $content; return $content;

View File

@ -54,7 +54,7 @@ $this->addHelperFunction('img', function ($url, $params = null, array $propertie
} }
if (array_key_exists('title', $properties)) { if (array_key_exists('title', $properties)) {
if (! array_key_exists('aria-label', $properties)) { if (! array_key_exists('aria-label', $properties) && !array_key_exists('aria-hidden', $properties)) {
$properties['aria-label'] = $properties['title']; $properties['aria-label'] = $properties['title'];
} }
} elseif (! array_key_exists('aria-hidden', $properties)) { } elseif (! array_key_exists('aria-hidden', $properties)) {
@ -83,7 +83,7 @@ $this->addHelperFunction('icon', function ($img, $title = null, array $propertie
$properties['role'] = 'img'; $properties['role'] = 'img';
$properties['title'] = $title; $properties['title'] = $title;
if (! array_key_exists('aria-label', $properties)) { if (! array_key_exists('aria-label', $properties) && !array_key_exists('aria-hidden', $properties)) {
$properties['aria-label'] = $title; $properties['aria-label'] = $title;
} }
} elseif (! array_key_exists('aria-hidden', $properties)) { } elseif (! array_key_exists('aria-hidden', $properties)) {