public $border = 0;
public $borderColor = '#ffffff';
public $maxWidth = 0;
+ protected $role = 'button';
protected $_init;
$this->init();
}
+ public function getTooltipAttribute($t = null)
+ {
+ if (null === $t) {
+ $t = $this->getTooltip();
+ }
+ if ($t !== false) {
+ $escaped = htmlspecialchars($t, ENT_QUOTES);
+ $tooltip = ' data-tooltip="' . $escaped . '"';
+ $tooltip .= ' aria-label="' . $escaped . '"';
+ return $tooltip;
+ } else {
+ return '';
+ }
+ }
+
public function overlapDoublePage()
{
return ($this->page % 2 == 0 && $this->left + $this->width > $this->compiler->width);
public function getAdditionnalContent()
{
- $res = '';
+ $res = ' role="' . $this->role . '"';
if ($this->maxWidth > 0) {
$res .= ' data-max-width="' . $this->maxWidth . '"';
}
class normalLink extends wsHTML5Link
{
+ protected $role = 'link';
public function getHTMLContent()
{
if (count($class)) {
$attrs .= ' class="' . implode(' ', $class) . '"';
}
- $t = $this->getTooltip();
- if ($t !== false) {
- $attrs .= ' data-tooltip="' . htmlentities($t, ENT_QUOTES) . '"';
- }
+ $attrs .= $this->getTooltipAttribute();
if (isset($this->extra->blinkdelay)) {
$attrs .= ' data-blinkdelay="' . intval($this->extra->blinkdelay) . '"';
}
return '<a href="' . $this->getURL() . '" data-type="' . $this->type . '" target="' . $this->getTarget() . '"' . $attrs . $this->getAdditionnalContent() . $this->getTrack() . '></a>';
}
+
public function getTrack()
{
return '';
return $alt;
}
+ public function getAdditionnalContent()
+ {
+ return parent::getAdditionnalContent() . ' aria-hidden="true"';
+ }
+
}
class htmlMultimediaPopupLink extends htmlMultimediaPopupImage
class webLink extends normalLink
{
+ protected $role = 'link';
+
public function getURL()
{
$res = str_replace('"', '\'', wsHTML5Link::getUniversalLocation($this->to));
class mailLink extends normalLink
{
+ protected $role = 'link';
public function getURL()
{
class phoneLink extends mailLink
{
+ protected $role = 'link';
public function getURL()
{
}
}
+ public function getAdditionnalContent()
+ {
+ return parent::getAdditionnalContent() . ' role="button"';
+ }
+
public function getDefaultTooltip()
{
return 'go to page';
public function getHTMLContent()
{
-
-
$this->copyExternalFile($this->to, true);
$w = round($this->width * $this->getCssScale());
class fileLink extends normalLink
{
+ protected $role = 'link';
public function getURL()
{
class wescoLink extends normalLink
{
+ protected $role='link';
public static function _getURL($to)
{
return self::_getURLOfType('wesco', $to);
class pierronLink extends normalLink
{
+ protected $role = 'link';
public function getURL()
{
if (count($class)) {
$c = ' class="' . implode(' ', $class) . '"';
}
- $tooltip = '';
- $t = $this->getTooltip();
- if ($t !== false) {
- $tooltip = ' data-tooltip="' . htmlspecialchars($t, ENT_QUOTES) . '"';
- }
+ $tooltip = $this->getTooltipAttribute();
+
return '<a href="#" ' . $tooltip . $c . $this->getAdditionnalContent() . '></a>';
}
class flfLink extends wescoLink
{
+ protected $role = 'link';
public function getURL()
{
class customLink extends wescoLink
{
+ protected $role = 'link';
+
public static function getCustomInstance($id, $init, &$compiler)
{
$e = explode(':', $init['to']);