Clean code, fix warnings

This commit is contained in:
Laurent Destailleur 2018-05-01 12:40:42 +02:00
parent f50a6149d5
commit 8be8249f85
5 changed files with 6 additions and 72 deletions

View File

@ -158,14 +158,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
* // Set this to relative path of js file if module must load a js on all pages
* 'js' => '/mymodule/js/mymodule.js',
* // Set here all hooks context managed by module
* 'hooks' => array('hookcontext1','hookcontext2'),
* // Set here all workflow context managed by module
* 'workflow' => array(
* 'WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2' = >array(
* 'enabled' => '! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)',
* 'picto'=>'yourpicto@mymodule'
* )
* )
* 'hooks' => array('hookcontext1','hookcontext2')
* )
*/
public $module_parts = array();
@ -2083,7 +2076,8 @@ class DolibarrModules // Can not be abstract, because we need to insta
if (is_array($value))
{
// Can defined other parameters
if (is_array($value['data']) && ! empty($value['data']))
// Example when $key='hooks', then $value is an array('data'=>array('hookcontext1','hookcontext2'), 'entity'=>X)
if (isset($value['data']) && is_array($value['data']))
{
$newvalue = json_encode($value['data']);
if (isset($value['entity'])) $entity = $value['entity'];
@ -2093,7 +2087,7 @@ class DolibarrModules // Can not be abstract, because we need to insta
$newvalue = $value['data'];
if (isset($value['entity'])) $entity = $value['entity'];
}
else
else // when hook is declared with syntax 'hook'=>array('hookcontext1','hookcontext2',...)
{
$newvalue = json_encode($value);
}

View File

@ -80,19 +80,7 @@ class modDav extends DolibarrModules
// for default path (eg: /dav/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /dav/core/modules/barcode)
// for specific css file (eg: /dav/css/dav.css.php)
$this->module_parts = array(
'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
'login' => 0, // Set this to 1 if module has its own login method file (core/login)
'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
'theme' => 0, // Set this to 1 if module has its own theme directory (theme)
'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
'css' => array(), // Set this to relative path of css file if module has its own css file
'js' => array(), // Set this to relative path of js file if module must load a js on all pages
'hooks' => array() // Set here all hooks context managed by module. To find available hook context, make a "grep -r '>initHooks(' *" on source code. You can also set hook context 'all'
);
$this->module_parts = array();
// Data directories to create when module is enabled.
// Example: this->dirs = array("/dav/temp","/dav/subdir");

View File

@ -74,21 +74,6 @@ class modMultiCurrency extends DolibarrModules
// for default path (eg: /multicurrency/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /multicurrency/core/modules/barcode)
// for specific css file (eg: /multicurrency/css/multicurrency.css.php)
//$this->module_parts = array(
// 'triggers' => 0, // Set this to 1 if module has its own trigger directory (core/triggers)
// 'login' => 0, // Set this to 1 if module has its own login method directory (core/login)
// 'substitutions' => 0, // Set this to 1 if module has its own substitution function file (core/substitutions)
// 'menus' => 0, // Set this to 1 if module has its own menus handler directory (core/menus)
// 'theme' => 0, // Set this to 1 if module has its own theme directory (theme)
// 'tpl' => 0, // Set this to 1 if module overwrite template dir (core/tpl)
// 'barcode' => 0, // Set this to 1 if module has its own barcode directory (core/modules/barcode)
// 'models' => 0, // Set this to 1 if module has its own models directory (core/modules/xxx)
// 'css' => array('/multicurrency/css/multicurrency.css.php'), // Set this to relative path of css file if module has its own css file
// 'js' => array('/multicurrency/js/multicurrency.js'), // Set this to relative path of js file if module must load a js on all pages
// 'hooks' => array('hookcontext1','hookcontext2') // Set here all hooks context managed by module
// 'dir' => array('output' => 'othermodulename'), // To force the default directories names
// 'workflow' => array('WORKFLOW_MODULE1_YOURACTIONTYPE_MODULE2'=>array('enabled'=>'! empty($conf->module1->enabled) && ! empty($conf->module2->enabled)', 'picto'=>'yourpicto@multicurrency')) // Set here all workflow context managed by module
// );
$this->module_parts = array();
// Data directories to create when module is enabled.

View File

@ -79,26 +79,7 @@ class modResource extends DolibarrModules
// for default path (eg: /resource/core/xxxxx) (0=disable, 1=enable)
// for specific path of parts (eg: /resource/core/modules/barcode)
// for specific css file (eg: /resource/css/resource.css.php)
$this->module_parts = array(
// Set this to 1 if module has its own trigger directory
//'triggers' => 1,
// Set this to 1 if module has its own login method directory
//'login' => 0,
// Set this to 1 if module has its own substitution function file
//'substitutions' => 0,
// Set this to 1 if module has its own menus handler directory
//'menus' => 0,
// Set this to 1 if module has its own barcode directory
//'barcode' => 0,
// Set this to 1 if module has its own models directory
//'models' => 0,
// Set this to relative path of css if module has its own css file
//'css' => '/resource/css/resource.css.php',
// Set here all hooks context managed by module
// 'hooks' => array('actioncard','actioncommdao','resource_card','element_resource')
// Set here all workflow context managed by module
//'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE'))
);
$this->module_parts = array();
// Data directories to create when module is enabled.
// Example: this->dirs = array("/resource/temp");

View File

@ -82,22 +82,8 @@ class modTicketsup extends DolibarrModules
$this->module_parts = array(
// Set this to 1 if module has its own trigger directory
'triggers' => 1,
// Set this to 1 if module has its own login method directory
//'login' => 0,
// Set this to 1 if module has its own substitution function file
//'substitutions' => 0,
// Set this to 1 if module has its own menus handler directory
//'menus' => 0,
// Set this to 1 if module has its own barcode directory
//'barcode' => 0,
// Set this to 1 if module has its own models directory
'models' => 1,
// Set this to relative path of css if module has its own css file
//'css' => '',
// Set here all hooks context managed by module
'hooks' => array('admin')
// Set here all workflow context managed by module
//'workflow' => array('order' => array('WORKFLOW_ORDER_AUTOCREATE_INVOICE'))
);
// Data directories to create when module is enabled.