Unverified Commit d13fdbdb authored by Côme Chilliet's avatar Côme Chilliet
Browse files

:ambulance: fix(core) Remove {literal} smarty tag from button column

issue #6071
Showing with 14 additions and 9 deletions
+14 -9
...@@ -107,7 +107,8 @@ class SnapshotsAttribute extends OrderedArrayAttribute ...@@ -107,7 +107,8 @@ class SnapshotsAttribute extends OrderedArrayAttribute
'title' => _('Restore'), 'title' => _('Restore'),
'alt' => _('Restore'), 'alt' => _('Restore'),
'class' => 'center' 'class' => 'center'
] ],
FALSE
).$img; ).$img;
$nbicons++; $nbicons++;
......
...@@ -546,7 +546,8 @@ class OrderedArrayAttribute extends SetAttribute ...@@ -546,7 +546,8 @@ class OrderedArrayAttribute extends SetAttribute
'alt' => _('Sort up'), 'alt' => _('Sort up'),
'class' => 'center', 'class' => 'center',
'formnovalidate' => 'formnovalidate', 'formnovalidate' => 'formnovalidate',
] ],
FALSE
); );
} else { } else {
$img .= '<img src="images/empty.png" alt="" style="width:16px;"/>'; $img .= '<img src="images/empty.png" alt="" style="width:16px;"/>';
...@@ -560,7 +561,8 @@ class OrderedArrayAttribute extends SetAttribute ...@@ -560,7 +561,8 @@ class OrderedArrayAttribute extends SetAttribute
'alt' => _('Sort down'), 'alt' => _('Sort down'),
'class' => 'center', 'class' => 'center',
'formnovalidate' => 'formnovalidate', 'formnovalidate' => 'formnovalidate',
] ],
FALSE
); );
} else { } else {
$img .= '<img src="images/empty.png" alt="" style="width:16px;"/>'; $img .= '<img src="images/empty.png" alt="" style="width:16px;"/>';
...@@ -576,7 +578,8 @@ class OrderedArrayAttribute extends SetAttribute ...@@ -576,7 +578,8 @@ class OrderedArrayAttribute extends SetAttribute
'alt' => _('Edit'), 'alt' => _('Edit'),
'class' => 'center', 'class' => 'center',
'formnovalidate' => 'formnovalidate', 'formnovalidate' => 'formnovalidate',
] ],
FALSE
); );
} }
$img .= $this->renderInputField( $img .= $this->renderInputField(
...@@ -587,7 +590,8 @@ class OrderedArrayAttribute extends SetAttribute ...@@ -587,7 +590,8 @@ class OrderedArrayAttribute extends SetAttribute
'alt' => _('Delete'), 'alt' => _('Delete'),
'class' => 'center', 'class' => 'center',
'formnovalidate' => 'formnovalidate', 'formnovalidate' => 'formnovalidate',
] ],
FALSE
); );
return [$img, $nbicons]; return [$img, $nbicons];
......
...@@ -787,16 +787,16 @@ class Attribute ...@@ -787,16 +787,16 @@ class Attribute
return ($this->getValue() == $value); return ($this->getValue() == $value);
} }
protected function renderInputField (string $type, string $name, array $attributes = []): string protected function renderInputField (string $type, string $name, array $attributes = [], bool $smartyEscape = TRUE): string
{ {
$input = '{literal}<input type="'.htmlescape($type).'" '. $input = '<input type="'.htmlescape($type).'" '.
'name="'.htmlescape($name).'" id="'.htmlescape($name).'"'. 'name="'.htmlescape($name).'" id="'.htmlescape($name).'"'.
($this->disabled ? ' disabled="disabled"' : ''); ($this->disabled ? ' disabled="disabled"' : '');
foreach ($attributes as $label => $value) { foreach ($attributes as $label => $value) {
$input .= ' '.$label.'="'.htmlescape($value).'"'; $input .= ' '.$label.'="'.htmlescape($value).'"';
} }
$input .= '/>{/literal}'; $input .= '/>';
return $input; return ($smartyEscape ? '{literal}'.$input.'{/literal}' : $input);
} }
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment