From bf10fd756a04b6c0d965dfef5767862cc50d4dc9 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/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 ++-- 12 files changed, 24 insertions(+), 25 deletions(-) diff --git a/ihtml/themes/breezy/framework.tpl b/ihtml/themes/breezy/framework.tpl index d3c3d2434..67a78dd23 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 1f7f6674c..28ce334d1 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/recovery.tpl b/ihtml/themes/breezy/recovery.tpl index b1230156a..61a09b319 100644 --- a/ihtml/themes/breezy/recovery.tpl +++ b/ihtml/themes/breezy/recovery.tpl @@ -10,7 +10,7 @@ <form action='recovery.php{$params}' method='post' name='mainform' onSubmit='js_check(this);return true;'> <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 0351c080f..a57f0f1d3 100644 --- a/ihtml/themes/legacy/recovery.tpl +++ b/ihtml/themes/legacy/recovery.tpl @@ -12,7 +12,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 bbe0bdce4..1e9f5f1c0 100644 --- a/include/class_baseSelector.inc +++ b/include/class_baseSelector.inc @@ -251,7 +251,7 @@ class baseSelector $this->tree .= "<li><a$selected $link>". '<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 83f7b2d59..6d16ff806 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -1193,7 +1193,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; } @@ -1338,7 +1338,7 @@ class listing $result = '<input type="hidden" name="act" id="actionmenu" value="">'. '<div style="display:none"><input type="submit" 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']); @@ -1352,7 +1352,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>'; } @@ -1391,7 +1391,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>"; } @@ -1666,7 +1666,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>'; } } @@ -1730,7 +1730,7 @@ class listing if ($this->snapshotHandler->hasDeletedSnapshots()) { $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>"; } } @@ -1744,7 +1744,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'>"; // Export CVS as build in exporter foreach ($this->exporter as $action => $exporter) { @@ -1781,7 +1781,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 d94e980b5..281ee55da 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -436,7 +436,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 3b136f7dd..f1155cb12 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -206,7 +206,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 56b3a92f4..b6787011f 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>"; $display .= back_to_main(); return $display; diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index 10e811131..2a607334c 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -694,7 +694,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->header .= back_to_main(); $this->displayPlugin = FALSE; @@ -832,8 +832,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 03dd16c50..a22454428 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