Fix: for view special values

This commit is contained in:
Regis Houssin 2017-05-26 10:28:10 +02:00
parent e5fe629a0e
commit 95b2b1bd17

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.com>
*
* 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
@ -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 {
@ -450,11 +452,28 @@ if ($mode == 'feature')
$text.='<br><strong>'.$langs->trans("AddHooks").':</strong> ';
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");
@ -467,8 +486,8 @@ if ($mode == 'feature')
$i=0;
foreach($objMod->rights as $val)
{
$text.=($i?', ':'').($val[1]);
$i++;
$text.=($i?', ':'').($val[1]);
$i++;
}
}
else $text.=$langs->trans("No");