From ee80305e6c11fd226c10f57ac76a59401d401b32 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Feb 2012 20:03:07 +0100 Subject: [PATCH] Fix: full path is defined by default --- dev/skeletons/modMyModule.class.php | 10 +++++----- htdocs/core/class/conf.class.php | 9 +-------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/dev/skeletons/modMyModule.class.php b/dev/skeletons/modMyModule.class.php index b9bb2d86322..121d8b9fb37 100644 --- a/dev/skeletons/modMyModule.class.php +++ b/dev/skeletons/modMyModule.class.php @@ -69,15 +69,15 @@ class modMyModule extends DolibarrModules $this->picto='generic'; // Defined all module parts (triggers, login, substitutions, menus, css, etc...) - // for default path (eg: /mymodule/core/triggers) (0=disable, 1=enable) - // for specific path of parts (eg: /core/modules/barcode) - // for specific css file (eg: /css/mymodule.css.php) + // for default path (eg: /mymodule/core/xxxxx) (0=disable, 1=enable) + // for specific path of parts (eg: /mymodule/core/modules/barcode) + // for specific css file (eg: /mymodule/css/mymodule.css.php) //$this->module_parts = array( 'triggers' => 1, // 'login' => 0, // 'substitutions' => 0, // 'menus' => 0, - // 'css' => '/css/mymodule.css.php', - // 'barcode' => '/path/to/your/parts', + // 'css' => '/mymodule/css/mymodule.css.php', + // 'barcode' => '/mymodule/path/to/your/parts', // 'hooks' => array('hookcontext1','hookcontext2')); $this->module_parts = array(); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index ef91ed7d202..f5fcb49c20d 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -165,13 +165,6 @@ class Conf $this->hooks_modules[$modulename][]=$value; } } - // If this is constant for a css file activated by a module - // TODO obsolete (see generic parts) - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_CSS$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->css_modules[$modulename]=$value; - } // If this is constant for triggers activated by a module // TODO obsolete (see generic parts) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_BARCODE$/i',$key,$reg)) @@ -187,7 +180,7 @@ class Conf $varname = $partname.'_modules'; $arrValue = unserialize($value); if (is_array($arrValue) && ! empty($arrValue)) $value = $arrValue; - else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : '/'.$modulename.$value); + else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : $value); $this->$varname = array_merge($this->$varname, array($modulename => $value)); } // If this is a module constant (must be at end)