From cab5ab7400d03c2fef7dc99fada6e70112586225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come@opensides.be> Date: Wed, 31 Oct 2018 16:49:40 +0100 Subject: [PATCH] :ambulance: fix(core) Remove useless alt attribute on img tags Made sure to empty alt attribute when an img is decoration and does not provide information. In some files also fixed some alt content when it made sense issue #5917 --- ihtml/themes/breezy/framework.tpl | 8 ++++---- ihtml/themes/breezy/login.tpl | 2 +- ihtml/themes/breezy/management/actionmenu.tpl | 8 ++++---- .../themes/breezy/management/filter-element.tpl | 2 +- ihtml/themes/breezy/management/filter.tpl | 4 ++-- ihtml/themes/breezy/recovery.tpl | 2 +- ihtml/themes/legacy/recovery.tpl | 2 +- ihtml/themes/legacy/setup_header.tpl | 2 +- include/class_baseSelector.inc | 2 +- include/class_listing.inc | 16 ++++++++-------- include/class_pluglist.inc | 2 +- include/functions.inc | 2 +- include/simpleplugin/class_multiPlugin.inc | 2 +- include/simpleplugin/class_simplePlugin.inc | 5 ++--- setup/setup_frame.tpl | 4 ++-- 15 files changed, 31 insertions(+), 32 deletions(-) diff --git a/ihtml/themes/breezy/framework.tpl b/ihtml/themes/breezy/framework.tpl index 9234dbb91..a23d0920f 100644 --- a/ihtml/themes/breezy/framework.tpl +++ b/ihtml/themes/breezy/framework.tpl @@ -5,16 +5,16 @@ <form action="main.php{$plug}" name="mainform" id="mainform" method="post" enctype="multipart/form-data"> <div class="setup-header"> <div id="header-left"> - <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory"/> + <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory logo"/> <a class="maintitlebar" href="main.php?reset=1"> - <img src="geticon.php?context=actions&icon=go-home&size=22" alt="Main"/> {t}Main{/t} + <img src="geticon.php?context=actions&icon=go-home&size=22" alt=""/> {t}Main{/t} </a> <a class="maintitlebar logout" href="index.php?signout=1"> - <img src="geticon.php?context=actions&icon=application-exit&size=22" alt="Sign out"/> {t}Sign out{/t} + <img src="geticon.php?context=actions&icon=application-exit&size=22" alt=""/> {t}Sign out{/t} </a> <a class="plugtop"> - <img src="{$headline_image|escape}" alt="{t}{$headline|escape}{/t}"/>{t}{$headline|escape}{/t} + <img src="{$headline_image|escape}" alt=""/>{t}{$headline|escape}{/t} </a> </div> <div id="header-right"> diff --git a/ihtml/themes/breezy/login.tpl b/ihtml/themes/breezy/login.tpl index 6c7b5a13e..4fc417281 100644 --- a/ihtml/themes/breezy/login.tpl +++ b/ihtml/themes/breezy/login.tpl @@ -11,7 +11,7 @@ {$msg_dialogs} <div id="window-titlebar"> - <img id="fd-logo" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory"/> + <img id="fd-logo" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory logo"/> <p> {t}Sign in{/t} </p> diff --git a/ihtml/themes/breezy/management/actionmenu.tpl b/ihtml/themes/breezy/management/actionmenu.tpl index 8d9d3f491..c297dcb70 100644 --- a/ihtml/themes/breezy/management/actionmenu.tpl +++ b/ihtml/themes/breezy/management/actionmenu.tpl @@ -4,17 +4,17 @@ <li id="actionmenu_{$entry.name|escape}" {if $entry.separator}style="border-top:1px solid #AAA"{/if}> {if isset($entry.actions)} <a href="#"> - <img src="{$entry.icon|escape}" alt="{$entry.name|escape}"/> {$entry.label|escape} + <img src="{$entry.icon|escape}" alt=""/> {$entry.label|escape} <img src="images/forward-arrow.png" alt="forward arrow"/> </a> {menu data=$entry.actions level=$level+1} {elseif $entry.enabled} <a href="#" onClick="document.getElementById('actionmenu').value='{$entry.name|escape}';document.getElementById('exec_act').click();"> - <img src="{$entry.icon|escape}" alt="{$entry.name|escape}"> {$entry.label|escape} + <img src="{$entry.icon|escape}" alt=""/> {$entry.label|escape} </a> {else} <a> - <img src="{$entry.icon|escape}&disabled=1" alt="{$entry.name|escape}"> {$entry.label|escape} + <img src="{$entry.icon|escape}&disabled=1" alt=""/> {$entry.label|escape} </a> {/if} </li> @@ -27,7 +27,7 @@ <div style="display:none"><input type="submit" formnovalidate="formnovalidate" name="exec_act" id="exec_act" value=""/></div> <ul class="level1" id="root"> <li> - <a href="#">{t}Actions{/t} <img class="center optional" src="images/down-arrow.png" alt="down arrow"/></a> + <a href="#">{t}Actions{/t} <img class="center optional" src="images/down-arrow.png" alt=""/></a> {menu data=$actions} </li> </ul> diff --git a/ihtml/themes/breezy/management/filter-element.tpl b/ihtml/themes/breezy/management/filter-element.tpl index 686a6edef..152e0c9fc 100644 --- a/ihtml/themes/breezy/management/filter-element.tpl +++ b/ihtml/themes/breezy/management/filter-element.tpl @@ -4,7 +4,7 @@ <input type="checkbox" id="{$key}" name="{$key}" value="1" {if ($input.checked)}checked="checked"{/if}/> {if isset($input.icon)} - <img src="{$input.icon|escape}" alt="{$key}"/> + <img src="{$input.icon|escape}" alt=""/> {else} <img src="images/empty.png" alt=""/> {/if} diff --git a/ihtml/themes/breezy/management/filter.tpl b/ihtml/themes/breezy/management/filter.tpl index 1991fa464..783b562b7 100644 --- a/ihtml/themes/breezy/management/filter.tpl +++ b/ihtml/themes/breezy/management/filter.tpl @@ -10,7 +10,7 @@ <label for="{$key}"> <input type="checkbox" id="{$key}" name="{$key}" value="1" {if ($type.show)}checked="checked"{/if}/> - <img src="{$type.infos.icon|escape}" alt="{$key}"/> + <img src="{$type.infos.icon|escape}" alt=""/> {$type.infos.name|escape} </label> {/foreach} @@ -18,7 +18,7 @@ <label for="filter_type_TEMPLATE"> <input type="checkbox" id="filter_type_TEMPLATE" name="filter_type_TEMPLATE" value="1" {if ($TEMPLATES)}checked="checked"{/if}/> - <img src="geticon.php?context=devices&icon=template&size=16" alt="filter_type_TEMPLATE"/> + <img src="geticon.php?context=devices&icon=template&size=16" alt=""/> {t}Template{/t} </label> {/if} diff --git a/ihtml/themes/breezy/recovery.tpl b/ihtml/themes/breezy/recovery.tpl index 6a6ddd20c..5d5642498 100644 --- a/ihtml/themes/breezy/recovery.tpl +++ b/ihtml/themes/breezy/recovery.tpl @@ -11,7 +11,7 @@ <input type="hidden" name="CSRFtoken" value="{$CSRFtoken}"/> <div id="window-titlebar"> - <img id="fd-logo" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory"/> + <img id="fd-logo" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory logo"/> <p> {t}Lost password{/t} </p> diff --git a/ihtml/themes/legacy/recovery.tpl b/ihtml/themes/legacy/recovery.tpl index 1f4da0945..bf9873709 100644 --- a/ihtml/themes/legacy/recovery.tpl +++ b/ihtml/themes/legacy/recovery.tpl @@ -13,7 +13,7 @@ <div id="window-titlebar"> <p> - <img class="center" src="geticon.php?context=status&icon=dialog-password&size=48" alt="{t}Password{/t}" title="{t}Password{/t}"/> + <img class="center" src="geticon.php?context=status&icon=dialog-password&size=48" alt=""/> {t}Lost password{/t} </p> </div> diff --git a/ihtml/themes/legacy/setup_header.tpl b/ihtml/themes/legacy/setup_header.tpl index a6d59ef38..849153c1d 100644 --- a/ihtml/themes/legacy/setup_header.tpl +++ b/ihtml/themes/legacy/setup_header.tpl @@ -1,6 +1,6 @@ <div class="setup-header"> <div id="header-left"> - <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory"/> + <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory logo"/> </div> <div id="header-right"> </div> diff --git a/include/class_baseSelector.inc b/include/class_baseSelector.inc index f4311c2d9..93ad86bcf 100644 --- a/include/class_baseSelector.inc +++ b/include/class_baseSelector.inc @@ -238,7 +238,7 @@ class baseSelector $this->tree .= '<li><a'.$selected.' '.$link.' title="'.$base.'">'. '<img class="center" '. 'src="'.htmlentities($config->department_info[$base]['img'], ENT_COMPAT, 'UTF-8').'" '. - 'alt="'.htmlentities($config->department_info[$base]['name'], ENT_COMPAT, 'UTF-8').'"/> '. + 'alt=""/> '. $this->escape($config->department_info[$base]['name']). (($config->department_info[$base]['description'] == '') ? '' : ' <span class="informal">['.$this->escape($config->department_info[$base]['description']).']</span>'). '</a>'; diff --git a/include/class_listing.inc b/include/class_listing.inc index 0db3db001..732d98768 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -1168,7 +1168,7 @@ class listing /* Draw reload button, this button is enabled everytime */ $result["RELOAD"] = "<input class='center optional' type='image' src='geticon.php?context=actions&icon=view-refresh&size=16' ". - "title='"._("Reload list")."' name='REFRESH' alt='"._("Submit")."'>"; + "title='"._("Reload list")."' name='REFRESH' alt='"._("Reload list")."'>"; return $result; } @@ -1311,7 +1311,7 @@ class listing $result = '<input type="hidden" name="act" id="actionmenu" value="">'. '<div style="display:none"><input type="submit" formnovalidate="formnovalidate" name="exec_act" id="exec_act" value=""/></div>'. '<ul class="level1" id="root"><li><a href="#">'._('Actions'). - ' <img class="center optional" src="images/down-arrow.png" alt="down arrow"/></a>'; + ' <img class="center optional" src="images/down-arrow.png" alt=""/></a>'; // Build ul/li list $result .= $this->recurseActions($this->xmlData['actionmenu']['action']); @@ -1325,7 +1325,7 @@ class listing .'<a href="#" onClick="' ."document.getElementById('actionmenu').value='$action';document.getElementById('exec_act').click();" .'">' - .'<img src="'.htmlentities($icon, ENT_COMPAT, 'UTF-8').'" alt="'.$action.'" class="center"> '.$name.'</a>' + .'<img src="'.htmlentities($icon, ENT_COMPAT, 'UTF-8').'" alt="" class="center"/> '.$name.'</a>' .'</li>'; } @@ -1364,7 +1364,7 @@ class listing if (isset($action['label'])) { $img = ""; if (isset($action['image'])) { - $img = "<img class='center' src='".htmlentities($action['image'], ENT_COMPAT, 'UTF-8')."' alt='".$action['label']."'/> "; + $img = "<img class='center' src='".htmlentities($action['image'], ENT_COMPAT, 'UTF-8')."' alt=''/> "; } $result .= "<li id='actionmenu_".strtolower($action['label'])."'$separator><a href='#'>$img"._($action['label'])." <img src='images/forward-arrow.png' alt='forward arrow'/></a>"; } @@ -1640,7 +1640,7 @@ class listing if ($this->copyPasteHandler->entries_queued()) { $result .= $this->renderActionMenuActionLink($separator, 'paste', _('Paste'), 'geticon.php?context=actions&icon=edit-paste&size=16'); } else { - $result .= "<li$separator>".'<a href="#"><img src="geticon.php?context=actions&icon=edit-paste&size=16&disabled=1" alt="paste" class="center"> '._('Paste').'</a></li>'; + $result .= "<li$separator>".'<a href="#"><img src="geticon.php?context=actions&icon=edit-paste&size=16&disabled=1" alt="" class="center"/> '._('Paste').'</a></li>'; } } @@ -1704,7 +1704,7 @@ class listing if ($this->snapshotHandler->hasDeletedSnapshots($this->parent->getSnapshotBases())) { $result .= $this->renderActionMenuActionLink($separator, 'restore', _('Restore snapshots'), 'geticon.php?context=actions&icon=document-restore&size=16'); } else { - $result .= "<li$separator><a href='#'><img src='geticon.php?context=actions&icon=document-restore&size=16&disabled=1' alt='restore' class='center'> "._("Restore snapshots")."</a></li>"; + $result .= "<li$separator><a href='#'><img src='geticon.php?context=actions&icon=document-restore&size=16&disabled=1' alt='' class='center'> "._("Restore snapshots")."</a></li>"; } } @@ -1718,7 +1718,7 @@ class listing $result = ""; // Draw entries - $result .= "<li$separator id='actionmenu_exportList'><a href='#'><img class='center' src='geticon.php?context=actions&icon=document-export&size=16' alt='export'> "._("Export list")." <img src='images/forward-arrow.png' alt='arrow'></a><ul class='level3'>"; + $result .= "<li$separator id='actionmenu_exportList'><a href='#'><img class='center' src='geticon.php?context=actions&icon=document-export&size=16' alt=''> "._("Export list")." <img src='images/forward-arrow.png' alt='arrow'></a><ul class='level3'>"; // Render export actions foreach ($this->exporters as $action => $exporter) { @@ -1755,7 +1755,7 @@ class listing } else { $result .= '<img class="center"'. ' src="geticon.php?context=actions&icon=document-restore&size=16&disabled=1"'. - ' alt="restore"/>'; + ' alt="'._('Restore snapshot').'"/>'; } } diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 1c65ea481..7e7d79dde 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -445,7 +445,7 @@ class pluglist { } $entries .= '<div class="iconmenu" id="menuitem_icon_'.$id.'" onClick=\'location.href="'.$href.'"\' title="'.$plDescription.'">'; - $item = '<div class="imgcontainer"><img src="'.$image.'" alt="'.$plHeadline.' icon"/></div><span> '.$plHeadline.'</span>'; + $item = '<div class="imgcontainer"><img src="'.$image.'" alt=""/></div><span> '.$plHeadline.'</span>'; $entries .= $item."</div>\n"; } diff --git a/include/functions.inc b/include/functions.inc index 11d86370c..176e34ca0 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -185,7 +185,7 @@ function DEBUG($level, $line, $function, $file, $data, $info = '') if (session::global_get('DEBUGLEVEL') & $level) { if ($first) { echo '<div id="debug-handling" class="notice">'. - '<img src="geticon.php?context=status&icon=dialog-information&size=22" alt="info icon" style="vertical-align:middle;margin-right:.2em;"/>'. + '<img src="geticon.php?context=status&icon=dialog-information&size=22" alt="Information" style="vertical-align:middle;margin-right:.2em;"/>'. 'There is some debug output '. '<button onClick="javascript:$$(\'div.debug_div\').each(function (a) { a.toggle(); });">Toggle</button>'. '</div>'; diff --git a/include/simpleplugin/class_multiPlugin.inc b/include/simpleplugin/class_multiPlugin.inc index 2a029e738..74d358ade 100644 --- a/include/simpleplugin/class_multiPlugin.inc +++ b/include/simpleplugin/class_multiPlugin.inc @@ -75,7 +75,7 @@ class multiPlugin extends simplePlugin } unset($plug); if (!$enabled) { - $display = '<img alt="" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. + $display = '<img alt="'._('Error').'" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. msgPool::noValidExtension()."</b>"; return $display; } diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index cdec82add..c7963b7b8 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -699,7 +699,7 @@ class simplePlugin } } elseif (!$this->is_account) { $plInfo = pluglist::pluginInfos(get_class($this)); - $this->header = '<img alt="" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. + $this->header = '<img alt="'._('Error').'" src="geticon.php?context=status&icon=dialog-error&size=16" align="middle"/> <b>'. msgPool::noValidExtension($plInfo['plShortName'])."</b>"; $this->displayPlugin = FALSE; return $this->header.$this->inheritanceDisplay(); @@ -835,8 +835,7 @@ class simplePlugin if (isset($sectionInfo['icon'])) { $legend = '<img '. 'src="'.htmlentities($sectionInfo['icon'], ENT_COMPAT, 'UTF-8').'" '. - 'alt="section '.$sectionInfo['name'].' icon" '. - 'title="section '.$sectionInfo['name'].' icon" '. + 'alt="" '. '/>'.$legend; } $smarty->assign("section", $legend); diff --git a/setup/setup_frame.tpl b/setup/setup_frame.tpl index a5b10331d..ba450cb00 100644 --- a/setup/setup_frame.tpl +++ b/setup/setup_frame.tpl @@ -4,9 +4,9 @@ <form action="setup.php" name="mainform" id="mainform" method="post" enctype="multipart/form-data"> <div class="setup-header"> <div id="header-left"> - <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory"/> + <img id="fd-logo" class="optional" src="geticon.php?context=applications&icon=fusiondirectory&size=48" alt="FusionDirectory logo"/> <a class="plugtop"> - <img src="{$headline_image|escape}" alt="{t}{$headline}{/t}"/>{t}{$headline}{/t} + <img src="{$headline_image|escape}" alt=""/>{t}{$headline}{/t} </a> </div> <div id="header-right"> -- GitLab