[TASK] Change checkboxes in sys_file_storage 56/56756/7
authorIngo Nolden <dev@nolden.org>
Fri, 20 Apr 2018 14:04:29 +0000 (16:04 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 27 Apr 2018 15:45:53 +0000 (17:45 +0200)
Some checkboxes are changed to new rendertype checkboxToggle.
One checkbox is type => user and the rendering is adapted
in the userFunc.

Resolves: #84813
Related: #84793
Release: master
Change-Id: Id61ee825d2bcf026ef39427bfdded88c90245cd1
Reviewed-on: https://review.typo3.org/56756
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
typo3/sysext/core/Classes/Resource/Service/UserStorageCapabilityService.php
typo3/sysext/core/Configuration/TCA/sys_file_storage.php

index 48e0d4a..db2fb58 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Core\Resource\Service;
  * The TYPO3 project - inspiring people to share!
  */
 
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Imaging\Icon;
-use TYPO3\CMS\Core\Imaging\IconFactory;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
 use TYPO3\CMS\Core\Localization\LanguageService;
 use TYPO3\CMS\Core\Messaging\FlashMessage;
 use TYPO3\CMS\Core\Messaging\FlashMessageQueue;
@@ -89,18 +87,10 @@ class UserStorageCapabilityService
      */
     protected function renderFileInformationContent(array $fileRecord, $isPublic)
     {
      */
     protected function renderFileInformationContent(array $fileRecord, $isPublic)
     {
-        $iconFactory = GeneralUtility::makeInstance(IconFactory::class);
-        $iconChecked = $iconFactory->getIcon('actions-check', Icon::SIZE_SMALL)->render('inline');
-        $iconUnchecked = $iconFactory->getIcon('empty-empty', Icon::SIZE_SMALL)->render('inline');
-
         $template = '
         $template = '
-        <div class="checkbox checkbox-type-icon-toggle">
+        <div class="checkbox checkbox-type-toggle">
                 <input type="checkbox" id="filestorage-ispublic" onclick="document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value=this.checked?(document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value|1):(document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value&0);TBE_EDITOR.fieldChanged(\'sys_file_storage\',\'{uid}\',\'is_public\',\'data[sys_file_storage][{uid}][is_public]\');" class="checkbox-input" value="1" name="data[sys_file_storage][{uid}][is_public]_0" %s />
                 <label class="checkbox-label" for="filestorage-ispublic">
                 <input type="checkbox" id="filestorage-ispublic" onclick="document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value=this.checked?(document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value|1):(document.editform[\'data[sys_file_storage][{uid}][is_public]\'].value&0);TBE_EDITOR.fieldChanged(\'sys_file_storage\',\'{uid}\',\'is_public\',\'data[sys_file_storage][{uid}][is_public]\');" class="checkbox-input" value="1" name="data[sys_file_storage][{uid}][is_public]_0" %s />
                 <label class="checkbox-label" for="filestorage-ispublic">
-                    <span class="checkbox-label-icon">
-                        <span class="checkbox-label-icon-checked">' . $iconChecked . '</span>
-                        <span class="checkbox-label-icon-unchecked">' . $iconUnchecked . '</span>
-                    </span>
                     <span class="checkbox-label-text">&nbsp;</span>
                 </label>
                 <input type="hidden" name="data[sys_file_storage][{uid}][is_public]" value="1">
                     <span class="checkbox-label-text">&nbsp;</span>
                 </label>
                 <input type="hidden" name="data[sys_file_storage][{uid}][is_public]" value="1">
index fc44fbc..dabadc2 100644 (file)
@@ -41,18 +41,32 @@ return [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_browsable',
             'config' => [
                 'type' => 'check',
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_browsable',
             'config' => [
                 'type' => 'check',
-                'default' => 1
+                'renderType' => 'checkboxToggle',
+                'default' => 1,
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                    ]
+                ],
             ]
         ],
         'is_default' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_default',
             'config' => [
                 'type' => 'check',
             ]
         ],
         'is_default' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_default',
             'config' => [
                 'type' => 'check',
+                'renderType' => 'checkboxToggle',
                 'default' => 0,
                 'eval' => 'maximumRecordsChecked',
                 'validation' => [
                     'maximumRecordsChecked' => 1
                 'default' => 0,
                 'eval' => 'maximumRecordsChecked',
                 'validation' => [
                     'maximumRecordsChecked' => 1
-                ]
+                ],
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                    ]
+                ],
             ]
         ],
         'is_public' => [
             ]
         ],
         'is_public' => [
@@ -67,21 +81,42 @@ return [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_writable',
             'config' => [
                 'type' => 'check',
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_writable',
             'config' => [
                 'type' => 'check',
-                'default' => 1
+                'renderType' => 'checkboxToggle',
+                'default' => 1,
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                    ]
+                ],
             ]
         ],
         'is_online' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_online',
             'config' => [
                 'type' => 'check',
             ]
         ],
         'is_online' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.is_online',
             'config' => [
                 'type' => 'check',
-                'default' => 1
+                'renderType' => 'checkboxToggle',
+                'default' => 1,
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                    ]
+                ],
             ]
         ],
         'auto_extract_metadata' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.auto_extract_metadata',
             'config' => [
                 'type' => 'check',
             ]
         ],
         'auto_extract_metadata' => [
             'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:sys_file_storage.auto_extract_metadata',
             'config' => [
                 'type' => 'check',
-                'default' => 1
+                'renderType' => 'checkboxToggle',
+                'default' => 1,
+                'items' => [
+                    [
+                        0 => '',
+                        1 => '',
+                    ]
+                ],
             ]
         ],
         'processingfolder' => [
             ]
         ],
         'processingfolder' => [