The markup generated by the UserStorageCapabilityService is now
in line with the overall styling of checkboxes in TCA.
Resolves: #83810
Releases: master
Change-Id: I59bb480587bf30e054b855370e33e3d2dbfdfa91
Reviewed-on: https://review.typo3.org/55615
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
* 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;
*/
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');
+
- <div class="t3-form-field-item">
- <div class="checkbox">
- <label>
- <input name="data[sys_file_storage][{uid}][is_public]" value="0" type="hidden">
- <input class="checkbox" value="1" name="data[sys_file_storage][{uid}][is_public]_0" type="checkbox" %s>
- </label>
- </div>
- </div>';
+ <div class="checkbox checkbox-type-icon-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">
+ <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"> </span>
+ </label>
+ <input type="hidden" name="data[sys_file_storage][{uid}][is_public]" value="1">
+ </div>
+ ';
$content = sprintf(
$template,
$content = sprintf(
$template,