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

Merge branch 'FE_Label-text-align_right' into 'master'

Fe label text align right

See merge request !119
parents 56a73251 f16b553e
Pipeline #1362 passed with stage
in 2 minutes and 3 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, |
......@@ -3108,7 +3114,7 @@ the server, the lookup will be performed and the result, upto *typeAheadLimit* e
* *FormElement.parameter*:
* *typeAheadLimit* = <number>. Max numbers of result records to be shown. Default is 20.
* *typeAheadMinLength* = <number>. Minimum length to type before the first lookup starts.
* *typeAheadMinLength* = <number>. Minimum length to type before the first lookup starts. Default is 2.
Depending of the `typeahead` setup, the given FormElement will contain the displayed `value` or `id` (if an id/value dict is
configured).
......@@ -3171,10 +3177,18 @@ Type: editor
* To deactivate the surrouding `<p>` tag, configure in *FormElement.parameter*::
editor-forced_root_block=false
editor-forced_root_block = false
This might have impacts on the editor. See https://www.tinymce.com/docs/configure/content-filtering/#forced_root_block
* Set 'extended_valid_elements' to enable HTML tags and their attributes. Example: ::
editor-extended_valid_elements = span[class|style]
* Set 'editor-content_css' to use a custom CSS to style elements inside the editor. Example: ::
editor-content_css = fileadmin/custom.css
* *FormElement.size* = <min_height>,<max_height>: in pixels, including top and bottom bars. E.g.: 300,600
......@@ -3412,10 +3426,14 @@ will be rendered inside the form as a HTML table.
* *Constant '&'*: Indicate a 'constant' value. E.g. `&12:xId` or `{{...}}` (all possibilities, incl. further SELECT
statements) might be used.
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-subrecord-table'. If given, the default will be overwritten.
This parameter is helpful if you want to add tablesorting to your subrecord - example: ::
* *subrecordTableClass*: Optional. Default: 'table table-hover qfq-subrecord-table'. If given, the default will be
overwritten. Example: ::
subrecordTableClass = table table-hover qfq-subrecord-table qfq-table-50
subrecordTableClass = table table-hover qfq-subrecord-table tablesorter tablesorter-pager
* Tablesorter in Subrecord:
subrecordTableClass = table table-hover qfq-subrecord-table tablesorter tablesorter-pager tablesorter-filter
* *subrecordColumnTitleEdit*: Optional. Will be rendered as the column title for the new/edit column.
* *subrecordColumnTitleDelete*: Optional. Will be rendered as the column title for the delete column.
......@@ -7586,13 +7604,35 @@ Tip on Report: In case the query did not contain any double ticks, just wrap all
Buggy query: 10.sql = SELECT id, ... FROM myTable WHERE status={{myVar}} ORDER BY status
Debug query: 10.sql = SELECT "id, ... FROM myTable WHERE status={{myVar}} ORDER BY status"
Error read file config.qfq.php: syntax error on line xx
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Check the given line number. If it's a SQL statement, enclose it in single or double ticks.
Output a text, substitute embedded QFQ variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The content will be copied to '_text'. In `10.tail` than the '{{text:R}}' will be substituted with all known variables.
Note the '-' in '{{text:RE::-}}', this will prevent that QFQ escapes any character from the content. ::
10 {
sql = SELECT no.text AS _text
FROM Note AS no
WHERE id=...
tail = {{text:RE::-}}
}
TypeAhead list with T3 page alias names - use of the T3 DB
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To define a typeahead list of T3 page alias names: ::
FE.type = text
FE.parameter.typeAheadSql = SELECT p.alias FROM {{dbNameT3:Y}}.pages AS p WHERE p.deleted=0 AND p.alias!='' AND p.alias LIKE ? ORDER BY p.alias LIMIT 20
FE.parameter.typeAheadMinLength = 1
Logging
-------
......
......@@ -1055,7 +1055,7 @@ abstract class AbstractBuildForm {
/**
* Set corresponding JSON attributes readonly/required/disabled, based on $formElement[FE_MODE].
*
* @param array $feMode
* @param string $feMode
*
* @return array
* @throws UserFormException
......
......@@ -451,7 +451,7 @@ class BuildFormBootstrap extends AbstractBuildForm {
* @throws UserFormException
* @throws UserReportException
*/
private function buildPillNavigation($mode , array $pillArray, array &$json) {
private function buildPillNavigation($mode, array $pillArray, array &$json) {
$pillButton = '';
$pillDropdown = '';
$htmlDropdown = '';
......@@ -697,7 +697,7 @@ EOF;
public function buildPill(array $formElement, $htmlFormElementName, $value, array &$json) {
$html = '';
if($formElement[FE_MODE]==FE_MODE_HIDDEN){
if ($formElement[FE_MODE] == FE_MODE_HIDDEN) {
return '';
}
......@@ -779,7 +779,7 @@ EOF;
* @param string $htmlElement Content to wrap.
* @param string $wrapName FE_WRAP_ROW, FE_WRAP_LABEL, FE_WRAP_INPUT, FE_WRAP_NOTE
* @param int $bsColumns
* @param array $wrapArray Systemwide Defaults: [ 'open wrap', 'close wrap' ]
* @param array $wrapArray System wide Defaults: [ 'open wrap', 'close wrap' ]
* @param string $htmlId
* @param string $class
*
......@@ -807,6 +807,9 @@ EOF;
if ($wrapArray[0] != '') {
$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: ' . $formElement[F_FE_LABEL_ALIGN].';'); // might be problematic, if there is already a 'class' defined.
}
}
return $wrapArray[0] . $htmlElement . $wrapArray[1];
......
......@@ -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
......
......@@ -189,7 +189,7 @@ class QuickFormQuery {
$updateDb = new DatabaseUpdate($this->dbArray[$this->dbIndexQfq]);
$updateDb->checkNupdate($dbUpdate);
$this->store->StoreSystemUpdate(); // Do this after the DB-update
$this->store->FillStoreSystemBySql(); // Do this after the DB-update
// Set dbIndex, evaluate any
$dbIndex = $this->store->getVar(TOKEN_DB_INDEX, STORE_TYPO3 . STORE_EMPTY);
......@@ -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])) {
......
......@@ -132,6 +132,12 @@ $UPDATE_ARRAY = array(
"ALTER TABLE `MailLog` ADD `cc` TEXT NOT NULL AFTER `receiver`, ADD `bcc` TEXT NOT NULL AFTER `cc`;",
],
'19.1.2' => [
"ALTER TABLE `Form` ADD `labelAlign` ENUM('default','left','center','right') NOT NULL DEFAULT 'default' AFTER `forwardPage`;",
"ALTER TABLE `FormElement` ADD `labelAlign` ENUM('default','left','center','right') NOT NULL DEFAULT 'default' AFTER `maxLength`;",
],
);
......
......@@ -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>',
......
......@@ -171,7 +171,7 @@ class Store {
STORE_ADDITIONAL_FORM_ELEMENTS => false,
];
self::fillStoreTypo3($bodytext); // should be filled before fillStoreSystem() to offer T3 variables
self::fillStoreTypo3($bodytext); // should be filled before fillStoreSystem() to offer T3 variables, especially 'feUser'
self::fillStoreClient(); // should be filled before fillStoreSystem() to offer Client variables
self::fillStorePhpSession(STORE_EXTRA); // should be filled before fillStoreSystem() to restore variables like SYSTEM_SHOW_DEBUG_INFO
self::fillStorePhpSession(STORE_USER); // should be filled before fillStoreSystem() to restore variables like SYSTEM_SHOW_DEBUG_INFO
......@@ -921,7 +921,7 @@ class Store {
* @throws UserFormException
* @throws UserReportException
*/
public static function StoreSystemUpdate() {
public static function FillStoreSystemBySql() {
$db = null;
$flagDirty = false;
......
This diff is collapsed.
......@@ -303,16 +303,16 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
unset($formElement[FE_EMPTY_ITEM_AT_START]);
// SQL (4 columns, none 'id' nor 'label') - Take the first two columns
$expectKeys = ['100', '400', '200'];
$expectValues = ['basic', 'access', 'various'];
$expectKeys = ['100', '200', '300'];
$expectValues = ['basic', 'formelement', 'layout'];
$formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT ord, name, created, modified FROM FormElement AS fe ORDER BY fe.id LIMIT 3');
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expectKeys, $keys);
$this->assertEquals($expectValues, $values);
// SQL (4 columns, none 'id', one 'label' ) - Take the first and the fourth two columns
$expectKeys = ['100', '400', '200'];
$expectValues = ['basic', 'access', 'various'];
$expectKeys = ['100', '200', '300'];
$expectValues = ['basic', 'formelement', 'layout'];
$formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT ord, created, modified, name AS label FROM FormElement AS fe ORDER BY fe.id LIMIT 3');
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expectKeys, $keys);
......@@ -320,7 +320,7 @@ class BuildFormPlainTest extends AbstractDatabaseTest {
// SQL (4 columns, none 'id', one 'label' ) - Take the first and the fourth two columns
$expectKeys = ['1', '2', '3'];
$expectValues = ['basic', 'access', 'various'];
$expectValues = ['basic', 'formelement', 'layout'];
$formElement['sql1'] = $this->dbArray[DB_INDEX_DEFAULT]->sql('SELECT ord, created, modified, name AS label, id FROM FormElement AS fe ORDER BY fe.id LIMIT 3');
$build->getKeyValueListFromSqlEnumSpec($formElement, $keys, $values);
$this->assertEquals($expectKeys, $keys);
......
......@@ -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