From 0f9aa69e4e50c747309a5f446ec1f0cd9623095b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 29 Jul 2014 21:34:23 +0200 Subject: [PATCH] Fix: New: Differentiate text and img for better accessibility. --- .../boxes/box_graph_invoices_permonth.php | 2 +- .../box_graph_invoices_supplier_permonth.php | 2 +- .../core/boxes/box_graph_orders_permonth.php | 2 +- .../box_graph_orders_supplier_permonth.php | 2 +- .../boxes/box_graph_product_distribution.php | 2 +- .../boxes/box_graph_propales_permonth.php | 2 +- htdocs/core/boxes/modules_boxes.php | 2 +- htdocs/core/lib/functions.lib.php | 200 +++++++++--------- htdocs/holiday/admin/holiday.php | 6 +- htdocs/main.inc.php | 8 +- 10 files changed, 114 insertions(+), 114 deletions(-) diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index ad7cbc0e29c..a7006d1f4e1 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -222,7 +222,7 @@ class box_graph_invoices_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php index 58d3a27f834..f306b26eb28 100644 --- a/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_supplier_permonth.php @@ -221,7 +221,7 @@ class box_graph_invoices_supplier_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfBillsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php index 81c9185c68f..e701a4b9384 100644 --- a/htdocs/core/boxes/box_graph_orders_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_permonth.php @@ -222,7 +222,7 @@ class box_graph_orders_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php index 98779836576..56d822876a0 100644 --- a/htdocs/core/boxes/box_graph_orders_supplier_permonth.php +++ b/htdocs/core/boxes/box_graph_orders_supplier_permonth.php @@ -221,7 +221,7 @@ class box_graph_orders_supplier_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfOrdersByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/box_graph_product_distribution.php b/htdocs/core/boxes/box_graph_product_distribution.php index 0029866b75a..bca47dd9460 100644 --- a/htdocs/core/boxes/box_graph_product_distribution.php +++ b/htdocs/core/boxes/box_graph_product_distribution.php @@ -337,7 +337,7 @@ class box_graph_product_distribution extends ModeleBoxes } $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; diff --git a/htdocs/core/boxes/box_graph_propales_permonth.php b/htdocs/core/boxes/box_graph_propales_permonth.php index 61e83f3cd60..8efa4be54a8 100644 --- a/htdocs/core/boxes/box_graph_propales_permonth.php +++ b/htdocs/core/boxes/box_graph_propales_permonth.php @@ -227,7 +227,7 @@ class box_graph_propales_permonth extends ModeleBoxes $stringtoshow.=' '.$langs->trans("AmountOfProposalsByMonthHT"); $stringtoshow.='
'; $stringtoshow.=$langs->trans("Year").' '; - $stringtoshow.=''; + $stringtoshow.=''; $stringtoshow.=''; $stringtoshow.=''; if ($shownb && $showtot) diff --git a/htdocs/core/boxes/modules_boxes.php b/htdocs/core/boxes/modules_boxes.php index b7333602bab..ece19fe222c 100644 --- a/htdocs/core/boxes/modules_boxes.php +++ b/htdocs/core/boxes/modules_boxes.php @@ -225,7 +225,7 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" if (! empty($contents[$i][$j]['logo'])) { $logo=preg_replace("/^object_/i","",$contents[$i][$j]['logo']); - print img_object(':'.$langs->trans("Show"),$logo); + print img_object($langs->trans("Show"),$logo); } $maxlength=$MAXLENGTHBOX; diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index b5316f27bea..f658d2550dc 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1785,7 +1785,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo /** * Show picto whatever it's its name (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on title and alt. If text is "TextA:TextB", use Text A on alt and Text B on title. Alt only if param notitle is set to 1. * @param string $picto Name of image file to show ('filenew', ...) * If no extension provided, we use '.png'. Image must be stored into theme/xxx/img directory. * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img @@ -1798,7 +1798,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8',$nodo * @return string Return img tag * @see #img_object, #img_picto_common */ -function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) +function img_picto($titlealt, $picto, $options = '', $pictoisfullpath = false, $srconly=0, $notitle=0) { global $conf; @@ -1844,9 +1844,9 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon if ($srconly) return $fullpathpicto; else { - $tmparray=explode(':',$alt); - $alt=$tmparray[0]; - $title=empty($tmparray[1])?$alt:$tmparray[1]; + $tmparray=explode(':',$titlealt); + $title=$tmparray[0]; + $alt=empty($tmparray[1])?'':$tmparray[1]; return ''.dol_escape_htmltag($alt).''; // Alt is used for accessibility, title for popup } } @@ -1854,7 +1854,7 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon /** * Show a picto called object_picto (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image to show object_picto (example: user, group, action, bill, contract, propal, product, ...) * For external modules use imagename@mymodule to search into directory "img" of module. * @param string $options Add more attribute on img tag (ie: class="datecallink") @@ -1862,22 +1862,22 @@ function img_picto($alt, $picto, $options = '', $pictoisfullpath = false, $srcon * @return string Return img tag * @see #img_picto, #img_picto_common */ -function img_object($alt, $picto, $options = '', $pictoisfullpath = false) +function img_object($titlealt, $picto, $options = '', $pictoisfullpath = false) { - return img_picto($alt, 'object_'.$picto, $options, $pictoisfullpath); + return img_picto($titlealt, 'object_'.$picto, $options, $pictoisfullpath); } /** * Show picto (generic function) * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param string $options Add more attribute on img tag * @param int $pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see #img_object, #img_picto */ -function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0) +function img_picto_common($titlealt, $picto, $options = '', $pictoisfullpath = 0) { global $conf; @@ -1896,141 +1896,141 @@ function img_picto_common($alt, $picto, $options = '', $pictoisfullpath = 0) } } - return img_picto($alt, $path, $options, 1); + return img_picto($titlealt, $path, $options, 1); } /** * Show logo action * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $numaction Action to show * @return string Return an img tag */ -function img_action($alt, $numaction) +function img_action($titlealt, $numaction) { global $conf, $langs; - if ($alt == 'default') + if ($titlealt == 'default') { - if ($numaction == -1) $alt = $langs->transnoentitiesnoconv('ChangeDoNotContact'); - if ($numaction == 0) $alt = $langs->transnoentitiesnoconv('ChangeNeverContacted'); - if ($numaction == 1) $alt = $langs->transnoentitiesnoconv('ChangeToContact'); - if ($numaction == 2) $alt = $langs->transnoentitiesnoconv('ChangeContactInProcess'); - if ($numaction == 3) $alt = $langs->transnoentitiesnoconv('ChangeContactDone'); + if ($numaction == -1) $titlealt = $langs->transnoentitiesnoconv('ChangeDoNotContact'); + if ($numaction == 0) $titlealt = $langs->transnoentitiesnoconv('ChangeNeverContacted'); + if ($numaction == 1) $titlealt = $langs->transnoentitiesnoconv('ChangeToContact'); + if ($numaction == 2) $titlealt = $langs->transnoentitiesnoconv('ChangeContactInProcess'); + if ($numaction == 3) $titlealt = $langs->transnoentitiesnoconv('ChangeContactDone'); } - return img_picto($alt, 'stcomm'.$numaction.'.png'); + return img_picto($titlealt, 'stcomm'.$numaction.'.png'); } /** * Show pdf logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px * @return string Retourne tag img */ -function img_pdf($alt = 'default', $size = 3) +function img_pdf($titlealt = 'default', $size = 3) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Show'); + if ($titlealt == 'default') $titlealt = $langs->trans('Show'); - return img_picto($alt, 'pdf'.$size.'.png'); + return img_picto($titlealt, 'pdf'.$size.'.png'); } /** * Show logo + * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return tag img */ -function img_edit_add($alt = 'default') +function img_edit_add($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Add'); + if ($titlealt == 'default') $titlealt = $langs->trans('Add'); - return img_picto($alt, 'edit_add.png'); + return img_picto($titlealt, 'edit_add.png'); } /** * Show logo - * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @return string Retourne tag img + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @return string Return tag img */ -function img_edit_remove($alt = 'default') +function img_edit_remove($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Remove'); + if ($titlealt == 'default') $titlealt = $langs->trans('Remove'); - return img_picto($alt, 'edit_remove.png'); + return img_picto($titlealt, 'edit_remove.png'); } /** * Show logo editer/modifier fiche * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img - * @return string Retourne tag img + * @return string Return tag img */ -function img_edit($alt = 'default', $float = 0, $other = '') +function img_edit($titlealt = 'default', $float = 0, $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Modify'); + if ($titlealt == 'default') $titlealt = $langs->trans('Modify'); - return img_picto($alt, 'edit.png', ($float ? 'style="float: right"' : $other)); + return img_picto($titlealt, 'edit.png', ($float ? 'style="float: right"' : $other)); } /** * Show logo view card * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. - * @param float $float Si il faut y mettre le style "float: right" + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param float $float Si il faut y mettre le style "float: right" * @param string $other Add more attributes on img - * @return string Retourne tag img + * @return string Return tag img */ -function img_view($alt = 'default', $float = 0, $other = '') +function img_view($titlealt = 'default', $float = 0, $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('View'); + if ($titlealt == 'default') $titlealt = $langs->trans('View'); $options = ($float ? 'style="float: right" ' : '').$other; - return img_picto($alt, 'view.png', $options); + return img_picto($titlealt, 'view.png', $options); } /** * Show delete logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ -function img_delete($alt = 'default', $other = '') +function img_delete($titlealt = 'default', $other = '') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Delete'); + if ($titlealt == 'default') $titlealt = $langs->trans('Delete'); - return img_picto($alt, 'delete.png', $other); + return img_picto($titlealt, 'delete.png', $other); } /** * Show printer logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param string $other Add more attributes on img * @return string Retourne tag img */ -function img_printer($alt = "default", $other='') +function img_printer($titlealt = "default", $other='') { global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Print"); - return img_picto($alt,'printer.png',$other); + if ($titlealt=="default") $titlealt=$langs->trans("Print"); + return img_picto($titlealt,'printer.png',$other); } /** @@ -2056,159 +2056,159 @@ function img_help($usehelpcursor = 1, $usealttitle = 1) /** * Show info logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_info($alt = 'default') +function img_info($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Informations'); + if ($titlealt == 'default') $titlealt = $langs->trans('Informations'); - return img_picto($alt, 'info.png'); + return img_picto($titlealt, 'info.png'); } /** * Show warning logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $float If we must add style "float: right" * @return string Return img tag */ -function img_warning($alt = 'default', $float = 0) +function img_warning($titlealt = 'default', $float = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Warning'); + if ($titlealt == 'default') $titlealt = $langs->trans('Warning'); - return img_picto($alt, 'warning.png', ($float ? 'style="float: right"' : '')); + return img_picto($titlealt, 'warning.png', ($float ? 'style="float: right"' : '')); } /** * Show error logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_error($alt = 'default') +function img_error($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Error'); + if ($titlealt == 'default') $titlealt = $langs->trans('Error'); - return img_picto($alt, 'error.png'); + return img_picto($titlealt, 'error.png'); } /** * Show next logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_next($alt = 'default') +function img_next($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Next'); + if ($titlealt == 'default') $titlealt = $langs->trans('Next'); - return img_picto($alt, 'next.png'); + return img_picto($titlealt, 'next.png'); } /** * Show previous logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_previous($alt = 'default') +function img_previous($titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Previous'); + if ($titlealt == 'default') $titlealt = $langs->trans('Previous'); - return img_picto($alt, 'previous.png'); + return img_picto($titlealt, 'previous.png'); } /** * Show down arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ -function img_down($alt = 'default', $selected = 0) +function img_down($titlealt = 'default', $selected = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Down'); + if ($titlealt == 'default') $titlealt = $langs->trans('Down'); - return img_picto($alt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"'); + return img_picto($titlealt, ($selected ? '1downarrow_selected.png' : '1downarrow.png'), 'class="imgdown"'); } /** * Show top arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @return string Return img tag */ -function img_up($alt = 'default', $selected = 0) +function img_up($titlealt = 'default', $selected = 0) { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Up'); + if ($titlealt == 'default') $titlealt = $langs->trans('Up'); - return img_picto($alt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"'); + return img_picto($titlealt, ($selected ? '1uparrow_selected.png' : '1uparrow.png'), 'class="imgup"'); } /** * Show left arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_left($alt = 'default', $selected = 0, $options='') +function img_left($titlealt = 'default', $selected = 0, $options='') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Left'); + if ($titlealt == 'default') $titlealt = $langs->trans('Left'); - return img_picto($alt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1leftarrow_selected.png' : '1leftarrow.png'), $options); } /** * Show right arrow logo * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $selected Selected * @param string $options Add more attribute on img tag (For example 'style="float: right"') * @return string Return img tag */ -function img_right($alt = 'default', $selected = 0, $options='') +function img_right($titlealt = 'default', $selected = 0, $options='') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Right'); + if ($titlealt == 'default') $titlealt = $langs->trans('Right'); - return img_picto($alt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); + return img_picto($titlealt, ($selected ? '1rightarrow_selected.png' : '1rightarrow.png'), $options); } /** * Show tick logo if allowed * * @param string $allow Allow - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_allow($allow, $alt = 'default') +function img_allow($allow, $titlealt = 'default') { global $conf, $langs; - if ($alt == 'default') $alt = $langs->trans('Active'); + if ($titlealt == 'default') $titlealt = $langs->trans('Active'); - if ($allow == 1) return img_picto($alt, 'tick.png'); + if ($allow == 1) return img_picto($titlealt, 'tick.png'); return '-'; } @@ -2218,19 +2218,19 @@ function img_allow($allow, $alt = 'default') * Show MIME img of a file * * @param string $file Filename - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @return string Return img tag */ -function img_mime($file, $alt = '') +function img_mime($file, $titlealt = '') { require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; $mimetype = dol_mimetype($file, '', 1); $mimeimg = dol_mimetype($file, '', 2); - if (empty($alt)) $alt = 'Mime type: '.$mimetype; + if (empty($titlealt)) $titlealt = 'Mime type: '.$mimetype; - return img_picto_common($alt, 'mime/'.$mimeimg); + return img_picto_common($titlealt, 'mime/'.$mimeimg); } @@ -2238,21 +2238,21 @@ function img_mime($file, $alt = '') * Show phone logo. * Use img_picto instead. * - * @param string $alt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. + * @param string $titlealt Text on alt and title of image. Alt only if param notitle is set to 1. If text is "TextA:TextB", use Text A on alt and Text B on title. * @param int $option Option * @return string Return img tag * @deprecated */ -function img_phone($alt = 'default', $option = 0) +function img_phone($titlealt = 'default', $option = 0) { global $conf,$langs; - if ($alt == 'default') $alt = $langs->trans('Call'); + if ($titlealt == 'default') $titlealt = $langs->trans('Call'); if ($option == 1) $img = 'call'; else $img = 'call_out'; - return img_picto($alt, $img); + return img_picto($titlealt, $img); } diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php index 0ed80121042..1986ae1cdf7 100644 --- a/htdocs/holiday/admin/holiday.php +++ b/htdocs/holiday/admin/holiday.php @@ -357,15 +357,15 @@ if($cp_events == 1) { print ''."\n"; - foreach($cp->events as $infos_event) { - + foreach($cp->events as $infos_event) + { $var=!$var; print ''."\n"; print ''."\n"; print ' '.$langs->trans('DurationDays').''."\n"; print ''."\n"; - print ''."\n"; + print ''."\n"; print ''; $i++; diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 72c156c8f3e..17ed437c7a7 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1403,6 +1403,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logintext.='>'.$user->login.''; if ($user->societe_id) $logintext.=$companylink; $logintext.=''; + $loginhtmltext.=''.$langs->trans("User").''; $loginhtmltext.='
'.$langs->trans("Name").': '.$user->getFullName($langs); $loginhtmltext.='
'.$langs->trans("Login").': '.$user->login; @@ -1436,7 +1437,6 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a } else $appli.=" ".DOL_VERSION; - // Link info $logouttext=''; $logouthtmltext=$appli.'
'; if ($_SESSION["dol_authmode"] != 'forceuser' && $_SESSION["dol_authmode"] != 'http') @@ -1446,13 +1446,13 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logouttext .='trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); $logouttext .=''; } else { $logouthtmltext.=$langs->trans("NoLogoutProcessWithAuthMode",$_SESSION["dol_authmode"]); - $logouttext .= img_picto($langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); + $logouttext .= img_picto($langs->trans('Logout').":".$langs->trans('Logout'), 'logout.png', 'class="login"', 0, 0, 1); } print '
'."\n"; @@ -1483,7 +1483,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $qs=$_SERVER["QUERY_STRING"]; $qs.=(($qs && $morequerystring)?'&':'').$morequerystring; $text =''; - $text.= img_picto('', 'printer.png', 'class="printer"'); + $text.= img_picto(":".$langs->trans("PrintContentArea"), 'printer.png', 'class="printer"'); $text.=''; $toprightmenu.=$form->textwithtooltip('',$langs->trans("PrintContentArea"),2,1,$text,'login_block_elem',2); }