From edaa111461ef6f2bb70a6e70c6d6663d36a06f58 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 27 Sep 2022 12:03:54 +0200 Subject: [PATCH] Replace use of png file for module image with a font awesome image --- htdocs/commande/list.php | 3 +- htdocs/modulebuilder/index.php | 28 ++++++++++-------- htdocs/modulebuilder/template/img/README.md | 14 +++++++++ .../template/img/object_mymodule.png | Bin 219 -> 0 bytes .../template/img/object_mymodule_over.png | Bin 208 -> 0 bytes .../template/img/object_myobject.png | Bin 219 -> 0 bytes 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 htdocs/modulebuilder/template/img/README.md delete mode 100644 htdocs/modulebuilder/template/img/object_mymodule.png delete mode 100644 htdocs/modulebuilder/template/img/object_mymodule_over.png delete mode 100644 htdocs/modulebuilder/template/img/object_myobject.png diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 516f303f8eb..3b75994ef00 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -1320,12 +1320,11 @@ if ($resql) { print ''; print ''; - print '
'; print '
'; print ' '; print ''; print '
'; - print '
'; + print '

'; } if ($sall) { diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index c510bad66c4..b41342abc13 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -202,10 +202,10 @@ foreach ($dirsrootforscan as $dirread) { } $textforlistofdirs .= ''.$dirread.''; if ($dirread == DOL_DOCUMENT_ROOT) { - if ($conf->global->MAIN_FEATURES_LEVEL >= 2) { + if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) { $textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MAIN_FEATURES_LEVEL")); } - if (!empty($conf->global->MODULEBUILDER_ADD_DOCUMENT_ROOT)) { + if (getDolGlobalString('MODULEBUILDER_ADD_DOCUMENT_ROOT')) { $textforlistofdirs .= $form->textwithpicto('', $langs->trans("ConstantIsOn", "MODULEBUILDER_ADD_DOCUMENT_ROOT")); } } @@ -317,7 +317,6 @@ if ($dirins && $action == 'initmodule' && $modulename) { dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject.key.sql'); dol_delete_file($destdir.'/sql/llx_'.strtolower($modulename).'_myobject_extrafields.key.sql'); - dol_delete_file($destdir.'/img/object_myobject.png'); dol_delete_file($destdir.'/class/myobject.class.php'); dol_delete_dir($destdir.'/class', 1); @@ -1187,7 +1186,6 @@ if ($dirins && $action == 'initobject' && $module && $objectname) { 'sql/llx_mymodule_myobject_extrafields.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.sql', 'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql', //'scripts/mymodule.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', //'class/api_mymodule.class.php'=>'class/api_'.strtolower($module).'.class.php', ); @@ -1670,7 +1668,6 @@ if ($dirins && $action == 'confirm_deleteobject' && $objectname) { 'sql/llx_mymodule_myobject.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'.key.sql', 'sql/llx_mymodule_myobject_extrafields.key.sql'=>'sql/llx_'.strtolower($module).'_'.strtolower($objectname).'_extrafields.key.sql', 'scripts/myobject.php'=>'scripts/'.strtolower($objectname).'.php', - 'img/object_myobject.png'=>'img/object_'.strtolower($objectname).'.png', 'class/myobject.class.php'=>'class/'.strtolower($objectname).'.class.php', 'class/api_myobject.class.php'=>'class/api_'.strtolower($module).'.class.php', 'core/modules/mymodule/mod_myobject_advanced.php'=>'core/modules/'.strtolower($module).'/mod_'.strtolower($objectname).'_advanced.php', @@ -1949,7 +1946,7 @@ if ($message) { } //print $langs->trans("ModuleBuilderDesc3", count($listofmodules), $FILEFLAG).'
'; -$infomodulesfound = '
'.$form->textwithpicto(''.$langs->trans("ModuleBuilderDesc3", count($listofmodules)).'', $langs->trans("ModuleBuilderDesc4", $FILEFLAG).'
'.$textforlistofdirs).'
'; +$infomodulesfound = '
'.$form->textwithpicto('', $langs->trans("ModuleBuilderDesc3", count($listofmodules)).'

'.$langs->trans("ModuleBuilderDesc4", $FILEFLAG).'
'.$textforlistofdirs).'
'; // Load module descriptor @@ -2028,8 +2025,10 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } $urltomodulesetup = ''.$langs->trans('Home').'-'.$langs->trans("Setup").'-'.$langs->trans("Modules").''; - if (!empty($conf->global->$const_name)) { // If module is already activated - $linktoenabledisable .= ''; + + // Define $linktoenabledisable to show after module title + if (isModEnabled($modulelowercase)) { // If module is already activated + $linktoenabledisable .= ''; $linktoenabledisable .= img_picto($langs->trans("Activated"), 'switch_on', '', false, 0, 0, '', '', 1); $linktoenabledisable .= ''; @@ -2089,7 +2088,7 @@ if (is_array($listofmodules) && count($listofmodules) > 0) { } $head[$h][0] = $_SERVER["PHP_SELF"].'?module=deletemodule'; -$head[$h][1] = $langs->trans("DangerZone"); +$head[$h][1] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone"); $head[$h][2] = 'deletemodule'; $h++; @@ -2578,7 +2577,7 @@ if ($module == 'initmodule') { if ($h > 1) { $head3[$h][0] = $_SERVER["PHP_SELF"].'?tab=objects&module='.$module.($forceddirread ? '@'.$dirread : '').'&tabobj=deleteobject'; - $head3[$h][1] = $langs->trans("DangerZone"); + $head3[$h][1] =img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("DangerZone"); $head3[$h][2] = 'deleteobject'; $h++; } @@ -2796,9 +2795,12 @@ if ($module == 'initmodule') { print ' '.$langs->trans("PageForObjLib").' : '.(dol_is_file($realpathtoobjlib) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtoobjlib).(dol_is_file($realpathtoobjlib) ? '' : '').''; print ' '.img_picto($langs->trans("Edit"), 'edit').''; print '
'; - print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; - //print ' '.img_picto($langs->trans("Edit"), 'edit').''; - print '
'; + // Image + if (dol_is_file($realpathtopicto)) { + print ' '.$langs->trans("Image").' : '.(dol_is_file($realpathtopicto) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtopicto).(dol_is_file($realpathtopicto) ? '' : '').''; + //print ' '.img_picto($langs->trans("Edit"), 'edit').''; + print '
'; + } print '
'; print ' '.$langs->trans("SqlFile").' : '.(dol_is_file($realpathtosql) ? '' : '').preg_replace('/^'.strtolower($module).'\//', '', $pathtosql).(dol_is_file($realpathtosql) ? '' : '').''; diff --git a/htdocs/modulebuilder/template/img/README.md b/htdocs/modulebuilder/template/img/README.md new file mode 100644 index 00000000000..2fcb4afc087 --- /dev/null +++ b/htdocs/modulebuilder/template/img/README.md @@ -0,0 +1,14 @@ + +Directory for module image files +-------------------------------- + +You can put here the .png files of your module: + + +If the picto of your module is an image (property $picto has been set to 'mymodule.png@mymodule', you can put into this +directory a .png file called *object_mymodule.png* (16x16 or 32x32 pixels) + + +If the picto of an object is an image (property $picto of the object.class.php has been set to 'myobject.png@mymodule', then you can put into this +directory a .png file called *object_myobject.png* (16x16 or 32x32 pixels) + diff --git a/htdocs/modulebuilder/template/img/object_mymodule.png b/htdocs/modulebuilder/template/img/object_mymodule.png deleted file mode 100644 index b421fe3c9e046e26f6f64e996d0ac6f914fb40ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0y_MV>B>Ar*{EFEO$)If}G@TqVsS z;K?HKQqEDJWWfRk&j}*Ij$9LWIdjZaEt_fgC(v|WZuyVE{Cnveqq!8H1nE3^Q+P=1 z>J6pzHFFOi7dG`V>~V=z*^%*0c-;qwr`mTC(p&lbdG0-v^)cLdNGff|;x#+nmA!Ac zG}*~K+qK>KZ`=d6{%iJ$(wftDofmsm&tGc%WKH2wLA_6M?iSg{#s5F~RKfV2apH@l TuYZ$(u4V9a^>bP0l+XkK_svvh diff --git a/htdocs/modulebuilder/template/img/object_mymodule_over.png b/htdocs/modulebuilder/template/img/object_mymodule_over.png deleted file mode 100644 index 7831c3025d7cf644f7299b25ad0c4605c1f0227e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 208 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0y_>7Fi*Ar*{!FEO$)IWn|948N<; z;GuND<2y&w0%lfLkESIvxPl}u-BWBiC$!tgo+;TkSkUgk`-79e|I@Z_XSaA0(Cp>& zpnykQmaAuh1HYwSK;({NvR4)EB*}C0%1Jos$DT3hZ7n@h=*-&WYOI>0c$|TaTSHZ3 z+Kxku{(9bUY!sa$$5d-_uT?t5;-EvL;kgqD3;)-DB>Ar*{EFEO$)If}G@TqVsS z;K?HKQqEDJWWfRk&j}*Ij$9LWIdjZaEt_fgC(v|WZuyVE{Cnveqq!8H1nE3^Q+P=1 z>J6pzHFFOi7dG`V>~V=z*^%*0c-;qwr`mTC(p&lbdG0-v^)cLdNGff|;x#+nmA!Ac zG}*~K+qK>KZ`=d6{%iJ$(wftDofmsm&tGc%WKH2wLA_6M?iSg{#s5F~RKfV2apH@l TuYZ$(u4V9a^>bP0l+XkK_svvh