[TASK] impexp: Streamline position and layout of CSH 86/55386/6
authorFrank Naegler <frank.naegler@typo3.org>
Wed, 17 Jan 2018 18:54:26 +0000 (19:54 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 18 Jan 2018 14:01:52 +0000 (15:01 +0100)
This patch streamlines the position and layout for the content help buttons
in ext:impexp. Like already done in FormEngine, the CSH now wraps
around field labels.

Resolves: #83602
Releases: master
Change-Id: Iccfdd8f26649176004a17967d7a05d6f76c6d021
Reviewed-on: https://review.typo3.org/55386
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php
typo3/sysext/impexp/Resources/Private/Partials/Export/AdvancedOptions.html
typo3/sysext/impexp/Resources/Private/Partials/Export/Configuration.html
typo3/sysext/impexp/Resources/Private/Partials/Export/Save.html
typo3/sysext/impexp/Resources/Private/Partials/Import/Import.html
typo3/sysext/impexp/Resources/Private/Partials/Import/Upload.html

index 6cd6a52..1b6fba5 100644 (file)
@@ -39,6 +39,15 @@ use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
  * <output>
  * CSH button as known from the TYPO3 backend with some custom settings.
  * </output>
+ *
+ * <code title="Full configuration with content">
+ * <f:be.buttons.csh table="xMOD_csh_corebe" field="someCshKey">
+ *   some text to link
+ * </f:be.buttons.csh>
+ * </code>
+ * <output>
+ * A link with text "some text to link" to link the help
+ * </output>
  */
 class CshViewHelper extends AbstractBackendViewHelper
 {
@@ -93,6 +102,11 @@ class CshViewHelper extends AbstractBackendViewHelper
             $moduleName = $currentRequest->getPluginName();
             $table = '_MOD_' . $moduleName;
         }
+        $content = (string)$renderChildrenClosure();
+        if ($content !== '') {
+            return BackendUtility::wrapInHelp($table, $field, $content);
+        }
+
         return '<div class="docheader-csh">' . BackendUtility::cshItem($table, $field, '', $wrap) . '</div>';
     }
 }
index df4524d..deb86f0 100644 (file)
@@ -1,11 +1,10 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
 <h4><f:translate key="makeadvanc_softReferences" /></h4>
 <div class="form-group">
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="htmlCssResources"><f:translate key="makeadvanc_excludeHtmlCssFile" /></f:be.buttons.csh>
        <label for="checkExcludeHTMLfileResources">
                <f:form.checkbox name="tx_impexp[excludeHTMLfileResources]" id="checkExcludeHTMLfileResources" value="1" checked="{inData.excludeHTMLfileResources} == 1" />
-               <f:translate key="makeadvanc_excludeHtmlCssFile" />
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="htmlCssResources" />
 </div>
 <h4><f:translate key="makeadvanc_files" /></h4>
 <div class="form-group">
 </div>
 <h4><f:translate key="makeadvanc_extensionDependencies" /></h4>
 <div class="form-group">
-       <label for="extensionDependencies">
-               <f:translate key="makeadvanc_selectExtensionsThatThe" />
+       <label>
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="extensionDependencies"><f:translate key="makeadvanc_selectExtensionsThatThe" /></f:be.buttons.csh>
        </label>
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="extensionDependencies" />
-               <f:form.select class="form-control" name="tx_impexp[extension_dep]" multiple="multiple"
+       <f:form.select class="form-control" name="tx_impexp[extension_dep]" multiple="multiple"
                                                                         size="{f:if(condition: '{extensions -> f:count()} > 9', then: '10', else: '5')}"
-                                                                        options="{extensions}" value="{inData.extension_dep}" id="extensionDependencies"/>
+                                                                        options="{extensions}" value="{inData.extension_dep}"/>
 </div>
 <div class="form-group">
        <f:form.submit class="btn btn-default" value="{f:translate(key: 'makesavefo_update')}" />
index 5a6b268..38c937a 100644 (file)
@@ -1,7 +1,6 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
 <h3>
-       <f:translate key="makeconfig_exportPagetreeConfiguration" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeCfg" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeCfg"><f:translate key="makeconfig_exportPagetreeConfiguration" /></f:be.buttons.csh>
 </h3>
 <div class="row">
        <div class="col-sm-2">
@@ -15,8 +14,7 @@
 <div class="row">
        <div class="col-sm-2">
                <label class="control-label">
-                       <f:translate key="makeconfig_tree" />
-                       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeDisplay" />
+                       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeDisplay"><f:translate key="makeconfig_tree" /></f:be.buttons.csh>
                </label>
        </div>
        <div class="col-sm-10">
        </div>
 </div>
 <div class="form-group">
-       <label for="impexp-pagetree-levels">
-               <f:translate key="makeconfig_levels" />
+       <label>
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeMode"><f:translate key="makeconfig_levels" /></f:be.buttons.csh>
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeMode" />
-       <f:form.select class="form-control" name="tx_impexp[pagetree][levels]" id="impexp-pagetree-levels" options="{levelSelectOptions}" value="{inData.pagetree.levels}" />
+       <f:form.select class="form-control" name="tx_impexp[pagetree][levels]" options="{levelSelectOptions}" value="{inData.pagetree.levels}" />
 </div>
 <div class="form-group">
-       <label for="impexp-pagetree-includetables">
-               <f:translate key="makeconfig_includeTables" />
+       <label>
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeRecordLimit"><f:translate key="makeconfig_includeTables" /></f:be.buttons.csh>
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="pageTreeRecordLimit"/>
-       <f:form.select class="form-control" name="tx_impexp[pagetree][tables]" id="impexp-pagetree-includetables"
+       <f:form.select class="form-control" name="tx_impexp[pagetree][tables]"
                                                                 options="{tableSelectOptions}" multiple="multiple" value="{inData.pagetree.tables}"
                                                                 size="{f:if(condition: '{tableSelectOptions -> f:count()} > 9', then: '10', else: '5')}" />
 </div>
 <f:if condition="{records -> f:count()} > 0">
        <h4>
-               <f:translate key="makeconfig_exportSingleRecord" />
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="singleRecord" />
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="singleRecord"><f:translate key="makeconfig_exportSingleRecord" /></f:be.buttons.csh>
        </h4>
        <div class="row">
                <div class="col-sm-2">
@@ -66,8 +61,7 @@
        <div class="row">
                <div class="col-sm-2">
                        <label>
-                               <f:translate key="makeconfig_tablePids" />
-                               <f:be.buttons.csh table="xMOD_tx_impexp" field="tableList" />
+                               <f:be.buttons.csh table="xMOD_tx_impexp" field="tableList"><f:translate key="makeconfig_tablePids" /></f:be.buttons.csh>
                        </label>
                </div>
                <div class="col-sm-10">
 </f:if>
 <h4><f:translate key="makeconfig_relationsAndExclusions" /></h4>
 <div class="form-group">
-       <label for="impexp-externalref-tables">
-               <f:translate key="makeconfig_includeRelationsToTables" />
+       <label>
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="inclRelations"><f:translate key="makeconfig_includeRelationsToTables" /></f:be.buttons.csh>
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="inclRelations" />
-       <f:form.select class="form-control" name="tx_impexp[external_ref][tables]" id="impexp-externalref-tables"
+       <f:form.select class="form-control" name="tx_impexp[external_ref][tables]"
                                                                 options="{externalReferenceTableSelectOptions}" multiple="multiple" value="{inData.external_ref.tables}"
                                                                 size="{f:if(condition: '{externalReferenceTableSelectOptions -> f:count()} > 9', then: '10', else: '5')}" />
 </div>
 <div class="form-group">
-       <label for="impexp-externalstatic-tables">
-               <f:translate key="makeconfig_useStaticRelationsFor" />
+       <label>
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="staticRelations"><f:translate key="makeconfig_useStaticRelationsFor" /></f:be.buttons.csh>
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="staticRelations" />
-       <f:form.select class="form-control" name="tx_impexp[external_static][tables]" id="impexp-externalstatic-tables"
+       <f:form.select class="form-control" name="tx_impexp[external_static][tables]"
                                                                 options="{externalStaticTableSelectOptions}" multiple="multiple" value="{inData.external_static.tables}"
                                                                 size="{f:if(condition: '{externalStaticTableSelectOptions -> f:count()} > 9', then: '10', else: '5')}" />
 </div>
 
 <div class="form-group">
        <label class="control-label">
-               <f:translate key="makeconfig_excludeElements" />
-               <f:be.buttons.csh table="xMOD_tx_impexp" field="excludedElements" />
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="excludedElements"><f:translate key="makeconfig_excludeElements" /></f:be.buttons.csh>
        </label>
        <p class="form-control-static">
                <f:if condition="{inData.exclude -> f:count()} > 0">
index d0e05f2..e2b37d4 100644 (file)
@@ -1,7 +1,6 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
 <h3>
-       <f:translate key="makesavefo_presets" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="presets" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="presets"><f:translate key="makesavefo_presets" /></f:be.buttons.csh>
 </h3>
 <div class="form-group">
        <label for="preset-select"><f:translate key="makesavefo_selectPreset" /></label>
@@ -41,8 +40,7 @@
 <h3><f:translate key="makesavefo_outputOptions" /></h3>
 
 <h4>
-       <f:translate key="makesavefo_metaData" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="metadata" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="metadata"><f:translate key="makesavefo_metaData" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <label for="meta-title"><f:translate key="makesavefo_title" /></label>
@@ -58,8 +56,7 @@
 </div>
 
 <h4>
-       <f:translate key="makesavefo_fileFormat" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="fileFormat" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="fileFormat"><f:translate key="makesavefo_fileFormat" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <f:form.select class="form-control" name="tx_impexp[filetype]" options="{filetypeSelectOptions}" value="{inData.filetype}" />
index 5d18ba0..d89f6ee 100644 (file)
@@ -2,9 +2,8 @@
 <h3><f:translate key="importdata_selectFileToImport" /></h3>
 <div class="form-group">
        <label for="impexp-file">
-               <f:translate key="importdata_file" />
+               <f:be.buttons.csh table="xMOD_tx_impexp" field="importFile"><f:translate key="importdata_file" /></f:be.buttons.csh>
        </label>
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="importFile" />
        <f:form.select name="tx_impexp[file]" class="form-control" id="impexp-file" value="{inData.file}" options="{fileSelectOptions}" />
        <p class="help-block">{importPath}</p>
        <f:if condition="{import.compress}">
@@ -14,8 +13,7 @@
 <h3><f:translate key="importdata_importOptions" /></h3>
 
 <h4>
-       <f:translate key="importdata_update" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="update" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="update"><f:translate key="importdata_update" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <label for="checkDo_update">
@@ -35,8 +33,7 @@
 </f:if>
 
 <h4>
-       <f:translate key="importdata_options" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="options" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="options"><f:translate key="importdata_options" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <label for="checkNotShowDiff">
@@ -68,8 +65,7 @@
 </f:if>
 
 <h4>
-       <f:translate key="importdata_action" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="action" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="action"><f:translate key="importdata_action" /></f:be.buttons.csh>
 </h4>
 <f:if condition="{inData.import_file}">
        <f:then>
 <f:form.hidden name="tx_impexp[action]" value="import" />
 
 <h4>
-       <f:translate key="importdata_enableLogging" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="enableLogging" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="enableLogging"><f:translate key="importdata_enableLogging" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <label for="checkEnableLogging">
index b69b578..70e245c 100644 (file)
@@ -1,8 +1,7 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" data-namespace-typo3-fluid="true">
 <h3><f:translate key="importdata_uploadFileFromLocal" /></h3>
 <h4>
-       <f:translate key="importdata_browse" />
-       <f:be.buttons.csh table="xMOD_tx_impexp" field="upload" />
+       <f:be.buttons.csh table="xMOD_tx_impexp" field="upload"><f:translate key="importdata_browse" /></f:be.buttons.csh>
 </h4>
 <div class="form-group">
        <f:form.upload name="upload_1" />