Clean code

This commit is contained in:
Laurent Destailleur 2020-10-02 19:00:15 +02:00
parent e7ce888cef
commit 1a535dc77b
2 changed files with 4 additions and 27 deletions

View File

@ -170,29 +170,6 @@ class ModeleBoxes // Can't be abtract as it is instantiated to build "empty" box
}
}
/**
* Standard method to get content of a box
*
* @param array $head Array with properties of box title
* @param array $contents Array with properties of box lines
*
* @return string
*/
public function outputBox($head = null, $contents = null)
{
global $langs, $user, $conf;
// Trick to get result into a var from a function that makes print instead of return
// TODO Replace ob_start with param nooutput=1 into showBox
ob_start();
$result = $this->showBox($head, $contents);
$output = ob_get_contents();
ob_end_clean();
return $output;
}
/**
* Standard method to show a box (usage by boxes not mandatory, a box can still use its own showBox function)
*

View File

@ -1162,7 +1162,7 @@ class FormOther
//print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
// Show box
$box->loadBox($box_max_lines);
$boxlista .= $box->outputBox();
$boxlista .= $box->showBox(null, null, 1);
}
}
@ -1171,7 +1171,7 @@ class FormOther
$emptybox->box_id = 'A';
$emptybox->info_box_head = array();
$emptybox->info_box_contents = array();
$boxlista .= $emptybox->outputBox(array(), array());
$boxlista .= $emptybox->showBox(array(), array(), 1);
}
$boxlista .= "<!-- End box left container -->\n";
@ -1189,7 +1189,7 @@ class FormOther
//print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
// Show box
$box->loadBox($box_max_lines);
$boxlistb .= $box->outputBox();
$boxlistb .= $box->showBox(null, null, 1);
}
}
@ -1198,7 +1198,7 @@ class FormOther
$emptybox->box_id = 'B';
$emptybox->info_box_head = array();
$emptybox->info_box_contents = array();
$boxlistb .= $emptybox->outputBox(array(), array());
$boxlistb .= $emptybox->showBox(array(), array(), 1);
}
$boxlistb .= "<!-- End box right container -->\n";