Commit 012db4b1 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Support.php: doAttribute() - Add feature to submit param arrays

parent 255c9705
...@@ -88,11 +88,17 @@ class Support { ...@@ -88,11 +88,17 @@ class Support {
* Format's an attribute: $type=$value. If $flagOmitEmpty==true && $value=='': return ''. * Format's an attribute: $type=$value. If $flagOmitEmpty==true && $value=='': return ''.
* *
* @param string $type * @param string $type
* @param string $value * @param string|array $value
* @param bool $flagOmitEmpty * @param bool $flagOmitEmpty
* @return string * @return string
*/ */
public static function doAttribute($type, $value, $flagOmitEmpty = true, $modeEscape = ESCAPE_WITH_BACKSLASH) { public static function doAttribute($type, $value, $flagOmitEmpty = true, $modeEscape = ESCAPE_WITH_BACKSLASH) {
// several attributes might be given as an array - concat to a string
if (is_array($value)) {
$value = implode(' ', $value);
}
if ($flagOmitEmpty && $value === "") { if ($flagOmitEmpty && $value === "") {
return ''; return '';
} }
...@@ -572,6 +578,9 @@ class Support { ...@@ -572,6 +578,9 @@ class Support {
self::setIfNotSet($formElement, FE_SHOW_ZERO, '0'); self::setIfNotSet($formElement, FE_SHOW_ZERO, '0');
self::setIfNotSet($formElement, FE_DATE_FORMAT, $store->getVar(SYSTEM_DATE_FORMAT, STORE_SYSTEM)); self::setIfNotSet($formElement, FE_DATE_FORMAT, $store->getVar(SYSTEM_DATE_FORMAT, STORE_SYSTEM));
self::setIfNotSet($formElement, FE_HTML_BEFORE);
self::setIfNotSet($formElement, FE_HTML_AFTER);
if (count($formSpec) > 0) { if (count($formSpec) > 0) {
self::setIfNotSet($formElement, F_BS_LABEL_COLUMNS, $formSpec[F_BS_LABEL_COLUMNS], ''); self::setIfNotSet($formElement, F_BS_LABEL_COLUMNS, $formSpec[F_BS_LABEL_COLUMNS], '');
self::setIfNotSet($formElement, F_BS_INPUT_COLUMNS, $formSpec[F_BS_INPUT_COLUMNS], ''); self::setIfNotSet($formElement, F_BS_INPUT_COLUMNS, $formSpec[F_BS_INPUT_COLUMNS], '');
......
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