From 15cad39815650b49f628c99f757e3ef7f880be73 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 14 Jan 2011 21:30:19 +0000 Subject: [PATCH] Fix: Use of options on img was not correct --- htdocs/admin/modules.php | 12 ++++++------ htdocs/lib/functions.lib.php | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index d2aa7857691..78a7265a823 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -247,7 +247,7 @@ if ($mode != 4) 'technic'=>$langs->trans("ModuleFamilyTechnic"), 'other'=>$langs->trans("ModuleFamilyOther") ); - + foreach ($orders as $key => $value) { $tab=explode('_',$value); @@ -256,14 +256,14 @@ if ($mode != 4) $modName = $filename[$key]; $objMod = $modules[$key]; //var_dump($objMod); - + if ($objMod->special != $mode) continue; // Discard if not for tab if (! $objMod->getName()) { dol_syslog("Error for module ".$key." - Property name of module looks empty", LOG_WARNING); - continue; + continue; } - + $const_name = 'MAIN_MODULE_'.strtoupper(preg_replace('/^mod/i','',get_class($objMod))); // Load all lang files of module @@ -314,8 +314,8 @@ if ($mode != 4) //if (is_array($objMod->phpmin)) $alttext.=($alttext?' - ':'').'PHP >= '.join('.',$objMod->phpmin); if (! empty($objMod->picto)) { - if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,'',1); - else print img_object($alttext,$objMod->picto); + if (preg_match('/^\//i',$objMod->picto)) print img_picto($alttext,$objMod->picto,' width="14px"',1); + else print img_object($alttext,$objMod->picto,' width="14px"'); } else { diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 68dbb2036f8..54c7b31e3f3 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -1193,14 +1193,13 @@ function dol_trunc($string,$size=40,$trunc='right',$stringencoding='UTF-8') * @param alt Text of alt on image * @param object Objet pour lequel il faut afficher le logo (example: user, group, action, bill, contract, propal, product, ...) * Pour les modules externe utiliser nomimage@mymodule pour rechercher dans le repertoire "img" du module - * @param cssclass Define a specific css class + * @param options Add more attribute on img tag * @return string Return img tag */ -function img_object($alt, $object, $cssclass='') +function img_object($alt, $object, $options='') { global $conf,$langs; - $cssclass = (!empty($cssclass)?' class="'.$cssclass.'"':''); $path = 'theme/'.$conf->theme; $url = DOL_URL_ROOT; @@ -1212,7 +1211,7 @@ function img_object($alt, $object, $cssclass='') if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/object_'.$object.'.png')) $url = DOL_URL_ROOT_ALT; } - return ''.dol_escape_htmltag($alt).''; + return ''.dol_escape_htmltag($alt).''; } /** @@ -1237,6 +1236,7 @@ function img_picto($alt, $picto, $options='', $pictoisfullpath=0) { $picto = $regs[1]; $path = $regs[2]; + // If img file not into standard path, we use alternate path if (DOL_URL_ROOT_ALT && ! file_exists(DOL_DOCUMENT_ROOT.'/'.$path.'/img/'.$picto)) $url = DOL_URL_ROOT_ALT; }