From 5d8b04314c66272659b0ca43f2b097422f2d70d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 18 Jan 2005 21:09:16 +0000 Subject: [PATCH] New: Ajout img_up et img_down --- htdocs/lib/functions.inc.php | 172 ++++++++++++++++------------------- 1 file changed, 79 insertions(+), 93 deletions(-) diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index ff0a4ed3f81..4d058f14290 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -331,11 +331,9 @@ function dolibarr_print_phone($phone) */ function img_actions($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Rendez-vous"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Rendez-vous"); + return ''.$alt.''; } /** @@ -343,11 +341,9 @@ function img_actions($alt = "default") */ function img_file($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Show"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Show"); + return ''.$alt.''; } /** @@ -355,11 +351,9 @@ function img_file($alt = "default") */ function img_folder($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Dossier"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Dossier"); + return ''.$alt.''; } /** @@ -368,11 +362,9 @@ function img_folder($alt = "default") */ function img_file_new($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Show"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Show"); + return ''.$alt.''; } /** @@ -380,11 +372,9 @@ function img_file_new($alt = "default") */ function img_pdf($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Show"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Show"); + return ''.$alt.''; } /** @@ -392,22 +382,18 @@ function img_pdf($alt = "default") */ function img_edit_add($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Add"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Add"); + return ''.$alt.''; } /** \brief Affiche logo - */ function img_edit_remove($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Remove"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Remove"); + return ''.$alt.''; } /** @@ -415,11 +401,9 @@ function img_edit_remove($alt = "default") */ function img_edit($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Modify"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Modify"); + return ''.$alt.''; } /** @@ -427,11 +411,9 @@ function img_edit($alt = "default") */ function img_delete($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Delete"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Delete"); + return ''.$alt.''; } /** @@ -439,11 +421,9 @@ function img_delete($alt = "default") */ function img_disable($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Disable"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Disable"); + return ''.$alt.''; } @@ -452,11 +432,9 @@ function img_disable($alt = "default") */ function img_info($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Informations"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Informations"); + return ''.$alt.''; } /** @@ -464,11 +442,9 @@ function img_info($alt = "default") */ function img_warning($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Show"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Show"); + return ''.$alt.''; } /** @@ -476,11 +452,9 @@ function img_warning($alt = "default") */ function img_alerte($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Alert"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Alert"); + return ''.$alt.''; } /** @@ -488,11 +462,9 @@ function img_alerte($alt = "default") */ function img_phone_in($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Modify"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Modify"); + return ''.$alt.''; } /** @@ -500,11 +472,9 @@ function img_phone_in($alt = "default") */ function img_phone_out($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Modify"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Modify"); + return ''.$alt.''; } /** @@ -512,11 +482,11 @@ function img_phone_out($alt = "default") */ function img_next($alt = "default") { + global $conf,$langs; if ($alt=="default") { - global $langs; $alt=$langs->trans("Next"); } - return ''.$alt.''; + return ''.$alt.''; } /** @@ -524,11 +494,29 @@ function img_next($alt = "default") */ function img_previous($alt = "default") { - if ($alt=="default") { - global $langs; - $alt=$langs->trans("Previous"); - } - return ''.$alt.''; + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Previous"); + return ''.$alt.''; +} + +/** + \brief Affiche logo bas +*/ +function img_down($alt = "default") +{ + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Down"); + return ''.$alt.''; +} + +/** + \brief Affiche logo haut +*/ +function img_up($alt = "default") +{ + global $conf,$langs; + if ($alt=="default") $alt=$langs->trans("Up"); + return ''.$alt.''; } /** @@ -965,16 +953,14 @@ function print_liste_field_titre($name, $file, $field, $begin="", $options="", $ print ''; } print $name." "; - print ''; - print 'A-Z'; - print ''; - print 'Z-A'; + print ''.img_down("A-Z").''; + print ''.img_up("A-Z").''; print ""; } /** \brief Affichage d'un titre - \param titre le titre a afficher + \param titre Le titre a afficher */ function print_titre($titre) { @@ -983,8 +969,8 @@ function print_titre($titre) /** \brief Affichage d'un titre d'une fiche, aligné a gauche - \param titre le titre a afficher - \param mesg message suplémentaire à afficher à droite + \param titre Le titre a afficher + \param mesg Message suplémentaire à afficher à droite */ function print_fiche_titre($titre, $mesg='') { @@ -1072,19 +1058,19 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so \param page numéro de la page \param file lien \param options autres parametres d'url a propager dans les liens ("" par defaut) - \param nextpage page suivante + \param nextpage faut-il une page suivante */ -function print_fleche_navigation($page,$file,$options='', $nextpage) +function print_fleche_navigation($page,$file,$options='',$nextpage) { global $conf, $langs; if ($page > 0) { - print ''.$langs->trans('; + print ''.img_previous($langs->trans("Previous")).''; } if ($nextpage > 0) { - print ''.$langs->trans('; + print ''.img_next($langs->trans("Next")).''; } }