[TASK] Add argument wrap to CSH ViewHelper 41/46441/2
authorDaniel Goerz <ervaude@gmail.com>
Tue, 2 Feb 2016 09:11:42 +0000 (10:11 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Wed, 3 Feb 2016 21:29:34 +0000 (22:29 +0100)
Additionally a regression in filelist markup is fixed.

Change-Id: Ib0cb0dbfe4255dd575682f3305f445ab7bfb3359
Resolves: #73078
Releases: master, 7.6
Reviewed-on: https://review.typo3.org/46441
Reviewed-by: Claus Due <claus@phpmind.net>
Tested-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/filelist/Resources/Private/Templates/FileList/Index.html
typo3/sysext/fluid/Classes/ViewHelpers/Be/Buttons/CshViewHelper.php

index 6810eba..a1ba7a7 100644 (file)
@@ -47,7 +47,7 @@
                <f:if condition="{showClipBoard}">
                        {clipBoardHtml -> f:format.raw()}
 
-                       <span class="btn btn-sm btn-default"><f:be.buttons.csh table="xMOD_csh_corebe" field="filelist_clipboard" /></span>
+                       <f:be.buttons.csh table="xMOD_csh_corebe" field="filelist_clipboard" wrap="<span class='btn btn-sm btn-default'>|</span>" />
                </f:if>
        </f:if>
 </f:section>
index 4216547..aad40ac 100644 (file)
@@ -47,14 +47,16 @@ class CshViewHelper extends AbstractBackendViewHelper
      *
      * @param string $table Table name ('_MOD_'+module name). If not set, the current module name will be used
      * @param string $field Field name (CSH locallang main key)
+     * @param string $wrap Markup to wrap around the CSH, split by "|"
      * @return string the rendered CSH icon
      */
-    public function render($table = null, $field = '')
+    public function render($table = null, $field = '', $wrap = '')
     {
         return static::renderStatic(
             array(
                 'table' => $table,
                 'field' => $field,
+                'wrap' => $wrap
             ),
             $this->buildRenderChildrenClosure(),
             $this->renderingContext
@@ -71,12 +73,13 @@ class CshViewHelper extends AbstractBackendViewHelper
     {
         $table = $arguments['table'];
         $field = $arguments['field'];
+        $wrap = $arguments['wrap'];
 
         if ($table === null) {
             $currentRequest = $renderingContext->getControllerContext()->getRequest();
             $moduleName = $currentRequest->getPluginName();
             $table = '_MOD_' . $moduleName;
         }
-        return '<div class="docheader-csh">' . BackendUtility::cshItem($table, $field) . '</div>';
+        return '<div class="docheader-csh">' . BackendUtility::cshItem($table, $field, '', $wrap) . '</div>';
     }
 }