diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index d318566ff61..21e3afb3921 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -1,5 +1,6 @@ +/* Copyright (C) 2017 Laurent Destailleur + * Copyright (C) 2017 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -68,7 +69,7 @@ llxHeader('',$langs->trans("Setup"),$help_url); print ''."\n".''; $arrayofnatures=array('core'=>$langs->transnoentitiesnoconv("Core"), 'external'=>$langs->transnoentitiesnoconv("External").' - '.$langs->trans("AllPublishers")); @@ -165,6 +166,7 @@ foreach ($modulesdir as $dir) // Gives the possibility to the module, to provide his own family info and position of this family if (is_array($objMod->familyinfo) && !empty($objMod->familyinfo)) { + if (!is_array($familyinfo)) $familyinfo=array(); $familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familykey = key($objMod->familyinfo); } else { @@ -305,13 +307,13 @@ if ($objMod->isCoreOrExternalModule() == 'external') // Define text of description of module $text=''; - + if ($mode == 'desc') { if ($moduledesc) $text.=$moduledesc.'

'; - + $text.=''.$langs->trans("Version").': '.$version; - + $textexternal=''; if ($objMod->isCoreOrExternalModule() == 'external') { @@ -346,8 +348,8 @@ if ($mode == 'desc') $text.=''.$langs->trans("LastActivationIP").': '; $text.= $ip; $text.='
'; - } - + } + $moduledesclong=$objMod->getDescLong(); if ($moduledesclong) $text.='

'.$moduledesclong.'
'; } @@ -360,9 +362,9 @@ if ($mode == 'feature') $text.='
'.$langs->trans("RequiredBy").': '; if (count($objMod->requiredby)) $text.=join(',', $objMod->requiredby); else $text.=$langs->trans("None"); - + $text.='


'; - + $text.=''.$langs->trans("AddRemoveTabs").': '; if (isset($objMod->tabs) && is_array($objMod->tabs) && count($objMod->tabs)) { @@ -375,9 +377,9 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddDictionaries").': '; if (isset($objMod->dictionaries) && isset($objMod->dictionaries['tablib']) && is_array($objMod->dictionaries['tablib']) && count($objMod->dictionaries['tablib'])) { @@ -389,9 +391,9 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddBoxes").': '; if (isset($objMod->boxes) && is_array($objMod->boxes) && count($objMod->boxes)) { @@ -403,27 +405,27 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddModels").': '; if (isset($objMod->module_parts) && isset($objMod->module_parts['models']) && $objMod->module_parts['models']) { $text.=$langs->trans("Yes"); } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddSubstitutions").': '; if (isset($objMod->module_parts) && isset($objMod->module_parts['substitutions']) && $objMod->module_parts['substitutions']) { $text.=$langs->trans("Yes"); } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddSheduledJobs").': '; if (isset($objMod->cronjobs) && is_array($objMod->cronjobs) && count($objMod->cronjobs)) { @@ -435,55 +437,72 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddTriggers").': '; if (isset($objMod->module_parts) && isset($objMod->module_parts['triggers']) && $objMod->module_parts['triggers']) { $text.=$langs->trans("Yes"); } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddHooks").': '; if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) { - $i=0; - foreach($objMod->module_parts['hooks'] as $val) + $i=0; + foreach($objMod->module_parts['hooks'] as $key => $val) { - $text.=($i?', ':'').($val); - $i++; + if ($key == 'entity') continue; + + // For special values + if ($key == 'data') + { + if (is_array($val)) + { + foreach($val as $value) + { + $text.=($i?', ':'').($value); + $i++; + } + + continue; + } + } + + $text.=($i?', ':'').($val); + $i++; } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddPermissions").': '; if (isset($objMod->rights) && is_array($objMod->rights) && count($objMod->rights)) { $i=0; foreach($objMod->rights as $val) { - $text.=($i?', ':'').($val[1]); - $i++; + $text.=($i?', ':'').($val[1]); + $i++; } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddMenus").': '; if (isset($objMod->menu) && ! empty($objMod->menu)) // objMod can be an array or just an int 1 { $text.=$langs->trans("Yes"); } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddExportProfiles").': '; if (isset($objMod->export_label) && is_array($objMod->export_label) && count($objMod->export_label)) { @@ -495,9 +514,9 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddImportProfiles").': '; if (isset($objMod->import_label) && is_array($objMod->import_label) && count($objMod->import_label)) { @@ -509,9 +528,9 @@ if ($mode == 'feature') } } else $text.=$langs->trans("No"); - + $text.='
'; - + $text.='
'.$langs->trans("AddOtherPagesOrServices").': '; $text.=$langs->trans("DetectionNotPossible"); }