Commit c01943d7 authored by Carsten  Rose's avatar Carsten Rose
Browse files

AbstractBuildForm.php: for dynamicUpdate wrap 'label' in the regular ''<label for=..>'' tag.

parent c2036f64
......@@ -599,7 +599,7 @@ abstract class AbstractBuildForm {
if (isset($formElement[FE_LABEL])) {
$key = $formElement[FE_HTML_ID] . HTML_ID_EXTENSION_LABEL;
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_CONTENT] = $formElement[FE_LABEL];
$json[API_ELEMENT_UPDATE][$key][API_ELEMENT_CONTENT] = $this->buildLabel($htmlFormElementName, $formElement[FE_LABEL]);
}
if (isset($formElement[FE_NOTE])) {
......@@ -656,6 +656,22 @@ abstract class AbstractBuildForm {
}
}
/**
* Builds a label, typically for an html-'<input>'-element.
*
* @param string $htmlFormElementName
* @param string $label
* @return string
*/
public function buildLabel($htmlFormElementName, $label) {
$attributes = Support::doAttribute('for', $htmlFormElementName);
$attributes .= Support::doAttribute('class', 'control-label');
$html = Support::wrapTag("<label $attributes>", $label);
return $html;
}
/**
* Takes the current SIP ('form' and additional parameter), set SIP_RECORD_ID=0 and create a new 'NewRecordUrl'.
*
......@@ -691,22 +707,6 @@ abstract class AbstractBuildForm {
abstract public function buildRowSubrecord(array $formElement, $elementHtml);
/**
* Builds a label, typically for an html-'<input>'-element.
*
* @param string $htmlFormElementName
* @param string $label
* @return string
*/
public function buildLabel($htmlFormElementName, $label) {
$attributes = Support::doAttribute('for', $htmlFormElementName);
$attributes .= Support::doAttribute('class', 'control-label');
$html = Support::wrapTag("<label $attributes>", $label);
return $html;
}
/**
* Builds HTML 'input' element.
* Format: <input name="$htmlFormElementName" <type="email|input|password|url" [autocomplete="autocomplete"] [autofocus="autofocus"]
......
Markdown is supported
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