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

Logger.php, BuildFormBootstrap.php, BuildFormPlain.php, BuildFormTable.php,...

Logger.php, BuildFormBootstrap.php, BuildFormPlain.php, BuildFormTable.php, Constants.php, BuildFormPlainTest.php: Replace 'label' and 'note' for FormElements by FE_LABEL, FE_NOTE.
parent e7cd8e04
......@@ -249,14 +249,14 @@ class BuildFormBootstrap extends AbstractBuildForm {
foreach ($pillArray as $formElement) {
$ii++;
if ($formElement['name'] === '' || $formElement['label'] === '') {
if ($formElement[FE_NAME] === '' || $formElement[FE_LABEL] === '') {
$this->store->setVar(SYSTEM_FORM_ELEMENT, Logger::formatFormElementName($formElement), STORE_SYSTEM);
$this->store->setVar(SYSTEM_FORM_ELEMENT_COLUMN, 'name, label', STORE_SYSTEM);
throw new UserFormException("Field 'name' and/or 'label' are empty", ERROR_NAME_LABEL_EMPTY);
}
// Anker for pill navigation
$a = '<a ' . Support::doAttribute('href', '#' . $this->createAnker($formElement['id'])) . ' data-toggle="tab">' . $formElement['label'] . '</a>';
$a = '<a ' . Support::doAttribute('href', '#' . $this->createAnker($formElement['id'])) . ' data-toggle="tab">' . $formElement[FE_LABEL] . '</a>';
if ($ii <= $maxVisiblePill) {
$pillButton .= '<li role="presentation" ' . $active . '>' . $a . '</li>';
......@@ -407,11 +407,11 @@ EOF;
public function buildRowNative(array $formElement, $htmlElement, $htmlFormElementId) {
$html = '';
$htmlLabel = $this->buildLabel($htmlFormElementId, $formElement['label']);
$htmlLabel = $this->buildLabel($htmlFormElementId, $formElement[FE_LABEL]);
$html .= $this->wrapItem(WRAP_SETUP_LABEL, $htmlLabel);
$html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement['note'], true);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE], true);
$html = $this->wrapItem(WRAP_SETUP_ELEMENT, $html);
......@@ -456,9 +456,9 @@ EOF;
*/
public function buildRowSubrecord(array $formElement, $elementHtml) {
$html = '';
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement['label']));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_LABEL]));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $elementHtml));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement['note']));
$html .= $this->wrapItem(WRAP_SETUP_ELEMENT, $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_NOTE]));
return $html;
}
......
......@@ -76,9 +76,9 @@ class BuildFormPlain extends AbstractBuildForm {
if($formElement['nestedInFieldSet']==='no')
$html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START];
$html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement['label']);
$html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement[FE_LABEL]);
$html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement['note']);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE]);
if($formElement['nestedInFieldSet']==='no')
$html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END];
......
......@@ -101,21 +101,21 @@ class BuildFormTable extends AbstractBuildForm {
if ($formElement[FE_TYPE] === 'subrecord') {
// subrecord in render='table' are outside the table
$html .= $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement['label']);
$html .= $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_LABEL]);
$html .= $this->wrapItem(WRAP_SETUP_SUBRECORD, $htmlElement);
$html .= $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement['note']);
$html .= $this->wrapItem(WRAP_SETUP_SUBRECORD, $formElement[FE_NOTE]);
} else {
if ($formElement['nestedInFieldSet'] === 'no') {
$html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_START];
$html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement['label']);
$html .= $this->wrapItem(WRAP_SETUP_LABEL, $formElement[FE_LABEL]);
$html .= $this->wrapItem(WRAP_SETUP_INPUT, $htmlElement);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement['note']);
$html .= $this->wrapItem(WRAP_SETUP_NOTE, $formElement[FE_NOTE]);
$html .= $this->wrap[WRAP_SETUP_ELEMENT][WRAP_SETUP_END];
} else {
$html .= $this->wrapItem(WRAP_SETUP_IN_FIELDSET, $formElement['label']);
$html .= $this->wrapItem(WRAP_SETUP_IN_FIELDSET, $formElement[FE_LABEL]);
$html .= $this->wrapItem(WRAP_SETUP_IN_FIELDSET, $htmlElement);
if($formElement['note']!=='')
$html .= $this->wrapItem(WRAP_SETUP_IN_FIELDSET, $formElement['note']);
if($formElement[FE_NOTE]!=='')
$html .= $this->wrapItem(WRAP_SETUP_IN_FIELDSET, $formElement[FE_NOTE]);
}
}
......
......@@ -477,6 +477,9 @@ const FE_MODE_SQL = 'modeSql';
const FE_DYNAMIC_UPDATE = 'dynamicUpdate';
const FE_VALUE = 'value';
const FE_CLASS = 'class';
const FE_LABEL = 'label';
const FE_NOTE = 'note';
const F_FE_PARAMETER = 'parameter'; // valid for F_ and FE_
// FormElement columns: via parameter field
const FE_DATE_FORMAT = 'dateFormat'; // value: FORMAT_DATE_INTERNATIONAL | FORMAT_DATE_GERMAN
......@@ -502,7 +505,11 @@ const FE_SENDMAIL_FLAG_AUTO_SUBMIT = 'sendMailFlagAutoSubmit'; // on|off - if 'o
const FE_SENDMAIL_GR_ID = 'sendMailGrId'; // gr_id: used to classify mail log entries ind table mailLog
const FE_SENDMAIL_X_ID = 'sendMailXId'; // x_id: used to classify mail log entries ind table mailLog
const FE_AUTOFOCUS = 'autofocus'; // value: <none>|0|1 , <none>==1, this element becomes the focus during form load.
const FE_RETYPE = 'retype'; // value: <none>|0|1 , <none>==1, this element becomes the focus during form load.
const FE_RETYPE_LABEL = 'retypeLabel'; // value: label text for retype FormElement
const FE_RETYPE_NOTE = 'retypeNote'; // value: note text for retype FormElement
const RETYPE_FE_NAME_EXTENSION = 'RETYPE';
// FormElement Types
const FE_TYPE_EXTRA = 'extra';
......
......@@ -39,9 +39,9 @@ class Logger {
*/
public static function formatFormElementName(array $fe) {
Support::setIfNotSet($fe, 'id');
Support::setIfNotSet($fe, 'name');
Support::setIfNotSet($fe, 'label');
Support::setIfNotSet($fe, FE_NAME);
Support::setIfNotSet($fe, FE_LABEL);
return $fe['id'] . ' / ' . $fe['name'] . ' / ' . $fe['label'];
return $fe['id'] . ' / ' . $fe[FE_NAME] . ' / ' . $fe[FE_LABEL];
}
}
\ No newline at end of file
......@@ -204,8 +204,8 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
'feIdContainer' => 0,
'dynamicUpdate' => 'no',
'enabled' => 'yes',
'name' => 'name',
'label' => 'Name',
FE_NAME => 'name',
FE_LABEL => 'Name',
FE_MODE => 'show',
'class' => 'native',
FE_TYPE => '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