Commit 30ec991b authored by Carsten  Rose's avatar Carsten Rose
Browse files

#3414 - Gesamtes Form schmaller machen - das gesamte Form in ein 'col-md-XX' wrappen

Manual.rst: Update Doc for new option 'bsColumns'
Config.php: Copy new element from general config.
Store.php: set default for 'bsColumns'.
QuickFormQuery.php: wrap whole form in 'col-md-XX'
parent e1492bc6
......@@ -203,6 +203,14 @@ config.qfq.ini
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_DATA_ERROR |FORM_DATA_ERROR=generic error | Customizable error message used in validator.js. 'no specific' given |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BS_COLUMNS | FORM_BS_COLUMNS=12 | The whole form will be wrapped in 'col-md-??'. Default is 12 for 100% |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BS_LABEL_COLUMNS | FORM_BS_LABEL_COLUMNS = 3 | Default number of BS columns for the 'label'-column |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BS_INPUT_COLUMNS | FORM_BS_INPUT_COLUMNS = 6 | Default number of BS columns for the 'input'-column |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BS_NOTE_COLUMNS | FORM_BS_NOTE_COLUMNS = 3 | Default number of BS columns for the 'note'-column |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| FORM_BUTTON_ON_CHANGE_CLASS | FORM_BUTTON_ON_CHANGE_CLASS=alert-info btn-info | Color for save button after modification |
+-----------------------------+-----------------------------------------+----------------------------------------------------------------------------+
| BASE_URL_PRINT | BASE_URL_PRINT=http://example.com | URL where wkhtmltopdf will fetch the HTML (no parameter, those comes later)|
......@@ -229,10 +237,12 @@ Example: *typo3conf/config.qfq.ini*
;CSS_CLASS_QFQ_FORM =
CSS_CLASS_QFQ_FORM_PILL = qfq-color-grey-1
CSS_CLASS_QFQ_FORM_BODY = qfq-color-grey-2
;DATE_FORMAT= yyyy-mm-dd
;FORM_DATA_PATTERN_ERROR =
;FORM_DATA_REQUIRED_ERROR =
;FORM_DATA_MATCH_ERROR =
;FORM_DATA_ERROR =
;FORM_BS_COLUMNS = 12
;FORM_BS_LABEL_COLUMNS = 3
;FORM_BS_INPUT_COLUMNS = 6
;FORM_BS_NOTE_COLUMNS = 3
......@@ -739,6 +749,8 @@ Store: *SYSTEM* - Y
+-------------------------+--------------------------------------------------------------------------+
| data-error | defined in config.ini or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsColumns | defined in config.ini (FORM_BS_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsLabelColumns | defined in config.ini (FORM_BS_LABEL_COLUMNS) or form definition |
+-------------------------+--------------------------------------------------------------------------+
| bsInputColumns | defined in config.ini (FORM_BS_INPUT_COLUMNS) or form definition |
......@@ -994,6 +1006,8 @@ parameter
+--------------------------+--------+----------------------------------------------------------------------------------------------------------+
| Name | Type | Description |
+==========================+========+==========================================================================================================+
| bsColumns | int | Wrap the whole form in '<div class="col-md-??"> |
+--------------------------+--------+----------------------------------------------------------------------------------------------------------+
| maxVisiblePill | int | Show pills upto <maxVisiblePill> as button, all further in a drop-down menu. Eg.: maxVisiblePill=3 |
+--------------------------+--------+----------------------------------------------------------------------------------------------------------+
| class | string | HTML div with given class, surrounding the whole form. Eg.: class=container-fluid |
......
......@@ -38,6 +38,8 @@ const FORM_FORWARD_MODE_NO = 'no';
const FORM_FORWARD_MODE_AUTO = 'auto';
const FORM_FORWARD_MODE_PAGE = 'page';
const F_BS_COLUMNS = 'bsColumns';
const F_BS_LABEL_COLUMNS = 'bsLabelColumns';
const F_BS_INPUT_COLUMNS = 'bsInputColumns';
const F_BS_NOTE_COLUMNS = 'bsNoteColumns';
......@@ -322,6 +324,8 @@ const SYSTEM_FORM_DATA_REQUIRED_ERROR = 'FORM_DATA_REQUIRED_ERROR';
const SYSTEM_FORM_DATA_MATCH_ERROR = 'FORM_DATA_MATCH_ERROR';
const SYSTEM_FORM_DATA_ERROR = 'FORM_DATA_ERROR';
const SYSTEM_FORM_BS_COLUMNS = 'FORM_BS_COLUMNS';
const SYSTEM_FORM_BS_LABEL_COLUMNS = 'FORM_BS_LABEL_COLUMNS';
const SYSTEM_FORM_BS_INPUT_COLUMNS = 'FORM_BS_INPUT_COLUMNS';
const SYSTEM_FORM_BS_NOTE_COLUMNS = 'FORM_BS_NOTE_COLUMNS';
......
......@@ -283,6 +283,14 @@ class QuickFormQuery {
$formAction = new FormAction($this->formSpec, $this->db, $this->phpUnit);
switch ($formMode) {
case FORM_LOAD:
$formAction->elements($recordId, $this->feSpecAction, FE_TYPE_BEFORE_LOAD);
$data = $build->process($formMode);
$data = Support::wrapTag("<div class='" . 'col-md-' . $this->formSpec[F_BS_COLUMNS] . "'>", $data);
$data = Support::wrapTag("<div class='row'>", $data);
$formAction->elements($recordId, $this->feSpecAction, FE_TYPE_AFTER_LOAD);
break;
case FORM_UPDATE:
$formAction->elements($recordId, $this->feSpecAction, FE_TYPE_BEFORE_LOAD);
......@@ -529,7 +537,8 @@ class QuickFormQuery {
*/
private function syncSystemFormConfig(array $formSpec) {
$keys = [F_BS_LABEL_COLUMNS,
$keys = [F_BS_COLUMNS,
F_BS_LABEL_COLUMNS,
F_BS_INPUT_COLUMNS,
F_BS_NOTE_COLUMNS,
F_FE_DATA_PATTERN_ERROR,
......
......@@ -55,6 +55,7 @@ class Config {
// oldname > newname
$setting = [
[SYSTEM_FORM_BS_COLUMNS, F_BS_COLUMNS],
[SYSTEM_FORM_BS_LABEL_COLUMNS, F_BS_LABEL_COLUMNS],
[SYSTEM_FORM_BS_INPUT_COLUMNS, F_BS_INPUT_COLUMNS],
[SYSTEM_FORM_BS_NOTE_COLUMNS, F_BS_NOTE_COLUMNS],
......
......@@ -190,6 +190,7 @@ class Store {
// Defaults
Support::setIfNotSet($config, SYSTEM_DATE_FORMAT, 'yyyy-mm-dd');
Support::setIfNotSet($config, SYSTEM_SHOW_DEBUG_INFO, 'auto');
Support::setIfNotSet($config, F_BS_COLUMNS, '12');
Support::setIfNotSet($config, F_BS_LABEL_COLUMNS, '3');
Support::setIfNotSet($config, F_BS_INPUT_COLUMNS, '6');
Support::setIfNotSet($config, F_BS_NOTE_COLUMNS, '3');
......
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