New: [ task #696 ] Remove "new stdClass();" when possible

This commit is contained in:
Laurent Destailleur
2013-03-08 15:52:23 +01:00
parent e5f712fe14
commit 0fe91796ef
6 changed files with 11 additions and 13 deletions

View File

@@ -4095,7 +4095,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
if (verifCond($values[4]))
{
if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[5]), 1);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[5]), 1);
$head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]);
$h++;
@@ -4105,7 +4105,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
{
if ($values[0] != $type) continue;
if ($values[3]) $langs->load($values[3]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[4]), 1);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[4]), 1);
$head[$h][1] = $langs->trans($values[2]);
$head[$h][2] = str_replace('+','',$values[1]);
$h++;
@@ -4114,7 +4114,7 @@ function complete_head_from_modules($conf,$langs,$object,&$head,&$h,$type,$mode=
{
if ($values[0] != $type) continue;
if ($values[2]) $langs->load($values[2]);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', (! empty($object->id)?$object->id:''), $values[3]), 1);
$head[$h][0] = dol_buildpath(preg_replace('/__ID__/i', ((is_object($object) && ! empty($object->id))?$object->id:''), $values[3]), 1);
$head[$h][1] = $langs->trans($values[1]);
$head[$h][2] = 'tab'.$values[1];
$h++;