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 <?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 * 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 * 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 // 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($objMod->familyinfo) && !empty($objMod->familyinfo)) {
if (!is_array($familyinfo)) $familyinfo=array();
$familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familyinfo = array_merge($familyinfo, $objMod->familyinfo);
$familykey = key($objMod->familyinfo); $familykey = key($objMod->familyinfo);
} else { } else {
@ -451,8 +453,25 @@ if ($mode == 'feature')
if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks'])) if (isset($objMod->module_parts) && is_array($objMod->module_parts['hooks']) && count($objMod->module_parts['hooks']))
{ {
$i=0; $i=0;
foreach($objMod->module_parts['hooks'] as $val) foreach($objMod->module_parts['hooks'] as $key => $val)
{ {
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); $text.=($i?', ':'').($val);
$i++; $i++;
} }