diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index 39763283cad..8fa3e881bd1 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -25,7 +25,7 @@ * \file htdocs/adherents/admin/adherent.php * \ingroup member * \brief Page to setup the module Foundation - * \version $Id: adherent.php,v 1.18 2011/08/03 00:45:42 eldy Exp $ + * \version $Id: adherent.php,v 1.19 2011/08/17 15:56:23 eldy Exp $ */ require("../../main.inc.php"); @@ -195,7 +195,7 @@ print '
'; $var=!$var; if ($conf->global->ADHERENT_USE_MAILMAN) { - $lien=img_tick().' '; + $lien=img_picto($langs->trans("Active"),'tick').' '; $lien.=''.$langs->trans("Disable").''; // Edition des varibales globales $constantes=array('ADHERENT_MAILMAN_LISTS', @@ -238,7 +238,7 @@ else $var=!$var; if ($conf->global->ADHERENT_USE_SPIP) { - $lien=img_tick().' '; + $lien=img_picto($langs->trans("Active"),'tick').' '; $lien.=''.$langs->trans("Disable").''; // Edition des varibales globales $constantes=array('ADHERENT_USE_SPIP_AUTO', @@ -331,7 +331,7 @@ $db->close(); print '
'; -llxFooter('$Date: 2011/08/03 00:45:42 $ - $Revision: 1.18 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.19 $'); diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index f75c23aac70..bf62a091f03 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -22,7 +22,7 @@ * \file htdocs/admin/company.php * \ingroup company * \brief Setup page to configure company/foundation - * \version $Id: company.php,v 1.94 2011/07/31 22:23:24 eldy Exp $ + * \version $Id: company.php,v 1.95 2011/08/17 15:56:23 eldy Exp $ */ require("../main.inc.php"); @@ -715,7 +715,7 @@ else // On propose la generation de la vignette si elle n'existe pas if (!is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini) && preg_match('/(\.jpg|\.jpeg|\.png)$/i',$mysoc->logo)) { - print 'logo).'">'.img_refresh($langs->trans('GenerateThumb')).'  '; + print 'logo).'">'.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; } else if ($mysoc->logo_mini && is_file($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_mini)) { @@ -982,6 +982,6 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 22:23:24 $ - $Revision: 1.94 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.95 $'); ?> \ No newline at end of file diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 24fae602675..c14b69d1147 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -15,14 +15,14 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * $Id: fckeditor.php,v 1.33 2011/08/17 13:15:10 eldy Exp $ + * $Id: fckeditor.php,v 1.34 2011/08/17 15:56:23 eldy Exp $ */ /** * \file htdocs/admin/fckeditor.php * \ingroup fckeditor * \brief Page d'activation du module FCKeditor dans les autres modules - * \version $Revision: 1.33 $ + * \version $Revision: 1.34 $ */ require("../main.inc.php"); @@ -132,7 +132,7 @@ foreach($modules as $const => $desc) $constante = 'FCKEDITOR_ENABLE_'.$const; $value = $conf->global->$constante; - print $value == 1 ? img_tick() : ' '; + print $value == 1 ? img_picto($langs->trans("Active"),'tick') : ' '; print ''; print ''; @@ -172,5 +172,5 @@ print $conf->global->FCKEDITOR_TEST; $db->close(); -llxFooter('$Date: 2011/08/17 13:15:10 $ - $Revision: 1.33 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.34 $'); ?> \ No newline at end of file diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 6af9b54e7f0..5475d1ac81d 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -21,7 +21,7 @@ * \file htdocs/admin/perms.php * \ingroup core * \brief Page d'administration/configuration des permissions par defaut - * \version $Id: perms.php,v 1.43 2011/08/01 12:53:37 hregis Exp $ + * \version $Id: perms.php,v 1.44 2011/08/17 15:56:23 eldy Exp $ */ require("../main.inc.php"); @@ -81,9 +81,9 @@ $modulesdir = array(); foreach ($conf->file->dol_document_root as $type => $dirroot) { $modulesdir[] = $dirroot . "/includes/modules/"; - + if ($type == 'alt') - { + { $handle=@opendir($dirroot); if (is_resource($handle)) { @@ -194,8 +194,7 @@ if ($result) print ''; if ($obj->bydefault == 1) { - - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; print ''.img_edit_remove().''; } @@ -218,5 +217,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/08/01 12:53:37 $ - $Revision: 1.43 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.44 $'); ?> diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 2cf7976a76b..a65d50bd551 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -20,7 +20,7 @@ * \file htdocs/admin/security.php * \ingroup setup * \brief Page de configuration du module securite - * \version $Id: security.php,v 1.56 2011/07/31 22:23:24 eldy Exp $ + * \version $Id: security.php,v 1.57 2011/08/17 15:56:23 eldy Exp $ */ require("../main.inc.php"); @@ -268,8 +268,7 @@ foreach ($arrayhandler as $key => $module) print ''; if ($conf->global->USER_PASSWORD_GENERATED == $key) { - $title=''; - print img_tick($title); + print img_picto('','tick'); } else { @@ -302,7 +301,7 @@ print ''.$langs->trans("DoNotStoreClearPassword").''; print ''; if ($conf->global->DATABASE_PWD_ENCRYPTED) { - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); } print ''; if (! $conf->global->DATABASE_PWD_ENCRYPTED) @@ -336,7 +335,7 @@ print ''.$langs->trans("MainDbPasswordFileConfEncrypted").' print ''; if (preg_match('/crypted:/i',$dolibarr_main_db_pass) || ! empty($dolibarr_main_db_encrypted_pass)) { - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); } print ''; @@ -374,7 +373,7 @@ print ''; print ''; if($conf->global->PDF_SECURITY_ENCRYPTION == 1) { - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); } print ''; @@ -402,7 +401,7 @@ print ''.$langs->trans("DisableForgetPasswordLinkOnLogonPage").' print ''; if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) { - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); } print ''; if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0) @@ -431,5 +430,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 22:23:24 $ - $Revision: 1.56 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.57 $'); ?> diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index c1d629f7b7b..1ccc5ebd63b 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -20,7 +20,7 @@ * \file htdocs/admin/security_other.php * \ingroup core * \brief Security options setup - * \version $Id: security_other.php,v 1.41 2011/07/31 22:23:22 eldy Exp $ + * \version $Id: security_other.php,v 1.42 2011/08/17 15:56:23 eldy Exp $ */ require("../main.inc.php"); @@ -202,11 +202,11 @@ if (function_exists("imagecreatefrompng")) { if ($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 0) { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } if($conf->global->MAIN_SECURITY_ENABLECAPTCHA == 1) { - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } } else @@ -227,11 +227,11 @@ print ''.$langs->trans("UseAdvancedPerms").''; print ''; if ($conf->global->MAIN_USE_ADVANCED_PERMS == 0) { - print ''.img_picto($langs->trans("Disabled"),'off').''; + print ''.img_picto($langs->trans("Disabled"),'switch_off').''; } if($conf->global->MAIN_USE_ADVANCED_PERMS == 1) { - print ''.img_picto($langs->trans("Enabled"),'on').''; + print ''.img_picto($langs->trans("Enabled"),'switch_on').''; } print ""; @@ -347,5 +347,5 @@ $formfile->form_attach_new_file(DOL_URL_ROOT.'/admin/security_other.php',$langs- $db->close(); -llxFooter('$Date: 2011/07/31 22:23:22 $ - $Revision: 1.41 $'); +llxFooter('$Date: 2011/08/17 15:56:23 $ - $Revision: 1.42 $'); ?> diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php index ab8f9657555..6e177d531b1 100644 --- a/htdocs/categories/photos.php +++ b/htdocs/categories/photos.php @@ -22,7 +22,7 @@ * \file htdocs/categories/photos.php * \ingroup category * \brief Gestion des photos d'une categorie - * \version $Id: photos.php,v 1.13 2011/08/03 00:46:32 eldy Exp $ + * \version $Id: photos.php,v 1.14 2011/08/17 15:56:26 eldy Exp $ */ require("../main.inc.php"); @@ -266,7 +266,7 @@ if (!empty($id) || !empty($ref)) // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites if (!$obj['photo_vignette'] && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$obj['photo']) && ($object->imgWidth > $maxWidth || $object->imgHeight > $maxHeight)) { - print ''.img_refresh($langs->trans('GenerateThumb')).'  '; + print ''.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; } if ($user->rights->categorie->creer) { @@ -304,5 +304,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/03 00:46:32 $ - $Revision: 1.13 $'); +llxFooter('$Date: 2011/08/17 15:56:26 $ - $Revision: 1.14 $'); ?> diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php index f950c60928a..221f7359d5d 100644 --- a/htdocs/comm/action/rapport/index.php +++ b/htdocs/comm/action/rapport/index.php @@ -22,7 +22,7 @@ * \file htdocs/comm/action/rapport/index.php * \ingroup commercial * \brief Page with reports of actions - * \version $Id: index.php,v 1.48 2011/08/03 00:46:36 eldy Exp $ + * \version $Id: index.php,v 1.49 2011/08/17 15:56:26 eldy Exp $ */ require("../../../main.inc.php"); @@ -116,7 +116,7 @@ if ($resql) print ''.$obj->cc.''; print ''; - print ''.img_file_new().''; + print 'month.'&year='.$obj->year.'">'.img_picto('','filenew').''; print ''; $name = "actions-".$obj->month."-".$obj->year.".pdf"; @@ -150,5 +150,5 @@ else $db->close(); -llxFooter('$Date: 2011/08/03 00:46:36 $ - $Revision: 1.48 $'); +llxFooter('$Date: 2011/08/17 15:56:26 $ - $Revision: 1.49 $'); ?> diff --git a/htdocs/compta/prelevement/facturesrejets.php b/htdocs/compta/prelevement/facturesrejets.php index b5ebff0fc3d..86788bef101 100644 --- a/htdocs/compta/prelevement/facturesrejets.php +++ b/htdocs/compta/prelevement/facturesrejets.php @@ -15,7 +15,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * $Id: facturesrejets.php,v 1.13 2011/07/31 22:23:29 eldy Exp $ + * $Id: facturesrejets.php,v 1.14 2011/08/17 15:56:27 eldy Exp $ * */ @@ -124,7 +124,7 @@ if ($result) print ""; print ''; - print img_file(); + print img_picto('','file'); print ' '; print ''.$obj->facnumber."\n"; @@ -155,5 +155,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 22:23:29 $ - $Revision: 1.13 $'); +llxFooter('$Date: 2011/08/17 15:56:27 $ - $Revision: 1.14 $'); ?> diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 31fc25edfba..1cf6973102e 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -30,7 +30,7 @@ * \file htdocs/core/class/html.form.class.php * \ingroup core * \brief File of class with all html predefined components - * \version $Id: html.form.class.php,v 1.195 2011/08/12 21:29:29 eldy Exp $ + * \version $Id: html.form.class.php,v 1.196 2011/08/17 15:56:23 eldy Exp $ */ @@ -223,7 +223,7 @@ class Form // Info or help if ($type == 'info') $img=img_help(0,$alt); if ($type == 'help' || $type ==1) $img=img_help(1,$alt); - if ($type == 'superadmin') $img=img_redstar($alt); + if ($type == 'superadmin') $img=img_picto($alt,"redstar"); if ($type == 'admin') $img=img_picto($alt,"star"); // Warnings if ($type == 'warning') $img=img_warning($alt); @@ -3130,7 +3130,6 @@ class Form { $retstring.=' '; } } diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index 2ca2f82789e..ad1ebfc4bdd 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -21,7 +21,7 @@ * \file htdocs/core/class/interfaces.class.php * \ingroup core * \brief Fichier de la classe de gestion des triggers - * \version $Id: interfaces.class.php,v 1.9 2011/07/31 23:45:13 eldy Exp $ + * \version $Id: interfaces.class.php,v 1.10 2011/08/17 15:56:22 eldy Exp $ */ @@ -71,7 +71,7 @@ class Interfaces { $dir=dol_buildpath($reldir,0); //print "xx".$dir;exit; - + // Check if directory exists if (!is_dir($dir)) continue; @@ -194,7 +194,7 @@ class Interfaces { $dir=dol_buildpath($reldir,0); //print "xx".$dir;exit; - + // Check if directory exists if (!is_dir($dir)) continue; @@ -267,7 +267,7 @@ class Interfaces $triggers[$j]['picto'] = $objMod->picto?img_object('',$objMod->picto):img_object('','generic'); $triggers[$j]['file'] = $files[$key]; $triggers[$j]['version'] = $objMod->getVersion(); - $triggers[$j]['status'] = img_tick(); + $triggers[$j]['status'] = img_picto($langs->trans("Active"),'tick'); if ($disabledbyname > 0 || $disabledbymodule > 1) $triggers[$j]['status'] = " "; $text =''.$langs->trans("Description").':
'; diff --git a/htdocs/ftp/index.php b/htdocs/ftp/index.php index 5d90a5f750b..3bddadcca7d 100644 --- a/htdocs/ftp/index.php +++ b/htdocs/ftp/index.php @@ -20,7 +20,7 @@ * \file htdocs/ftp/index.php * \ingroup ftp * \brief Main page for FTP section area - * \version $Id: index.php,v 1.24 2011/08/01 00:01:02 eldy Exp $ + * \version $Id: index.php,v 1.25 2011/08/17 15:56:27 eldy Exp $ * \author Laurent Destailleur */ @@ -572,7 +572,7 @@ else } else { - print ''.img_file().''; + print ''.img_picto('','file').''; print '   '; print ''; print '   '; @@ -624,7 +624,7 @@ if ($conn_id) ftp_close($conn_id); // End of page $db->close(); -llxFooter('$Date: 2011/08/01 00:01:02 $ - $Revision: 1.24 $'); +llxFooter('$Date: 2011/08/17 15:56:27 $ - $Revision: 1.25 $'); /** diff --git a/htdocs/imports/import.php b/htdocs/imports/import.php index 97d4d8252d3..084be689c88 100644 --- a/htdocs/imports/import.php +++ b/htdocs/imports/import.php @@ -20,7 +20,7 @@ * \file htdocs/imports/import.php * \ingroup import * \brief Pages of import Wizard - * \version $Id: import.php,v 1.69 2011/07/31 23:46:39 eldy Exp $ + * \version $Id: import.php,v 1.70 2011/08/17 15:56:26 eldy Exp $ */ require_once("../main.inc.php"); @@ -1326,7 +1326,7 @@ if ($step == 5 && $datatoimport) $db->rollback(); // We force rollback because this was just a simulation. // Show OK - if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_tick().' '.$langs->trans("NoError").'

'; + if (! sizeof($arrayoferrors) && ! sizeof($arrayofwarnings)) print img_picto($langs->trans("OK"),'tick').' '.$langs->trans("NoError").'

'; else print $langs->trans("NbOfLinesOK",$nbok).'

'; // Show Errors @@ -1668,7 +1668,7 @@ print '
'; $db->close(); -llxFooter('$Date: 2011/07/31 23:46:39 $ - $Revision: 1.69 $'); +llxFooter('$Date: 2011/08/17 15:56:26 $ - $Revision: 1.70 $'); /* @@ -1707,7 +1707,6 @@ function show_elem($fieldssource,$i,$pos,$key,$var,$nostyle='') else // Print field of source file { print ''; - //print ''.img_file('','').''; print ''; // The image must have the class 'boxhandle' beause it's value used in DOM draggable objects to define the area used to catch the full object print img_picto($langs->trans("MoveField",$pos),'uparrow','class="boxhandle" style="cursor:move;"'); diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index aec698f8a4c..5317ff0f034 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -28,7 +28,7 @@ * \file htdocs/lib/functions.lib.php * \brief A set of functions for Dolibarr * This file contains all frequently used functions. - * \version $Id: functions.lib.php,v 1.554 2011/08/15 18:37:07 eldy Exp $ + * \version $Id: functions.lib.php,v 1.555 2011/08/17 15:56:24 eldy Exp $ */ // For compatibility during upgrade @@ -1501,6 +1501,7 @@ function dol_print_graph($htmlid,$width,$height,$data,$showlegend=0,$type='pie', * Truncate a string to a particular length adding '...' if string larger than length. * If length = max length+1, we do no truncate to avoid having just 1 char replaced with '...'. * MAIN_DISABLE_TRUNC=1 can disable all truncings + * * @param string String to truncate * @param size Max string size. 0 for no limit. * @param trunc Where to trunc: right, left, middle, wrap @@ -1561,6 +1562,7 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8') /** * Show a picto called object_picto (generic function) + * * @param alt Text of alt on image * @param 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. @@ -1571,35 +1573,39 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8') */ function img_object($alt, $picto, $options='', $pictoisfullpath=0) { - global $conf,$langs; + global $conf; - $path = 'theme/'.$conf->theme; - $url = DOL_URL_ROOT; + // Clean parameters + if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; - if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs)) - { - $picto = $regs[1]; - $path = $regs[2]; - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; - // If img file not into standard path, we use alternate path - if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/object_'.$picto)) $url = DOL_URL_ROOT_ALT; - } + // Define fullpathpicto to use into src + if (! empty($pictoisfullpath)) $fullpathpicto=$picto; else { - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; + // By default, we search into theme directory + $url = DOL_URL_ROOT; + $path = 'theme/'.$conf->theme; + if (! empty($conf->global->MAIN_FORCETHEMEDIR)) $path=preg_replace('/^\//','',$conf->global->MAIN_FORCETHEMEDIR).'/'.$path; + // If we ask an image into module/img (not into a theme path) + if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs)) { $picto = $regs[1]; $path=$regs[2]; } // If image into a module/img path + // If img file not into standard path, we use alternate path + if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/object_'.$picto)) $url = DOL_URL_ROOT_ALT; + + $fullpathpicto=$url.'/'.$path.'/img/object_'.$picto; } - if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; - return ''.dol_escape_htmltag($alt).''; + + return ''.dol_escape_htmltag($alt).''; } /** * Show picto whatever it's its name (generic function) + * * @param alt Text on alt and title of image * @param picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into img directory. * Example: picto.png if picto.png is stored into htdocs/theme/mytheme/img * Example: picto.png@mymodule if picto.png is stored into htdocs/mymodule/img * Example: /mydir/mysubdir/picto.png if picto.png is stored into htdocs/mydir/mysubdir (pictoisfullpath must be set to 1) - * @param options Add more attribute on img tag + * @param options Add more attribute on img tag (For example 'style="float: right"') * @param pictoisfullpath If 1, image path is a full path * @return string Return img tag * @see img_object, img_picto_common @@ -1608,28 +1614,31 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0) { global $conf; - $path = 'theme/'.$conf->theme; - $url = DOL_URL_ROOT; + // Clean parameters + if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; - if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs)) - { - $picto = $regs[1]; - $path = $regs[2]; - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; - // If img file not into standard path, we use alternate path - if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/'.$picto)) $url = DOL_URL_ROOT_ALT; - } + // Define fullpathpicto to use into src + if (! empty($pictoisfullpath)) $fullpathpicto=$picto; else { - if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto.='.png'; + // By default, we search into theme directory + $url = DOL_URL_ROOT; + $path = 'theme/'.$conf->theme; + if (! empty($conf->global->MAIN_FORCETHEMEDIR)) $path=preg_replace('/^\//','',$conf->global->MAIN_FORCETHEMEDIR).'/'.$path; + // If we ask an image into module/img (not into a theme path) + if (preg_match('/^([^@]+)@([^@]+)$/i',$picto,$regs)) { $picto = $regs[1]; $path=$regs[2]; } // If image into a module/img path + // If img file not into standard path, we use alternate path + if (defined('DOL_URL_ROOT_ALT') && DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/'.$picto)) $url = DOL_URL_ROOT_ALT; + + $fullpathpicto=$url.'/'.$path.'/img/'.$picto; } - if ($pictoisfullpath) return ''.dol_escape_htmltag($alt).''; - return ''.dol_escape_htmltag($alt).''; + return ''.dol_escape_htmltag($alt).''; } /** * Show picto (generic function) + * * @param alt Text on alt and title of image * @param picto Name of image file to show (If no extension provided, we use '.png'). Image must be stored into htdocs/theme/common directory. * @param options Add more attribute on img tag @@ -1648,6 +1657,7 @@ function img_picto_common($alt, $picto, $options='', $pictoisfullpath=0) /** * Show logo action + * * @param alt Text for image alt and title * @param numaction Action to show * @return string Return an img tag @@ -1665,57 +1675,9 @@ function img_action($alt = "default", $numaction) return ''.dol_escape_htmltag($alt).''; } - /** - * Affiche logo fichier - * @param alt Texte sur le alt de l'image - * @return string Retourne tag img - */ -function img_file($alt = "default") -{ - global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Show"); - return ''.dol_escape_htmltag($alt).''; -} - -/** - * Affiche logo refresh - * @param alt Texte sur le alt de l'image - * @return string Retourne tag img - */ -function img_refresh($alt = "default") -{ - global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Refresh"); - return ''.dol_escape_htmltag($alt).''; -} - -/** - * Affiche logo dossier - * @param alt Texte sur le alt de l'image - * @return string Retourne tag img - */ -function img_folder($alt = "default") -{ - global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Dossier"); - return ''.dol_escape_htmltag($alt).''; -} - -/** - * Affiche logo nouveau fichier - * @param alt Texte sur le alt de l'image - * @return string Retourne tag img - */ -function img_file_new($alt = "default") -{ - global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Show"); - return ''.dol_escape_htmltag($alt).''; -} - -/** - * Affiche logo pdf + * Show pdf logo + * * @param alt Texte sur le alt de l'image * @param $size Taille de l'icone : 3 = 16x16px , 2 = 14x14px * @return string Retourne tag img @@ -1728,7 +1690,8 @@ function img_pdf($alt = "default",$size=3) } /** - * Affiche logo + + * Show logo + + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1736,10 +1699,11 @@ function img_edit_add($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Add"); - return ''.dol_escape_htmltag($alt).''; + return img_picto($alt,'edit_add.png'); } /** - * Affiche logo - + * Show logo - + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1747,11 +1711,12 @@ function img_edit_remove($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Remove"); - return ''.dol_escape_htmltag($alt).''; + return img_picto($alt,'edit_remove.png'); } /** - * Affiche logo editer/modifier fiche + * Show logo editer/modifier fiche + * * @param alt Texte sur le alt de l'image * @param float Si il faut y mettre le style "float: right" * @param other Add more attributes on img @@ -1769,7 +1734,8 @@ function img_edit($alt = "default", $float=0, $other='') } /** - * Affiche logo voir fiche + * Show logo view card + * * @param alt Texte sur le alt de l'image * @param float Si il faut y mettre le style "float: right" * @param other Add more attributes on img @@ -1788,6 +1754,7 @@ function img_view($alt = "default", $float=0, $other='') /** * Show delete logo + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1795,12 +1762,13 @@ function img_delete($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Delete"); - return ''.dol_escape_htmltag($alt).''; + return img_picto($alt,'delete.png'); } /** * Show help logo with cursor "?" + * * @param usehelpcursor * @param usealttitle Texte to use as alt title * @return string Retourne tag img @@ -1823,6 +1791,7 @@ function img_help($usehelpcursor=1,$usealttitle=1) /** * Affiche logo info + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1830,11 +1799,12 @@ function img_info($alt = "default") { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Informations"); - return ''.dol_escape_htmltag($alt).''; + return img_picto($alt,'info.png'); } /** * Affiche logo warning + * * @param alt Texte sur le alt de l'image * @param float Si il faut afficher le style "float: right" * @return string Retourne tag img @@ -1843,32 +1813,12 @@ function img_warning($alt = "default",$float=0) { global $conf,$langs; if ($alt=="default") $alt=$langs->trans("Warning"); - $img=''.dol_escape_htmltag($alt).'trans("SuperAdministrator"); - $img=''.dol_escape_htmltag($alt).'trans("Error"); - return ''.dol_escape_htmltag($alt).''; + return img_picto($alt,'error.png'); } /** * Affiche logo telephone + * * @param alt Texte sur le alt de l'image * @param option Choose of logo * @return string Retourne tag img @@ -1898,6 +1849,7 @@ function img_phone($alt = "default",$option=0) /** * Affiche logo suivant + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1912,6 +1864,7 @@ function img_next($alt = "default") /** * Affiche logo precedent + * * @param alt Texte sur le alt de l'image * @return string Retourne tag img */ @@ -1924,6 +1877,7 @@ function img_previous($alt = "default") /** * Show logo down arrow + * * @param alt Texte sur le alt de l'image * @param selected Affiche version "selected" du logo * @return string Retourne tag img @@ -1938,6 +1892,7 @@ function img_down($alt = "default", $selected=0) /** * Show logo top arrow + * * @param alt Texte sur le alt de l'image * @param selected Affiche version "selected" du logo * @return string Retourne tag img @@ -1952,6 +1907,7 @@ function img_up($alt = "default", $selected=0) /** * Affiche logo gauche + * * @param alt Texte sur le alt de l'image * @param selected Affiche version "selected" du logo * @return string Retourne tag img @@ -1966,6 +1922,7 @@ function img_left($alt = "default", $selected=0) /** * Affiche logo droite + * * @param alt Texte sur le alt de l'image * @param selected Affiche version "selected" du logo * @return string Retourne tag img @@ -1978,20 +1935,9 @@ function img_right($alt = "default", $selected=0) else return ''.dol_escape_htmltag($alt).''; } -/** - * Affiche logo tick - * @param alt Texte sur le alt de l'image - * @return string Retourne tag img - */ -function img_tick($alt = "default") -{ - global $conf,$langs; - if ($alt=="default") $alt=$langs->trans("Active"); - return ''.dol_escape_htmltag($alt).''; -} - /** * Affiche le logo tick si allow + * * @param allow Authorise ou non * @param alt Alt text for img * @return string Retourne tag img diff --git a/htdocs/lib/security.lib.php b/htdocs/lib/security.lib.php index e7d16500620..408a969b2f5 100644 --- a/htdocs/lib/security.lib.php +++ b/htdocs/lib/security.lib.php @@ -20,7 +20,7 @@ /** * \file htdocs/lib/security.lib.php * \brief Set of function used for dolibarr security - * \version $Id: security.lib.php,v 1.127 2011/08/17 13:59:24 cdelambert Exp $ + * \version $Id: security.lib.php,v 1.128 2011/08/17 15:56:24 eldy Exp $ */ @@ -231,7 +231,7 @@ function dol_loginfunction($langs,$conf,$mysoc) if (function_exists("imagecreatefrompng") && ! empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) { $captcha=1; - $captcha_refresh=img_refresh(); + $captcha_refresh=img_picto($langs->trans("Refresh"),'refresh'); } // Extra link diff --git a/htdocs/product/admin/produit.php b/htdocs/product/admin/produit.php index 8bf475f0b35..bcf08bb5c9f 100644 --- a/htdocs/product/admin/produit.php +++ b/htdocs/product/admin/produit.php @@ -23,7 +23,7 @@ * \file htdocs/product/admin/produit.php * \ingroup produit * \brief Page d'administration/configuration du module Produit - * \version $Id: produit.php,v 1.7 2011/07/31 23:24:02 eldy Exp $ + * \version $Id: produit.php,v 1.8 2011/08/17 15:56:26 eldy Exp $ */ require("../../main.inc.php"); @@ -267,7 +267,7 @@ if ($conf->global->PRODUCT_CANVAS_ABILITY) if ($conf->global->$const) { - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; print ''.$langs->trans("Disable").''; } @@ -294,5 +294,5 @@ if ($conf->global->PRODUCT_CANVAS_ABILITY) $db->close(); -llxFooter('$Date: 2011/07/31 23:24:02 $ - $Revision: 1.7 $'); +llxFooter('$Date: 2011/08/17 15:56:26 $ - $Revision: 1.8 $'); ?> diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index de7eb9ed069..df033c92146 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -24,7 +24,7 @@ * \file htdocs/product/class/product.class.php * \ingroup produit * \brief Fichier de la classe des produits predefinis - * \version $Id: product.class.php,v 1.49 2011/08/04 21:46:51 eldy Exp $ + * \version $Id: product.class.php,v 1.50 2011/08/17 15:56:26 eldy Exp $ */ require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php"); @@ -2580,7 +2580,7 @@ class Product extends CommonObject // On propose la generation de la vignette si elle n'existe pas et si la taille est superieure aux limites if ($photo_vignette && preg_match('/(\.bmp|\.gif|\.jpg|\.jpeg|\.png)$/i',$photo) && ($product->imgWidth > $maxWidth || $product->imgHeight > $maxHeight)) { - $return.= ''.img_refresh($langs->trans('GenerateThumb')).'  '; + $return.= ''.img_picto($langs->trans('GenerateThumb'),'refresh').'  '; } if ($user->rights->produit->creer || $user->rights->service->creer) { diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 052021abd95..60cec3b409d 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -20,7 +20,7 @@ /** * \file htdocs/user/group/fiche.php * \brief Onglet groupes utilisateurs - * \version $Id: fiche.php,v 1.69 2011/07/31 23:21:25 eldy Exp $ + * \version $Id: fiche.php,v 1.70 2011/08/17 15:56:24 eldy Exp $ */ require("../../main.inc.php"); @@ -293,7 +293,7 @@ else print ''.$object->nom; if (empty($object->entity)) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "\n"; @@ -386,7 +386,7 @@ else print ""; print ''; print ''.img_object($langs->trans("ShowUser"),"user").' '.$useringroup->login.''; - if ($useringroup->admin && ! $useringroup->entity) print img_redstar($langs->trans("SuperAdministrator")); + if ($useringroup->admin && ! $useringroup->entity) print img_picto($langs->trans("SuperAdministrator"),'redstar'); else if ($useringroup->admin) print img_picto($langs->trans("Administrator"),'star'); print ''; print ''.ucfirst(stripslashes($useringroup->lastname)).''; @@ -473,5 +473,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.69 $'); +llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.70 $'); ?> diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php index e25ab02e785..2c6ccbd1606 100644 --- a/htdocs/user/group/index.php +++ b/htdocs/user/group/index.php @@ -21,7 +21,7 @@ * \file htdocs/user/group/index.php * \ingroup core * \brief Page of user groups - * \version $Id: index.php,v 1.24 2011/07/31 23:21:25 eldy Exp $ + * \version $Id: index.php,v 1.25 2011/08/17 15:56:24 eldy Exp $ */ require("../../main.inc.php"); @@ -90,7 +90,7 @@ if ($resql) print ''.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.''; if (!$obj->entity) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print ""; print ''.$obj->nb.''; @@ -108,6 +108,6 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.24 $'); +llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.25 $'); ?> diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php index eb342318fa6..7c7373035c9 100644 --- a/htdocs/user/group/ldap.php +++ b/htdocs/user/group/ldap.php @@ -20,7 +20,7 @@ * \file htdocs/user/group/ldap.php * \ingroup ldap * \brief Page fiche LDAP groupe - * \version $Id: ldap.php,v 1.26 2011/07/31 23:21:25 eldy Exp $ + * \version $Id: ldap.php,v 1.27 2011/08/17 15:56:24 eldy Exp $ */ require("../../main.inc.php"); @@ -115,7 +115,7 @@ print ''.$langs->trans("Name").''; print ''.$fgroup->nom; if (!$fgroup->entity) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "\n"; @@ -215,5 +215,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 23:21:25 $ - $Revision: 1.26 $'); +llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.27 $'); ?> diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index 9edcafd59c0..70908d4f817 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -22,7 +22,7 @@ /** * \file htdocs/user/group/perms.php * \brief Onglet user et permissions de la fiche utilisateur - * \version $Id: perms.php,v 1.40 2011/08/01 13:15:53 hregis Exp $ + * \version $Id: perms.php,v 1.41 2011/08/17 15:56:24 eldy Exp $ */ require("../../main.inc.php"); @@ -94,13 +94,13 @@ if ($_GET["id"]) // Charge les modules soumis a permissions $modules = array(); $modulesdir = array(); - + foreach ($conf->file->dol_document_root as $type => $dirroot) { $modulesdir[] = $dirroot . "/includes/modules/"; - + if ($type == 'alt') - { + { $handle=@opendir($dirroot); if (is_resource($handle)) { @@ -118,7 +118,7 @@ if ($_GET["id"]) } } } - + foreach ($modulesdir as $dir) { // Load modules attributes in arrays (name, numero, orders) from dir directory @@ -208,7 +208,7 @@ if ($_GET["id"]) print ''.$fgroup->nom.''; if (! $fgroup->entity) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "\n"; @@ -290,7 +290,7 @@ if ($_GET["id"]) print ''.img_edit_remove($langs->trans("Remove")).''; } print ''; - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; } else @@ -316,5 +316,5 @@ if ($_GET["id"]) $db->close(); -llxFooter('$Date: 2011/08/01 13:15:53 $ - $Revision: 1.40 $'); +llxFooter('$Date: 2011/08/17 15:56:24 $ - $Revision: 1.41 $'); ?> diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 8d3371ea4fa..5a3c1a1bea5 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -19,7 +19,7 @@ /** * \file htdocs/user/home.php * \brief Home page of users and groups management - * \version $Id: home.php,v 1.48 2011/07/31 23:19:42 eldy Exp $ + * \version $Id: home.php,v 1.49 2011/08/17 15:56:25 eldy Exp $ */ require("../main.inc.php"); @@ -123,7 +123,7 @@ if ($resql) print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->firstname.' '.$obj->name.''; if ($conf->global->MAIN_MODULE_MULTICOMPANY && $obj->admin && ! $obj->entity) { - print img_redstar($langs->trans("SuperAdministrator")); + print img_picto($langs->trans("SuperAdministrator"),'redstar'); } else if ($obj->admin) { @@ -219,5 +219,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/07/31 23:19:42 $ - $Revision: 1.48 $'); +llxFooter('$Date: 2011/08/17 15:56:25 $ - $Revision: 1.49 $'); ?> diff --git a/htdocs/user/index.php b/htdocs/user/index.php index d0d692dd775..f13127df380 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -21,7 +21,7 @@ * \file htdocs/user/index.php * \ingroup core * \brief Page of users - * \version $Id: index.php,v 1.51 2011/07/31 23:19:42 eldy Exp $ + * \version $Id: index.php,v 1.52 2011/08/17 15:56:25 eldy Exp $ */ require("../main.inc.php"); @@ -103,7 +103,7 @@ if ($result) print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.''; if ($conf->global->MAIN_MODULE_MULTICOMPANY && $obj->admin && ! $obj->entity) { - print img_redstar($langs->trans("SuperAdministrator")); + print img_picto($langs->trans("SuperAdministrator"),'redstar'); } else if ($obj->admin) { @@ -149,5 +149,5 @@ else $db->close(); -llxFooter('$Date: 2011/07/31 23:19:42 $ - $Revision: 1.51 $'); +llxFooter('$Date: 2011/08/17 15:56:25 $ - $Revision: 1.52 $'); ?> diff --git a/htdocs/user/passwordforgotten.php b/htdocs/user/passwordforgotten.php index 98124e66972..0fdf01b9607 100644 --- a/htdocs/user/passwordforgotten.php +++ b/htdocs/user/passwordforgotten.php @@ -19,7 +19,7 @@ /** * \file htdocs/user/passwordforgotten.php * \brief Page to ask a new password - * \version $Id: passwordforgotten.php,v 1.76 2011/07/31 23:19:43 eldy Exp $ + * \version $Id: passwordforgotten.php,v 1.77 2011/08/17 15:56:25 eldy Exp $ */ define("NOLOGIN",1); // This means this output page does not require to be logged. @@ -243,7 +243,7 @@ if (! empty($conf->global->MAIN_MODULE_MULTICOMPANY) && empty($conf->global->MU if (function_exists("imagecreatefrompng") && ! $disabled) { $captcha = 1; - $captcha_refresh = img_refresh(); + $captcha_refresh = img_picto($langs->trans("Refresh"),'refresh'); } include($template_dir.'passwordforgotten.tpl.php'); // To use native PHP diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index 47710b31d9d..f11d1378586 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -22,7 +22,7 @@ /** * \file htdocs/user/perms.php * \brief Onglet user et permissions de la fiche utilisateur - * \version $Id: perms.php,v 1.57 2011/08/01 13:15:54 hregis Exp $ + * \version $Id: perms.php,v 1.58 2011/08/17 15:56:25 eldy Exp $ */ require("../main.inc.php"); @@ -125,9 +125,9 @@ $modulesdir = array(); foreach ($conf->file->dol_document_root as $type => $dirroot) { $modulesdir[] = $dirroot . "/includes/modules/"; - + if ($type == 'alt') - { + { $handle=@opendir($dirroot); if (is_resource($handle)) { @@ -346,7 +346,7 @@ if ($result) print ''.img_picto($langs->trans("Administrator"),'star').''; } print ''; - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; } else if (in_array($obj->id, $permsuser)) @@ -357,7 +357,7 @@ if ($result) print ''.img_edit_remove($langs->trans("Remove")).''; } print ''; - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; } else if (in_array($obj->id, $permsgroup)) { @@ -370,7 +370,7 @@ if ($result) print ''; } print ''; - print img_tick(); + print img_picto($langs->trans("Active"),'tick'); print ''; } else @@ -395,5 +395,5 @@ print ''; $db->close(); -llxFooter('$Date: 2011/08/01 13:15:54 $ - $Revision: 1.57 $'); +llxFooter('$Date: 2011/08/17 15:56:25 $ - $Revision: 1.58 $'); ?>