Clean code

This commit is contained in:
Laurent Destailleur
2024-10-30 14:09:17 +01:00
parent 2be35d53eb
commit f1f08010db

View File

@@ -12790,7 +12790,7 @@ function getFieldErrorIcon($fieldValidationErrorMsg)
* @param string $iconClass class for icon element (Example: 'fa fa-file')
* @param string $url the url for link
* @param string $id attribute id of button
* @param int<-2,2> $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled, -2 disable Other reason use param $helpText as tooltip help
* @param int<-2,2> $status 0 no user rights, 1 active, 2 current action or selected, -1 Feature Disabled (deprecated, use -2 instead), -2 disable Other reason use param $helpText as tooltip help
* @param array<string,mixed> $params various parameters for future : recommended rather than adding more function arguments
* @return string html button
*/
@@ -12866,12 +12866,9 @@ function dolGetButtonTitle($label, $helpText = '', $iconClass = 'fa fa-file', $u
// TODO : add a hook
// escape all attribute
$attr = array_map('dol_escape_htmltag', $attr);
$TCompiledAttr = array();
foreach ($attr as $key => $value) {
$TCompiledAttr[] = $key.'="'.$value.'"';
$TCompiledAttr[] = $key.'="'.dolPrintHTMLForAttribute($value).'"';
}
$compiledAttributes = (empty($TCompiledAttr) ? '' : implode(' ', $TCompiledAttr));