From 9e629bdb0290561813a1ebe22d40828132301c6a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 2 Jun 2017 20:01:25 +0200 Subject: [PATCH] Work on modulebuilder --- htdocs/core/class/interfaces.class.php | 14 +++++++------- htdocs/core/lib/functions.lib.php | 1 + .../modulebuilder/template/img/object_mytest.png | Bin 0 -> 360 bytes htdocs/theme/eldy/style.css.php | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 htdocs/modulebuilder/template/img/object_mytest.png diff --git a/htdocs/core/class/interfaces.class.php b/htdocs/core/class/interfaces.class.php index cd4a56f4174..625b30e3ac2 100644 --- a/htdocs/core/class/interfaces.class.php +++ b/htdocs/core/class/interfaces.class.php @@ -76,14 +76,14 @@ class Interfaces global $db; $user = new User($db); } - + $nbfile = $nbtotal = $nbok = $nbko = 0; $files = array(); $modules = array(); $orders = array(); $i=0; - + $dirtriggers=array_merge(array('/core/triggers'),$conf->modules_parts['triggers']); foreach($dirtriggers as $reldir) { @@ -106,7 +106,7 @@ class Interfaces $part3=$reg[3]; $nbfile++; - + // Check if trigger file is disabled by name if (preg_match('/NORUN$/i',$file)) continue; // Check if trigger file is for a particular module @@ -132,7 +132,7 @@ class Interfaces dol_syslog(get_class($this)."::run_triggers action=".$action." ".$langs->trans("ErrorDuplicateTrigger", $newdir."/".$file, $fullpathfiles[$modName]), LOG_WARNING); continue; } - + try { //print 'Todo for '.$modName." : ".$newdir.'/'.$file."\n"; include_once $newdir.'/'.$file; @@ -142,7 +142,7 @@ class Interfaces { dol_syslog('ko for '.$modName." ".$e->getMessage()."\n", LOG_ERR); } - + $modules[$i] = $modName; $files[$i] = $file; $fullpathfiles[$modName] = $newdir.'/'.$file; @@ -155,7 +155,7 @@ class Interfaces } asort($orders); - + // Loop on each trigger foreach ($orders as $key => $value) { @@ -246,7 +246,7 @@ class Interfaces { $dirtriggers=$forcedirtriggers; } - + foreach($dirtriggers as $reldir) { $dir=dol_buildpath($reldir,0); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index ef03b0c00cc..3569cdd006d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2556,6 +2556,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $ $picto = $regs[1]; $path = $regs[2]; // $path is $mymodule } + // Clean parameters if (! preg_match('/(\.png|\.gif)$/i',$picto)) $picto .= '.png'; // If alt path are defined, define url where img file is, according to physical path diff --git a/htdocs/modulebuilder/template/img/object_mytest.png b/htdocs/modulebuilder/template/img/object_mytest.png new file mode 100644 index 0000000000000000000000000000000000000000..5a307bfc62f85df909a3cf024f27ee87d44be275 GIT binary patch literal 360 zcmeAS@N?(olHy`uVBq!ia0vp^d?3uh1|;P@bT0xamSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt)eIT^vI+ zChono-m4{0gyqBiz=Ju)w^;&N<{#X1a0!1>bC%GsW3bBL=<%|p84;9-@5SwA|2OIEL% zb=QtBT0T9C&(LA{syqXqqW_DHn`b;(x5}@uA-g2{Ncy)Mhpp~Sy0eY()*3IP6|4C4 z(mDEHWvtPCEP7WZe7{4e?P9&>AE%^j|Mz!&9rL?{G_w^d>;^y&GkCiCxvX