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

Fixes #7620. Label align left/center/right. Defined by...

Fixes #7620. Label align left/center/right. Defined by config/form/formelement. FormEditor slightly redesigned.
parent 9cc3fde1
Pipeline #1361 passed with stage
in 2 minutes and 13 seconds
......@@ -10,4 +10,12 @@
* Open: https://docs.typo3.org/~mbless/github.com/T3DocumentationStarter/Public-Info-053.git.make/request_rebuild.php
* For a few seconds a file 'REBUILD_REQUESTED' appears.
* After the file disappeared, the documentation should be updated.
\ No newline at end of file
* After the file disappeared, the documentation should be updated.
# Log errors
Check:
* https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/stable/_buildinfo/
* https://docs.typo3.org/typo3cms/drafts/github/T3DocumentationStarter/Public-Info-053/latest/_buildinfo//PDFPROJECT.log.txt
Rebuild:
https://docs.typo3.org/~mbless/github.com/T3DocumentationStarter/Public-Info-039.git.make/request_rebuild.php
......@@ -453,6 +453,8 @@ Extension Manager: QFQ Configuration
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| Form-Layout |
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| labelAlign | left | Label align (left/center/right)/ Default: left. Will be inherited to Form. |
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
| cssClassQfqContainer | container | | QFQ with own Bootstrap: 'container'. |
| | | | QFQ already nested in Bootstrap of mainpage: <empty>. |
+-------------------------------+-------------------------------------------------------+----------------------------------------------------------------------------+
......@@ -2113,6 +2115,8 @@ Definition
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Forward (Mode) Page | a) URL / Typo3 page id/alias or b) Forward Mode (via '{{...}}') or combination of a) & b). See `form-forward`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|labelAlign | Label align (default/left/center/right)/ Default: 'default' (defined by Config). |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|Parameter | Misc additional parameters. See `form-parameter`_. |
+-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
|BS Label Columns | The bootstrap grid system is based on 12 columns. The sum of *bsLabelColumns*, |
......@@ -2698,10 +2702,12 @@ Fields:
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Order | string | Display order of *FormElements* ('order' is a reserved keyword) _`field-ord` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|tabindex | string |HTML tabindex attribute _`field-tabindex` |
|tabindex | string | HTML tabindex attribute _`field-tabindex` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|labelAlign | left | Label align (default/left/center/right)/ Default: 'default' (defined by Form). |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Size | string |Visible length of input element. Might be omitted, depending on the chosen form layout. |
| | |Format: <width>,<height> (in characters) _`field-size` |
|Size | string | Visible length of input element. Might be omitted, depending on the chosen form layout. |
| | | Format: <width>,<height> (in characters) _`field-size` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|BS Label Columns | string | Number of bootstrap grid columns. By default empty, value inherits from the form. |
| | | _`field-bsLabelColumns`. See `bs-custom-field-width`_ |
......@@ -2712,20 +2718,20 @@ Fields:
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Label / Input / Note | enum(...) | Switch on/off opening|closing of bootstrap form classes _`field-rowLabelInputNote` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Maxlength | string |Maximum characters for input. _`field-maxLength` |
|Maxlength | string | Maximum characters for input. _`field-maxLength` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Note | string |Note of *FormElement*. Depending on layout model, right or below of the *FormElement*. |
| | |Report syntax can also be used, see report-notation_ |
|Note | string | Note of *FormElement*. Depending on layout model, right or below of the *FormElement*. |
| | | Report syntax can also be used, see report-notation_ |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Tooltip | text |Display this text as tooltip on mouse over. _`field-tooltip` |
|Tooltip | text | Display this text as tooltip on mouse over. _`field-tooltip` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Placeholder | string |Text, displayed inside the input element in light grey. _`field-placeholder` |
|Placeholder | string | Text, displayed inside the input element in light grey. _`field-placeholder` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|value | text |Default value: See field-value_ |
|value | text | Default value: See field-value_ |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|sql1 | text |SQL query. See individual `FormEelement`. _`sql1` |
|sql1 | text | SQL query. See individual `FormEelement`. _`sql1` |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|Parameter | text |Might contain misc parameter. See fe-parameter-attributes_ |
|Parameter | text | Might contain misc parameter. See fe-parameter-attributes_ |
+---------------------+-----------------------------+-----------------------------------------------------------------------------------------------------+
|feGroup | string | Comma-separated list of Typo3 FE Group ID. NOT SURE IF THIS WILL BE IMPLEMENTED. Native |
| | | *FormElements*, fieldsets and pills can be assigned to feGroups. Group status: show, hidden, |
......
......@@ -808,7 +808,7 @@ EOF;
$wrapArray[0] = Support::insertAttribute($wrapArray[0], 'id', $htmlId);
$wrapArray[0] = Support::insertAttribute($wrapArray[0], 'class', $class); // might be problematic, if there is already a 'class' defined.
if ($wrapName == FE_WRAP_LABEL) {
$wrapArray[0] = Support::insertAttribute($wrapArray[0], 'style', 'text-align: right;'); // might be problematic, if there is already a 'class' defined.
$wrapArray[0] = Support::insertAttribute($wrapArray[0], 'style', 'text-align: ' . $formElement[F_FE_LABEL_ALIGN].';'); // might be problematic, if there is already a 'class' defined.
}
}
......
......@@ -518,6 +518,9 @@ const SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT = 50; // Default max length for get
const GET_EXTRA_LENGTH_TOKEN = '_';
const SYSTEM_LABEL_ALIGN = 'labelAlign';
const SYSTEM_LABEL_ALIGN_LEFT = 'left';
const SYSTEM_EXTRA_BUTTON_INFO_INLINE = 'extraButtonInfoInline';
const SYSTEM_EXTRA_BUTTON_INFO_BELOW = 'extraButtonInfoBelow';
const SYSTEM_EXTRA_BUTTON_INFO_POSITION = 'extraButtonInfoPosition';
......@@ -886,6 +889,9 @@ const F_FE_DATA_PATTERN_ERROR_DEFAULT = 'pattern error'; // Attention: the defau
const F_FE_DATA_REQUIRED_ERROR_DEFAULT = 'data required'; // Attention: the default is also defined in ext_conf_template.txt
const F_FE_DATA_MATCH_ERROR_DEFAULT = 'fields do not match'; // Attention: the default is also defined in ext_conf_template.txt
const F_FE_LABEL_ALIGN = SYSTEM_LABEL_ALIGN;
const F_FE_LABEL_ALIGN_DEFAULT = 'default';
const F_PARAMETER = 'parameter'; // valid for F_ and FE_
// Form columns: via parameter field
......
......@@ -591,10 +591,10 @@ class QuickFormQuery {
if (!empty($feFilter)) {
foreach ($feFilter AS $feParent) {
if($feParent[FE_MODE_SQL]){
if ($feParent[FE_MODE_SQL]) {
$mode = $this->evaluate->parse($feParent[FE_MODE_SQL]);
if($mode!=''){
$feParent[FE_MODE]=$mode;
if ($mode != '') {
$feParent[FE_MODE] = $mode;
}
}
......@@ -603,8 +603,8 @@ class QuickFormQuery {
foreach ($feChild AS $fe) {
# Search for origin
foreach($this->feSpecNative as $key => $value){
if($value[FE_ID]==$fe[FE_ID]){
foreach ($this->feSpecNative as $key => $value) {
if ($value[FE_ID] == $fe[FE_ID]) {
$this->feSpecNative[$key][FE_MODE] = FE_MODE_HIDDEN;
break;
}
......@@ -1229,6 +1229,10 @@ class QuickFormQuery {
}
}
if ($formSpec[F_FE_LABEL_ALIGN] == F_FE_LABEL_ALIGN_DEFAULT) {
$formSpec[F_FE_LABEL_ALIGN] = $this->store->getVar(SYSTEM_LABEL_ALIGN, STORE_SYSTEM . STORE_EMPTY);
}
foreach ($keys as $key) {
if (isset($formSpec[$key])) {
......
......@@ -85,7 +85,7 @@ class HelperFormElement {
}
}
$element = array_merge($element, $arr);
$element[$keyName]=''; // to not expand it a second time
$element[$keyName] = ''; // to not expand it a second time
}
}
......@@ -246,11 +246,16 @@ class HelperFormElement {
* @return mixed
*/
public static function copyAttributesToFormElements(array $formSpec, array $feSpecNative) {
// Iterate over all FormElement
foreach ($feSpecNative as $key => $element) {
Support::setIfNotSet($feSpecNative[$key], F_FE_DATA_PATTERN_ERROR, $formSpec[F_FE_DATA_PATTERN_ERROR]);
Support::setIfNotSet($feSpecNative[$key], F_FE_DATA_REQUIRED_ERROR, $formSpec[F_FE_DATA_REQUIRED_ERROR]);
Support::setIfNotSet($feSpecNative[$key], F_FE_DATA_MATCH_ERROR, $formSpec[F_FE_DATA_MATCH_ERROR]);
Support::setIfNotSet($feSpecNative[$key], F_FE_DATA_ERROR, $formSpec[F_FE_DATA_ERROR]);
if ($feSpecNative[$key][F_FE_LABEL_ALIGN] == F_FE_LABEL_ALIGN_DEFAULT) {
$feSpecNative[$key][F_FE_LABEL_ALIGN] = $formSpec[F_FE_LABEL_ALIGN];
}
}
return $feSpecNative;
......
......@@ -332,6 +332,9 @@ class Config {
SYSTEM_SECURITY_ATTACK_DELAY => SYSTEM_SECURITY_ATTACK_DELAY_DEFAULT,
SYSTEM_SECURITY_SHOW_MESSAGE => '0',
SYSTEM_SECURITY_GET_MAX_LENGTH => SYSTEM_SECURITY_GET_MAX_LENGTH_DEFAULT,
SYSTEM_LABEL_ALIGN => SYSTEM_LABEL_ALIGN_LEFT,
SYSTEM_ESCAPE_TYPE_DEFAULT => TOKEN_ESCAPE_MYSQL,
SYSTEM_EXTRA_BUTTON_INFO_INLINE => '<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>',
SYSTEM_EXTRA_BUTTON_INFO_BELOW => '<span class="glyphicon glyphicon-info-sign text-info" aria-hidden="true"></span>',
......
......@@ -240,6 +240,9 @@ VALUES
(1, 'showButton', 'Show button', 'show', 'checkbox', 'all', 'native', 220, 0, 5,
'<a href="{{documentation:Y}}#showbutton">Info</a>', '', '', '', 'checkBoxMode = multi\norientation=vertical', 3, '',
'', '', 'specialchar', 'no', ''),
(1, 'labelAlign', 'Label Align', 'show', 'radio', 'alnumx', 'native', 225, 0, 5,
'<a href="{{documentation:Y}}#definition">Info</a>', '', '', '', 'buttonClass', 3, '',
'', '', 'specialchar', 'no', ''),
(1, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 230, '40,8', 0,
'<a href="{{documentation:Y}}#form-parameter">Info</a>', '', '', '', '', 3, '', '', '', 'none', 'no', ''),
(1, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 240, 0, 0,
......@@ -316,8 +319,7 @@ VALUES
(101, 2, 'check_order', 'Check & Order', 'show', 'pill', 'all', 'container', 290, 0, '', '', '', '', '', 0, '',
''),
(102, 2, 'layout', 'Layout', 'show', 'pill', 'all', 'container', 390, 0, '', '', '', '', '', 0, '', ''),
(103, 2, 'value', 'Value', 'show', 'pill', 'all', 'container', 490, 0, '', '', '', '', '', 0, '', ''),
(104, 2, 'info', 'Info', 'show', 'pill', 'all', 'container', 590, 0, '', '', '', '', '', 0, '', '');
(103, 2, 'value', 'Value', 'show', 'pill', 'all', 'container', 490, 0, '', '', '', '', '', 0, '', '');
INSERT INTO FormElement (formId, name, label, mode, type, checkType, class, ord, size, maxLength, note, clientJs, value,
sql1, parameter, feIdContainer, subrecordOption, dynamicUpdate, bsLabelColumns, bsInputColumns,
......@@ -371,6 +373,7 @@ VALUES
(2, 'parameterLanguageD', 'Language: {{formLanguageDLabel:YE}}', 'show', 'text', 'all', 'native', 210, '60,2', 0,
'<a href="{{documentation:Y}}#multi-language-form">Info</a>', '', '', '', '', 100, '', 'no', '', '', '',
'{{SELECT IF("{{formLanguageDId:YE}}"="","hidden","show" ) }}', '', 'none'),
(2, 'encode', 'Encode', 'show', 'radio', 'all', 'native', 300, 0, 0,
'<a href="{{documentation:Y}}#field-encode">Info</a>', '', '', '', 'buttonClass=btn-default', 101, '', 'no', '', '',
'', '', '', 'specialchar'),
......@@ -389,7 +392,13 @@ VALUES
(2, 'tabindex', 'tabindex', 'show', 'text', 'all', 'native', 350, 0, 0,
'<a href="{{documentation:Y}}#field-tabindex">Info</a>', '', '', '', '', 101, '', 'no', '', '', '', '', '',
'specialchar'),
(2, 'size', 'Size', 'show', 'text', 'all', 'native', 400, 0, 0, '<a href="{{documentation:Y}}#field-size">Info</a>', '',
(2, 'adminNote', 'Internal Note', 'show', 'text', 'all', 'native', 360, '60,4', 0, '', '', '', '', '', 101, '', 'no', '', '',
'', '', '', 'specialchar'),
(2, 'labelAlign', 'Label Align', 'show', 'radio', 'all', 'native', 400, 0, 0,
'<a href="{{documentation:Y}}#class-native">Info</a>', '', '', '', 'buttonClass=btn-default', 102, '', 'no', '', '',
'', '', '', 'specialchar'),
(2, 'size', 'Size', 'show', 'text', 'all', 'native', 405, 0, 0, '<a href="{{documentation:Y}}#field-size">Info</a>', '',
'', '', '', 102, '', 'no', '', '', '', '', '', 'specialchar'),
(2, 'bsLabelColumns', 'BS Label Columns', 'show', 'text', 'all', 'native', 410, 0, 0,
'<a href="{{documentation:Y}}#field-bslabelcolumns">Info</a>', '', '', '', '', 102, '', 'no', '', '', '', '',
......@@ -415,6 +424,7 @@ VALUES
'<a href="{{documentation:Y}}#field-tooltip">Info</a>', '', '', '', '', 102, '', 'no', '', '', '', '', '', 'none'),
(2, 'placeholder', 'Placeholder', 'show', 'text', 'all', 'native', 480, 0, 0,
'<a href="{{documentation:Y}}#field-placeholder">Info</a>', '', '', '', '', 102, '', 'no', '', '', '', '', '', 'none'),
(2, 'value', 'value', 'show', 'text', 'all', 'native', 500, '40,2', 0,
'<a href="{{documentation:Y}}#field-value">Info</a>', '', '', '', '', 103, '', 'no', '', '', '', '', '', 'none'),
(2, 'sql1', 'sql1', 'show', 'text', 'all', 'native', 510, '40,5', 0,
......@@ -422,11 +432,7 @@ VALUES
'', '', '', '', 103, '', 'no', '', '', '', '', '', 'none'),
(2, 'parameter', 'Parameter', 'show', 'text', 'all', 'native', 520, '40,8', 0,
'<a href="{{documentation:Y}}#fe-parameter-attributes">Info</a>',
'', '', '', '', 103, '', 'no', '', '', '', '', '', 'none'),
(2, 'adminNote', 'Admin Note', 'show', 'text', 'all', 'native', 600, 0, 0, '', '', '', '', '', 104, '', 'no', '', '',
'', '', '', 'specialchar'),
(2, 'feGroup', 'feGroup', 'show', 'text', 'all', 'native', 610, 0, 0, '', '', '', '', '', 104, '', 'no', '', '', '',
'', '', 'specialchar');
'', '', '', '', 103, '', 'no', '', '', '', '', '', 'none');
INSERT INTO `FormElement` (`id`, `formId`, `feIdContainer`, `dynamicUpdate`, `enabled`, `name`, `label`, `mode`,
`modeSql`, `class`, `type`, `subrecordOption`, `encode`, `checkType`, `checkPattern`,
......
......@@ -400,6 +400,7 @@ class StoreTest extends TestCase {
'DB_3_NAME' => '<DB>',
'LDAP_1_RDN' => 'LDAP_1_RDN',
'LDAP_1_PASSWORD' => 'LDAP_1_PASSWORD',
SYSTEM_LABEL_ALIGN => SYSTEM_LABEL_ALIGN_LEFT,
];
$body = <<< EOT
......
......@@ -139,6 +139,9 @@ cssClassColumnId = text-muted
# cat=form-layout/layout; type=string; label=FormElement label align:Default is 'left'. Possible values: 'left', 'center', 'right'.
labelAlign = left
# cat=form-layout/layout; type=string; label=CSS class QFQ container:Default is empty. Empty, if the page content is already wrapped in a Bootstrap container. Else 'container'.
cssClassQfqContainer =
......
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