first commit

This commit is contained in:
salam committed 2026-10-06 19:40:28 +02:00
commit e81864e683
2984 files changed
+267797

No files matched your search

+395
View File
@@ -0,0 +1,395 @@
#####
#
# Example .htaccess file for TYPO3 CMS - for use with Apache Webserver
#
# This file includes settings for the following configuration options:
#
# - Compression
# - Caching
# - MIME types
# - Cross Origin requests
# - Rewriting and Access
# - Miscellaneous
# - PHP optimisation
#
# If you want to use it, you have to copy it to the root folder of your TYPO3 installation (if its
# not there already) and rename it to '.htaccess'. To make .htaccess files work, you might need to
# adjust the 'AllowOverride' directive in your Apache configuration file.
#
# IMPORTANT: You may need to change this file depending on your TYPO3 installation!
# Consider adding this file's content to your webserver's configuration directly for speed improvement
#
# Lots of the options are taken from https://github.com/h5bp/html5-boilerplate/blob/master/dist/.htaccess
#
####
### Begin: Compression ###
# Compressing resource files will save bandwidth and so improve loading speed especially for users
# with slower internet connections. TYPO3 can compress the .js and .css files for you.
# *) Uncomment the following lines and
# *) Set $GLOBALS['TYPO3_CONF_VARS']['BE']['compressionLevel'] = 9 for the Backend
# *) Set $GLOBALS['TYPO3_CONF_VARS']['FE']['compressionLevel'] = 9 together with the TypoScript properties
# config.compressJs and config.compressCss for GZIP compression of Frontend JS and CSS files.
#<FilesMatch "\.js\.gz">
# AddType "text/javascript" .gz
#</FilesMatch>
#<FilesMatch "\.css\.gz">
# AddType "text/css" .gz
#</FilesMatch>
#AddEncoding x-gzip .gz
<IfModule mod_deflate.c>
# Force compression for mangled `Accept-Encoding` request headers
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
# Compress all output labeled with one of the following media types.
#
# (!) For Apache versions below version 2.3.7 you don't need to
# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
# and `</IfModule>` lines as `AddOutputFilterByType` is still in
# the core directives.
#
# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE application/atom+xml \
application/javascript \
application/json \
application/ld+json \
application/manifest+json \
application/rdf+xml \
application/rss+xml \
application/schema+json \
application/vnd.geo+json \
application/geo+json \
application/vnd.ms-fontobject \
application/x-font-ttf \
application/x-javascript \
application/x-web-app-manifest+json \
application/xhtml+xml \
application/xml \
font/eot \
font/opentype \
font/otf \
font/ttf \
image/bmp \
image/svg+xml \
image/vnd.microsoft.icon \
image/x-icon \
text/cache-manifest \
text/css \
text/html \
text/javascript \
text/plain \
text/vcard \
text/vnd.rim.location.xloc \
text/vtt \
text/x-component \
text/x-cross-domain-policy \
text/xml
</IfModule>
<IfModule mod_mime.c>
AddEncoding gzip svgz
</IfModule>
</IfModule>
### End: Compression ###
### Begin: Browser caching of resource files ###
# This affects Frontend and Backend and increases performance.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 month"
ExpiresByType text/css "access plus 1 year"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/vnd.geo+json "access plus 0 seconds"
ExpiresByType application/geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
ExpiresByType image/vnd.microsoft.icon "access plus 1 week"
ExpiresByType image/x-icon "access plus 1 week"
ExpiresByType text/x-component "access plus 1 month"
ExpiresByType text/html "access plus 0 seconds"
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
ExpiresByType application/manifest+json "access plus 1 week"
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/apng "access plus 1 month"
ExpiresByType image/avif "access plus 1 month"
ExpiresByType image/avif-sequence "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jxl "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType font/collection "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType font/eot "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/otf "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/ttf "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType font/woff2 "access plus 1 month"
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
</IfModule>
### End: Browser caching of resource files ###
### Begin: MIME types ###
# Proper MIME types for all files
<IfModule mod_mime.c>
# Security configuration
RemoveType .html .htm
<FilesMatch ".+\.html?$">
AddType text/html .html .htm
</FilesMatch>
RemoveType .svg .svgz
<FilesMatch ".+\.svgz?$">
AddType image/svg+xml .svg .svgz
</FilesMatch>
# Data interchange
AddType application/atom+xml atom
AddType application/json json map topojson
AddType application/ld+json jsonld
AddType application/rss+xml rss
AddType application/vnd.geo+json geojson
AddType application/xml rdf xml
# JavaScript
AddType application/javascript js
# Manifest files
AddType application/manifest+json webmanifest
AddType application/x-web-app-manifest+json webapp
AddType text/cache-manifest appcache
# Media files
AddType audio/mp4 f4a f4b m4a
AddType audio/ogg oga ogg opus
AddType image/avif avif
AddType image/avif-sequence avifs
AddType image/bmp bmp
AddType image/jxl jxl
AddType image/webp webp
AddType video/mp4 f4v f4p m4v mp4
AddType video/ogg ogv
AddType video/webm webm
AddType video/x-flv flv
AddType image/x-icon cur ico
# Web fonts
AddType font/woff woff
AddType font/woff2 woff2
AddType application/vnd.ms-fontobject eot
AddType font/ttf ttc ttf
AddType font/otf otf
# Other
AddType application/octet-stream safariextz
AddType application/x-bb-appworld bbaw
AddType application/x-chrome-extension crx
AddType application/x-opera-extension oex
AddType application/x-xpinstall xpi
AddType text/vcard vcard vcf
AddType text/vnd.rim.location.xloc xloc
AddType text/vtt vtt
AddType text/x-component htc
</IfModule>
# UTF-8 encoding
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .atom .css .js .json .manifest .rdf .rss .vtt .webapp .webmanifest .xml
</IfModule>
### End: MIME types ###
### Begin: Cross Origin ###
# Send the CORS header for images when browsers request it.
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
<FilesMatch "\.(avifs?|bmp|cur|gif|ico|jpe?g|png|svgz?|webp)$">
SetEnvIf Origin ":" IS_CORS
Header set Access-Control-Allow-Origin "*" env=IS_CORS
</FilesMatch>
</IfModule>
</IfModule>
# Allow cross-origin access to web fonts.
<IfModule mod_headers.c>
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
### End: Cross Origin ###
### Begin: Rewriting and Access ###
<IfModule mod_rewrite.c>
# Enable URL rewriting
RewriteEngine On
# Store the current location in an environment variable CWD to use
# mod_rewrite in .htaccess files without knowing the RewriteBase
RewriteCond $0#%{REQUEST_URI} ([^#]*)#(.*)\1$
RewriteRule ^.*$ - [E=CWD:%2]
# Rules to set ApplicationContext based on hostname
#RewriteCond %{HTTP_HOST} ^dev\.example\.com$
#RewriteRule .? - [E=TYPO3_CONTEXT:Development]
#RewriteCond %{HTTP_HOST} ^staging\.example\.com$
#RewriteRule .? - [E=TYPO3_CONTEXT:Production/Staging]
#RewriteCond %{HTTP_HOST} ^www\.example\.com$
#RewriteRule .? - [E=TYPO3_CONTEXT:Production]
# Rule for versioned static files, configured through:
# - $GLOBALS['TYPO3_CONF_VARS']['BE']['versionNumberInFilename']
# - $GLOBALS['TYPO3_CONF_VARS']['FE']['versionNumberInFilename']
# IMPORTANT: This rule has to be the very first RewriteCond in order to work!
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)\.(\d+)\.(php|js|css|png|jpg|gif|gz)$ %{ENV:CWD}$1.$3 [L]
# Access block for folders
RewriteRule _(?:recycler|temp)_/ - [F]
RewriteRule fileadmin/templates/.*\.(?:txt|ts)$ - [F]
RewriteRule ^(?:vendor|typo3_src|typo3temp/var) - [F]
RewriteRule (?:typo3conf/ext|typo3/sysext|typo3/ext)/[^/]+/(?:Configuration|Resources/Private|Tests?|Documentation|docs?)/ - [F]
# Block access to all hidden files and directories with the exception of
# the visible content from within the `/.well-known/` hidden directory (RFC 5785).
RewriteCond %{REQUEST_URI} "!(^|/)\.well-known/([^./]+./?)+$" [NC]
RewriteCond %{SCRIPT_FILENAME} -d [OR]
RewriteCond %{SCRIPT_FILENAME} -f
RewriteRule (?:^|/)\. - [F]
# Stop rewrite processing, if we are in any other known directory
# NOTE: Add your additional local storages here
RewriteRule ^(?:fileadmin/|typo3conf/|typo3temp/|uploads/) - [L]
# If the file/symlink/directory does not exist but is below /typo3/, redirect to the TYPO3 Backend entry point.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^typo3/(.*)$ %{ENV:CWD}typo3/index.php [QSA,L]
# If the file/symlink/directory does not exist => Redirect to index.php.
# For httpd.conf, you need to prefix each '%{REQUEST_FILENAME}' with '%{DOCUMENT_ROOT}'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^.*$ %{ENV:CWD}index.php [QSA,L]
</IfModule>
# Access block for files
# Apache < 2.3
<IfModule !mod_authz_core.c>
<FilesMatch "(?i:^\.|^#.*#|^(?:ChangeLog|ToDo|Readme|License)(?:\.md|\.txt)?|^composer\.(?:json|lock)|^ext_conf_template\.txt|^ext_typoscript_constants\.txt|^ext_typoscript_setup\.txt|flexform[^.]*\.xml|locallang[^.]*\.(?:xml|xlf)|\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|tsconfig|dist|fla|in[ci]|log|sh|sql(?:\..*)?|sqlite(?:\..*)?|sw[op]|git.*|rc)|.*~)$">
Order allow,deny
Deny from all
Satisfy All
</FilesMatch>
</IfModule>
# Apache ≥ 2.3
<IfModule mod_authz_core.c>
<If "%{REQUEST_URI} =~ m#(?i:/\.|/\x23.*\x23|/(?:ChangeLog|ToDo|Readme|License)(?:\.md|\.txt)?|/composer\.(?:json|lock)|/ext_conf_template\.txt|/ext_typoscript_constants\.txt|/ext_typoscript_setup\.txt|flexform[^.]*\.xml|locallang[^.]*\.(?:xml|xlf)|\.(?:bak|co?nf|cfg|ya?ml|ts|typoscript|tsconfig|dist|fla|in[ci]|log|sh|sql(?:\..*)?|sqlite(?:\..*)?|sw[op]|git.*|rc)|.*~)$#">
Require all denied
</If>
</IfModule>
# Block access to vcs directories
<IfModule mod_alias.c>
RedirectMatch 404 /\.(?:git|svn|hg)/
</IfModule>
### End: Rewriting and Access ###
### Begin: Miscellaneous ###
# 404 error prevention for non-existing redirected folders
Options -MultiViews
# Make sure that directory listings are disabled.
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
<IfModule mod_headers.c>
# Force IE to render pages in the highest available mode
Header set X-UA-Compatible "IE=edge"
<FilesMatch "\.(appcache|avifs?|crx|css|eot|gif|htc|ico|jpe?g|js|m4a|m4v|manifest|mp4|oex|oga|ogg|ogv|otf|pdf|png|safariextz|svgz?|ttf|vcf|webapp|webm|webp|woff2?|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
# Reducing MIME type security risks
Header set X-Content-Type-Options "nosniff"
</IfModule>
# ETag removal
<IfModule mod_headers.c>
Header unset ETag
</IfModule>
FileETag None
### End: Miscellaneous ###
# Add your own rules here.
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.
+109
View File
@@ -0,0 +1,109 @@
<?php
# PackageStates.php
# This file is maintained by TYPO3's package management. Although you can edit it
# manually, you should rather use the extension manager for maintaining packages.
# This file will be regenerated automatically if it doesn't exist. Deleting this file
# should, however, never become necessary if you use the package commands.
return [
'packages' => [
'core' => [
'packagePath' => 'typo3/sysext/core/',
],
'scheduler' => [
'packagePath' => 'typo3/sysext/scheduler/',
],
'extbase' => [
'packagePath' => 'typo3/sysext/extbase/',
],
'fluid' => [
'packagePath' => 'typo3/sysext/fluid/',
],
'frontend' => [
'packagePath' => 'typo3/sysext/frontend/',
],
'fluid_styled_content' => [
'packagePath' => 'typo3/sysext/fluid_styled_content/',
],
'filelist' => [
'packagePath' => 'typo3/sysext/filelist/',
],
'impexp' => [
'packagePath' => 'typo3/sysext/impexp/',
],
'form' => [
'packagePath' => 'typo3/sysext/form/',
],
'install' => [
'packagePath' => 'typo3/sysext/install/',
],
'reports' => [
'packagePath' => 'typo3/sysext/reports/',
],
'redirects' => [
'packagePath' => 'typo3/sysext/redirects/',
],
'recordlist' => [
'packagePath' => 'typo3/sysext/recordlist/',
],
'backend' => [
'packagePath' => 'typo3/sysext/backend/',
],
'setup' => [
'packagePath' => 'typo3/sysext/setup/',
],
'rte_ckeditor' => [
'packagePath' => 'typo3/sysext/rte_ckeditor/',
],
'adminpanel' => [
'packagePath' => 'typo3/sysext/adminpanel/',
],
'belog' => [
'packagePath' => 'typo3/sysext/belog/',
],
'beuser' => [
'packagePath' => 'typo3/sysext/beuser/',
],
'extensionmanager' => [
'packagePath' => 'typo3/sysext/extensionmanager/',
],
'felogin' => [
'packagePath' => 'typo3/sysext/felogin/',
],
'info' => [
'packagePath' => 'typo3/sysext/info/',
],
'seo' => [
'packagePath' => 'typo3/sysext/seo/',
],
'sys_note' => [
'packagePath' => 'typo3/sysext/sys_note/',
],
't3editor' => [
'packagePath' => 'typo3/sysext/t3editor/',
],
'tstemplate' => [
'packagePath' => 'typo3/sysext/tstemplate/',
],
'viewpage' => [
'packagePath' => 'typo3/sysext/viewpage/',
],
'workspaces' => [
'packagePath' => 'typo3/sysext/workspaces/',
],
'sr_freecap' => [
'packagePath' => 'typo3conf/ext/sr_freecap/',
],
'femanager' => [
'packagePath' => 'typo3conf/ext/femanager/',
],
'bootstrap_package' => [
'packagePath' => 'typo3conf/ext/bootstrap_package/',
],
'zuladungsliste' => [
'packagePath' => 'typo3conf/ext/zuladungsliste/',
],
],
'version' => 5,
];
@@ -0,0 +1,9 @@
<?php
return array (
'aliasToClassNameMapping' =>
array (
),
'classNameToAliasMapping' =>
array (
),
);
@@ -0,0 +1,167 @@
<?php
// autoload_classmap.php @generated by TYPO3
$typo3InstallDir = PATH_site;
return array(
'BK2K\\BootstrapPackage\\Composer\\ChangelogScript' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Composer/ChangelogScript.php',
'BK2K\\BootstrapPackage\\Composer\\VersionScript' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Composer/VersionScript.php',
'BK2K\\BootstrapPackage\\DataProcessing\\FlexFormProcessor' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/DataProcessing/FlexFormProcessor.php',
'BK2K\\BootstrapPackage\\DataProcessing\\MenuProcessor' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/DataProcessing/MenuProcessor.php',
'BK2K\\BootstrapPackage\\Hooks\\PageRenderer\\PreProcessHook' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Hooks/PageRenderer/PreProcessHook.php',
'BK2K\\BootstrapPackage\\Hooks\\TceMain\\ClearCacheHook' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Hooks/TceMain/ClearCacheHook.php',
'BK2K\\BootstrapPackage\\Service\\BrandingService' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Service/BrandingService.php',
'BK2K\\BootstrapPackage\\Service\\CompileService' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Service/CompileService.php',
'BK2K\\BootstrapPackage\\Service\\InstallService' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Service/InstallService.php',
'BK2K\\BootstrapPackage\\Updates\\AccordionContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/AccordionContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\BulletContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/BulletContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\CarouselContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/CarouselContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\ExternalMediaContentElement' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/ExternalMediaContentElement.php',
'BK2K\\BootstrapPackage\\Updates\\ListGroupContentElement' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/ListGroupContentElement.php',
'BK2K\\BootstrapPackage\\Updates\\PanelContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/PanelContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\SectionFrameToFrameClassUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/SectionFrameToFrameClassUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\TabContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/TabContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\TableContentElementUpdate' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/TableContentElementUpdate.php',
'BK2K\\BootstrapPackage\\Updates\\TexticonContentElement' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Updates/TexticonContentElement.php',
'BK2K\\BootstrapPackage\\Utility\\ExternalMediaUtility' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Utility/ExternalMediaUtility.php',
'BK2K\\BootstrapPackage\\Utility\\TextIconUtility' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/Utility/TextIconUtility.php',
'BK2K\\BootstrapPackage\\ViewHelpers\\DataRelationViewHelper' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/ViewHelpers/DataRelationViewHelper.php',
'BK2K\\BootstrapPackage\\ViewHelpers\\ExplodeViewHelper' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/ViewHelpers/ExplodeViewHelper.php',
'BK2K\\BootstrapPackage\\ViewHelpers\\ExternalMediaViewHelper' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/ViewHelpers/ExternalMediaViewHelper.php',
'BK2K\\BootstrapPackage\\ViewHelpers\\FalViewHelper' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/ViewHelpers/FalViewHelper.php',
'BK2K\\BootstrapPackage\\ViewHelpers\\LastImageInfoViewHelper' => $typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes/ViewHelpers/LastImageInfoViewHelper.php',
'DieMedialen\\DmDeveloperlog\\Controller\\Devlog62Controller' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Controller/Devlog62Controller.php',
'DieMedialen\\DmDeveloperlog\\Controller\\DevlogController' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Controller/DevlogController.php',
'DieMedialen\\DmDeveloperlog\\Domain\\Model\\Constraint' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Domain/Model/Constraint.php',
'DieMedialen\\DmDeveloperlog\\Domain\\Model\\Logentry' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Domain/Model/Logentry.php',
'DieMedialen\\DmDeveloperlog\\Domain\\Repository\\LogentryRepository' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Domain/Repository/LogentryRepository.php',
'DieMedialen\\DmDeveloperlog\\Utility\\Developerlog' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/Utility/Developerlog.php',
'DieMedialen\\DmDeveloperlog\\ViewHelpers\\BitMaskViewHelper' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/ViewHelpers/BitMaskViewHelper.php',
'DieMedialen\\DmDeveloperlog\\ViewHelpers\\MapToHelperClassViewHelper' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/ViewHelpers/MapToHelperClassViewHelper.php',
'DieMedialen\\DmDeveloperlog\\ViewHelpers\\UsernameViewHelper' => $typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes/ViewHelpers/UsernameViewHelper.php',
'HermannTelser\\Zuladungsliste\\Controller\\ArchitektenController' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Controller/ArchitektenController.php',
'HermannTelser\\Zuladungsliste\\Controller\\ExtrasperrungController' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Controller/ExtrasperrungController.php',
'HermannTelser\\Zuladungsliste\\Controller\\KriterienController' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Controller/KriterienController.php',
'HermannTelser\\Zuladungsliste\\Controller\\WettbewerbeController' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Controller/WettbewerbeController.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Architekten' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Architekten.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Extrasperrung' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Extrasperrung.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Kammern' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Kammern.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Kriterien' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Kriterien.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Preisart' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Preisart.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Punkte' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Punkte.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Sektionstage' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Sektionstage.php',
'HermannTelser\\Zuladungsliste\\Domain\\Model\\Wettbewerbe' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Model/Wettbewerbe.php',
'HermannTelser\\Zuladungsliste\\Domain\\Repository\\ArchitektenRepository' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Repository/ArchitektenRepository.php',
'HermannTelser\\Zuladungsliste\\Domain\\Repository\\KriterienRepository' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Repository/KriterienRepository.php',
'HermannTelser\\Zuladungsliste\\Domain\\Repository\\WettbewerbeRepository' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Domain/Repository/WettbewerbeRepository.php',
'HermannTelser\\Zuladungsliste\\Utility\\Labels' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Utility/Labels.php',
'HermannTelser\\Zuladungsliste\\Utility\\ListToPdf' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Utility/ListToPdf.php',
'HermannTelser\\Zuladungsliste\\Utility\\Select' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Utility/Select.php',
'MYPDF' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Utility/eIDDispatcher.php',
'SJBR\\SrFeuserRegister\\Captcha\\Captcha' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Captcha/Captcha.php',
'SJBR\\SrFeuserRegister\\Captcha\\CaptchaInterface' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Captcha/CaptchaInterface.php',
'SJBR\\SrFeuserRegister\\Captcha\\CaptchaManager' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Captcha/CaptchaManager.php',
'SJBR\\SrFeuserRegister\\Captcha\\Freecap' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Captcha/Freecap.php',
'SJBR\\SrFeuserRegister\\Configuration\\ConfigurationCheck' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Configuration/ConfigurationCheck.php',
'SJBR\\SrFeuserRegister\\Configuration\\Reports\\StatusProvider' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Configuration/Reports/StatusProvider.php',
'SJBR\\SrFeuserRegister\\Controller\\AbstractActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/AbstractActionController.php',
'SJBR\\SrFeuserRegister\\Controller\\CreateActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/CreateActionController.php',
'SJBR\\SrFeuserRegister\\Controller\\DeleteActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/DeleteActionController.php',
'SJBR\\SrFeuserRegister\\Controller\\EditActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/EditActionController.php',
'SJBR\\SrFeuserRegister\\Controller\\InfomailActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/InfomailActionController.php',
'SJBR\\SrFeuserRegister\\Controller\\RegisterPluginController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/RegisterPluginController.php',
'SJBR\\SrFeuserRegister\\Controller\\SetfixedActionController' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Controller/SetfixedActionController.php',
'SJBR\\SrFeuserRegister\\Domain\\Data' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Domain/Data.php',
'SJBR\\SrFeuserRegister\\Exception' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Exception.php',
'SJBR\\SrFeuserRegister\\Hooks\\FileUploadHooks' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Hooks/FileUploadHooks.php',
'SJBR\\SrFeuserRegister\\Hooks\\RegistrationProcessHooks' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Hooks/RegistrationProcessHooks.php',
'SJBR\\SrFeuserRegister\\Hooks\\UsergroupHooks' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Hooks/UsergroupHooks.php',
'SJBR\\SrFeuserRegister\\Mail\\Message' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Mail/Message.php',
'SJBR\\SrFeuserRegister\\Request\\Parameters' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Request/Parameters.php',
'SJBR\\SrFeuserRegister\\Security\\Authentication' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Security/Authentication.php',
'SJBR\\SrFeuserRegister\\Security\\SecuredData' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Security/SecuredData.php',
'SJBR\\SrFeuserRegister\\Security\\SessionData' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Security/SessionData.php',
'SJBR\\SrFeuserRegister\\Security\\StorageSecurity' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Security/StorageSecurity.php',
'SJBR\\SrFeuserRegister\\Security\\TransmissionSecurity' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Security/TransmissionSecurity.php',
'SJBR\\SrFeuserRegister\\Setfixed\\SetfixedUrls' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Setfixed/SetfixedUrls.php',
'SJBR\\SrFeuserRegister\\Utility\\CssUtility' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Utility/CssUtility.php',
'SJBR\\SrFeuserRegister\\Utility\\HashUtility' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Utility/HashUtility.php',
'SJBR\\SrFeuserRegister\\Utility\\HtmlUtility' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Utility/HtmlUtility.php',
'SJBR\\SrFeuserRegister\\Utility\\LocalizationUtility' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Utility/LocalizationUtility.php',
'SJBR\\SrFeuserRegister\\Utility\\UrlUtility' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/Utility/UrlUtility.php',
'SJBR\\SrFeuserRegister\\View\\AbstractView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/AbstractView.php',
'SJBR\\SrFeuserRegister\\View\\AfterSaveView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/AfterSaveView.php',
'SJBR\\SrFeuserRegister\\View\\CreateView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/CreateView.php',
'SJBR\\SrFeuserRegister\\View\\DeleteView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/DeleteView.php',
'SJBR\\SrFeuserRegister\\View\\EditView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/EditView.php',
'SJBR\\SrFeuserRegister\\View\\Email' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/Email.php',
'SJBR\\SrFeuserRegister\\View\\Marker' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/Marker.php',
'SJBR\\SrFeuserRegister\\View\\PlainView' => $typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes/View/PlainView.php',
'SJBR\\SrFreecap\\Configuration\\ConfigurationHelper' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Configuration/ConfigurationHelper.php',
'SJBR\\SrFreecap\\Controller\\AudioPlayerController' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Controller/AudioPlayerController.php',
'SJBR\\SrFreecap\\Controller\\FontMakerController' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Controller/FontMakerController.php',
'SJBR\\SrFreecap\\Controller\\ImageGeneratorController' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Controller/ImageGeneratorController.php',
'SJBR\\SrFreecap\\Domain\\Model\\Font' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Domain/Model/Font.php',
'SJBR\\SrFreecap\\Domain\\Model\\Word' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Domain/Model/Word.php',
'SJBR\\SrFreecap\\Domain\\Repository\\FontRepository' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Domain/Repository/FontRepository.php',
'SJBR\\SrFreecap\\Domain\\Repository\\WordRepository' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Domain/Repository/WordRepository.php',
'SJBR\\SrFreecap\\Domain\\Session\\SessionStorage' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Domain/Session/SessionStorage.php',
'SJBR\\SrFreecap\\PiBaseApi' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/PiBaseApi.php',
'SJBR\\SrFreecap\\Utility\\AudioContentUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/AudioContentUtility.php',
'SJBR\\SrFreecap\\Utility\\EidUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/EidUtility.php',
'SJBR\\SrFreecap\\Utility\\EncryptionUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/EncryptionUtility.php',
'SJBR\\SrFreecap\\Utility\\FontMakingUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/FontMakingUtility.php',
'SJBR\\SrFreecap\\Utility\\GifBuilderUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/GifBuilderUtility.php',
'SJBR\\SrFreecap\\Utility\\ImageContentUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/ImageContentUtility.php',
'SJBR\\SrFreecap\\Utility\\LocalizationUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/LocalizationUtility.php',
'SJBR\\SrFreecap\\Utility\\Mp3ContentUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/Mp3ContentUtility.php',
'SJBR\\SrFreecap\\Utility\\RandomContentUtility' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Utility/RandomContentUtility.php',
'SJBR\\SrFreecap\\Validation\\Validator\\CaptchaValidator' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Validation/Validator/CaptchaValidator.php',
'SJBR\\SrFreecap\\Validation\\Validator\\TtfFileValidator' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/Validation/Validator/TtfFileValidator.php',
'SJBR\\SrFreecap\\ViewHelpers\\AudioViewHelper' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/ViewHelpers/AudioViewHelper.php',
'SJBR\\SrFreecap\\ViewHelpers\\ImageViewHelper' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/ViewHelpers/ImageViewHelper.php',
'SJBR\\SrFreecap\\ViewHelpers\\TranslateViewHelper' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/ViewHelpers/TranslateViewHelper.php',
'SJBR\\SrFreecap\\View\\AudioPlayer\\AbstractPlayFormat' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/View/AudioPlayer/AbstractPlayFormat.php',
'SJBR\\SrFreecap\\View\\AudioPlayer\\PlayMp3' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/View/AudioPlayer/PlayMp3.php',
'SJBR\\SrFreecap\\View\\AudioPlayer\\PlayWav' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/View/AudioPlayer/PlayWav.php',
'SJBR\\SrFreecap\\View\\ImageGenerator\\ShowPng' => $typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes/View/ImageGenerator/ShowPng.php',
'SJBR\\StaticInfoTables\\Cache\\CachedClassLoader' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Cache/CachedClassLoader.php',
'SJBR\\StaticInfoTables\\Cache\\ClassCacheManager' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Cache/ClassCacheManager.php',
'SJBR\\StaticInfoTables\\Configuration\\TypoScript\\ConfigurationHelper' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Configuration/TypoScript/ConfigurationHelper.php',
'SJBR\\StaticInfoTables\\Controller\\ManagerController' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Controller/ManagerController.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\AbstractEntity' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Model/AbstractEntity.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\Country' => $typo3InstallDir . 'typo3conf/ext/static_info_tables_de/Classes/Domain/Model/Country.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\CountryZone' => $typo3InstallDir . 'typo3conf/ext/static_info_tables_de/Classes/Domain/Model/CountryZone.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\Currency' => $typo3InstallDir . 'typo3conf/ext/static_info_tables_de/Classes/Domain/Model/Currency.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\Language' => $typo3InstallDir . 'typo3conf/ext/static_info_tables_de/Classes/Domain/Model/Language.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\LanguagePack' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Model/LanguagePack.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\SystemLanguage' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Model/SystemLanguage.php',
'SJBR\\StaticInfoTables\\Domain\\Model\\Territory' => $typo3InstallDir . 'typo3conf/ext/static_info_tables_de/Classes/Domain/Model/Territory.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\AbstractEntityRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/AbstractEntityRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\CountryRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/CountryRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\CountryZoneRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/CountryZoneRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\CurrencyRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/CurrencyRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\LanguagePackRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/LanguagePackRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\LanguageRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/LanguageRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\SystemLanguageRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/SystemLanguageRepository.php',
'SJBR\\StaticInfoTables\\Domain\\Repository\\TerritoryRepository' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Domain/Repository/TerritoryRepository.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\SuggestLabelProcessor' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Form/FormDataProvider/SuggestLabelProcessor.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaLabelProcessor' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Form/FormDataProvider/TcaLabelProcessor.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\FormDataProvider\\TcaSelectItemsProcessor' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Form/FormDataProvider/TcaSelectItemsProcessor.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Form\\Wizard\\SuggestReceiver' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Form/Wizard/SuggestReceiver.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Recordlist\\BuildQueryParameters' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Recordlist/BuildQueryParameters.php',
'SJBR\\StaticInfoTables\\Hook\\Backend\\Recordlist\\ModifyQuery' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Backend/Recordlist/ModifyQuery.php',
'SJBR\\StaticInfoTables\\Hook\\Core\\DataHandling\\ProcessDataMap' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Hook/Core/DataHandling/ProcessDataMap.php',
'SJBR\\StaticInfoTables\\PiBaseApi' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/PiBaseApi.php',
'SJBR\\StaticInfoTables\\Service\\SqlSchemaMigrationService' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Service/SqlSchemaMigrationService.php',
'SJBR\\StaticInfoTables\\Slot\\Extensionmanager\\AfterExtensionInstall' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Slot/Extensionmanager/AfterExtensionInstall.php',
'SJBR\\StaticInfoTables\\Utility\\DatabaseUpdateUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/DatabaseUpdateUtility.php',
'SJBR\\StaticInfoTables\\Utility\\DatabaseUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/DatabaseUtility.php',
'SJBR\\StaticInfoTables\\Utility\\HtmlElementUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/HtmlElementUtility.php',
'SJBR\\StaticInfoTables\\Utility\\LocaleUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/LocaleUtility.php',
'SJBR\\StaticInfoTables\\Utility\\LocalizationUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/LocalizationUtility.php',
'SJBR\\StaticInfoTables\\Utility\\ModelUtility' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/Utility/ModelUtility.php',
'SJBR\\StaticInfoTables\\ViewHelpers\\Form\\SelectViewHelper' => $typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes/ViewHelpers/Form/SelectViewHelper.php',
'medoo' => $typo3InstallDir . 'typo3conf/ext/zuladungsliste/Classes/Utility/medoo.min.php',
);
@@ -0,0 +1,13 @@
<?php
// autoload_classmap.php @generated by TYPO3
$typo3InstallDir = PATH_site;
return array(
'BK2K\\BootstrapPackage\\' => array($typo3InstallDir . 'typo3conf/ext/bootstrap_package/Classes'),
'DieMedialen\\DmDeveloperlog\\' => array($typo3InstallDir . 'typo3conf/ext/dm_developerlog/Classes'),
'SJBR\\SrFeuserRegister\\' => array($typo3InstallDir . 'typo3conf/ext/sr_feuser_register/Classes'),
'SJBR\\SrFreecap\\' => array($typo3InstallDir . 'typo3conf/ext/sr_freecap/Classes'),
'SJBR\\StaticInfoTables\\' => array($typo3InstallDir . 'typo3conf/ext/static_info_tables/Classes'),
);
@@ -0,0 +1,74 @@
<?php
/**
* This file represents the configuration for Code Sniffing PSR-2-related
* automatic checks of coding guidelines
* Install @fabpot's great php-cs-fixer tool via
*
* $ composer global require friendsofphp/php-cs-fixer
*
* And then simply run
*
* $ php-cs-fixer fix
*
* For more information read:
* http://www.php-fig.org/psr/psr-2/
* http://cs.sensiolabs.org
*/
if (PHP_SAPI !== 'cli') {
die('This script supports command line usage only. Please check your command.');
}
$header = <<<EOF
This file is part of the package bk2k/bootstrap-package.
For the full copyright and license information, please read the
LICENSE file that was distributed with this source code.
EOF;
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'header_comment' => [
'header' => $header
],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'author'
]
],
'no_leading_import_slash' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_unused_imports' => true,
'concat_space' => ['spacing' => 'one'],
'no_whitespace_in_blank_line' => true,
'ordered_imports' => true,
'single_quote' => true,
'no_empty_statement' => true,
'no_extra_blank_lines' => true,
'phpdoc_no_package' => true,
'phpdoc_scalar' => true,
'no_blank_lines_after_phpdoc' => true,
'array_syntax' => ['syntax' => 'short'],
'whitespace_after_comma_in_array' => true,
'function_typehint_space' => true,
'single_line_comment_style' => true,
'no_alias_functions' => true,
'lowercase_cast' => true,
'no_leading_namespace_whitespace' => true,
'native_function_casing' => true,
'self_accessor' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true
])
->setFinder(
PhpCsFixer\Finder::create()
->exclude('.build')
->exclude('Build/node_modules')
->exclude('Contrib')
->exclude('var')
->in(__DIR__)
);
@@ -0,0 +1,7 @@
path: ./
jobs: 10
cache: .phplint.cache
extensions:
- php
exclude:
- .build
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,67 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Backend\ToolbarItem;
use TYPO3\CMS\Backend\Backend\Event\SystemInformationToolbarCollectorEvent;
use TYPO3\CMS\Backend\Backend\ToolbarItems\SystemInformationToolbarItem;
use TYPO3\CMS\Core\Utility\CommandUtility;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* VersionToolbarItem
*/
class VersionToolbarItem
{
public function __invoke(SystemInformationToolbarCollectorEvent $event): void
{
$this->addVersionInformation($event->getToolbarItem());
}
/**
* Called by the system information toolbar signal/slot dispatch.
*
* @param SystemInformationToolbarItem $systemInformation
*/
public function addVersionInformation(SystemInformationToolbarItem $systemInformation): void
{
$value = null;
$extensionDirectory = ExtensionManagementUtility::extPath('bootstrap_package');
// Try to get current version from git
if (file_exists($extensionDirectory . '.git')) {
CommandUtility::exec('git --version', $_, $returnCode);
if ((int)$returnCode === 0) {
$currentDir = (string) getcwd();
chdir($extensionDirectory);
$tag = trim(CommandUtility::exec('git tag -l --points-at HEAD'));
if ($tag !== '') {
$value = $tag;
} else {
$branch = trim(CommandUtility::exec('git rev-parse --abbrev-ref HEAD'));
$revision = trim(CommandUtility::exec('git rev-parse --short HEAD'));
$value = $branch . ', ' . $revision;
}
chdir($currentDir);
}
}
// Fallback to version from extension manager
if ($value === null) {
$value = ExtensionManagementUtility::getExtensionVersion('bootstrap_package');
}
// Set system information entry
$systemInformation->addSystemInformation(
'Bootstrap Package',
htmlspecialchars($value, ENT_QUOTES | ENT_HTML5),
'systeminformation-bootstrappackage'
);
}
}
@@ -0,0 +1,90 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\TypoScript\Parser\TypoScriptParser;
use TYPO3\CMS\Core\TypoScript\TypoScriptService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* Minimal TypoScript configuration
* Assign all available typoscript constants for a key to template view, the
* default key that is used is `page` and the default variable is `constants`.
*
* 10 = BK2K\BootstrapPackage\DataProcessing\ConstantsProcessor
*
*
* Advanced TypoScript configuration
*
* 10 = BK2K\BootstrapPackage\DataProcessing\ConstantsProcessor
* 10 {
* key = page
* as = constants
* }
*/
class ConstantsProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
// The key to process
$key = (string) $cObj->stdWrapValue('key', $processorConfiguration);
if ($key === '') {
$key = 'page';
}
// Collect variables
$flatConstants = $this->getFlatConstants($key);
$typoScriptParser = GeneralUtility::makeInstance(TypoScriptParser::class);
$typoScriptParser->parse($flatConstants);
$typoScriptArray = $typoScriptParser->setup;
$typoScriptService = GeneralUtility::makeInstance(TypoScriptService::class);
$constants = $typoScriptService->convertTypoScriptArrayToPlainArray($typoScriptArray);
// Set the target variable
$targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration);
if ($targetVariableName !== '') {
$processedData[$targetVariableName] = $constants;
} else {
$processedData['constants'] = $constants;
}
return $processedData;
}
/**
* @param string $key
* @return string
*/
protected function getFlatConstants($key): string
{
$flatvariables = '';
$prefix = $key . '.';
if ($GLOBALS['TSFE']->tmpl->flatSetup === null
|| !is_array($GLOBALS['TSFE']->tmpl->flatSetup)
|| count($GLOBALS['TSFE']->tmpl->flatSetup) === 0) {
$GLOBALS['TSFE']->tmpl->generateConfig();
}
foreach ($GLOBALS['TSFE']->tmpl->flatSetup as $constant => $value) {
if (strpos($constant, $prefix) === 0) {
$flatvariables .= substr($constant, strlen($prefix)) . ' = ' . $value . PHP_EOL;
}
}
return $flatvariables;
}
}
@@ -0,0 +1,79 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* ContainerContextProcessor
*/
class ContainerContextProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
if (!isset($processedData['data']['tx_container_parent'])
|| $processedData['data']['tx_container_parent'] === 0) {
return $processedData;
}
$processedData['containerContext'] = $this->getContainerContext(
$this->getPageRecords($cObj, $processedData['data']['pid']),
$processedData['data']
);
$processedData['containerContext'] = array_reverse($processedData['containerContext']);
return $processedData;
}
public function getContainerContext(array $pageRecords, array $data, int $level = 1): array
{
$containerContext = [];
if (isset($data['tx_container_parent']) && isset($pageRecords[$data['tx_container_parent']])) {
$parent = $pageRecords[$data['tx_container_parent']];
$containerContext[] = $parent;
$containerContext = array_merge(
$containerContext,
$this->getContainerContext($pageRecords, $parent, $level++)
);
}
return $containerContext;
}
public function getPageRecords(ContentObjectRenderer $cObj, int $pid): array
{
$runtimeCache = GeneralUtility::makeInstance(CacheManager::class)->getCache('runtime');
$cache = \is_array($runtimeCache->get('containerContext')) ? $runtimeCache->get('containerContext') : [];
$cacheIdentifier = 'containerContext:' . $pid;
if (!isset($cache[$cacheIdentifier])) {
$records = $cObj->getRecords('tt_content', ['pidInList' => $pid]);
$dataset = [];
foreach ($records as $record) {
$dataset[$record['uid']] = $record;
}
$cache[$cacheIdentifier] = $dataset;
$runtimeCache->set('containerContext', $cache);
}
return $cache[$cacheIdentifier];
}
}
@@ -0,0 +1,74 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Resource\ProcessedFile;
use TYPO3\CMS\Core\Utility\CsvUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor;
/**
* CsvFileProcessor
*/
class CsvFileProcessor extends FilesProcessor
{
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
// Set the maximum amount of columns
$maximumColumns = (int) $cObj->stdWrapValue('maximumColumns', $processorConfiguration, '0');
// Set the field delimiter which is "," by default
$fieldDelimiter = (string) $cObj->stdWrapValue('fieldDelimiter', $processorConfiguration, ',');
// Set the field enclosure which is " by default
$fieldEnclosure = (string) $cObj->stdWrapValue('fieldEnclosure', $processorConfiguration, '"');
// Get processed files
$processedData = parent::process($cObj, $contentObjectConfiguration, $processorConfiguration, $processedData);
$targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration, 'files');
$files = $processedData[$targetVariableName];
unset($processedData[$targetVariableName]);
foreach ($files as $key => $value) {
if (is_object($value) && ($value instanceof FileReference || $value instanceof File)) {
/** @var ProcessedFile $value */
if ($value->getExtension() !== 'csv') {
unset($files[$key]);
} else {
$originalFile = $value->getOriginalFile();
$content = $originalFile->getContents();
$files[$key] = [
'file' => $value,
'bodytext' => $content,
'table' => CsvUtility::csvToArray(
$content,
$fieldDelimiter,
$fieldEnclosure,
$maximumColumns
)
];
}
}
}
$files = array_values(array_filter($files));
$processedData[$targetVariableName] = $files;
return $processedData;
}
}
@@ -0,0 +1,102 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* File Filter Processor
* The DataProcessor requires a prepared array with Files or FilesReferences.
* This required array is usually generated by the FilesProcessor so it must be
* called first.
*
* Please note that the output variable name of the FilesProcessor
* must be provided to the FileFilterProcessor.
*
*
* Options:
* variableName - Resultset to work on
* predefinedList - Can be 'image', 'media' or 'text', will reference the
* global TYPO3 settings for that file type, for example:
* ['GFX']['imagefile_ext'] or ['SYS']['mediafile_ext']
* allowedFileExtensions - List of allowed file extensions,
* if set predefinedList will be overridden
*
*
* Basic Example:
* 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
* 10 {
* references.fieldName = image
* folders.field = image_folder
* sorting.field = filelink_sorting
* as = files
* }
* 20 = BK2K\BootstrapPackage\DataProcessing\FileFilterProcessor
* 20 {
* variableName = files
* predefinedList = image
* }
*
*
* Advanced Example:
* 10 = TYPO3\CMS\Frontend\DataProcessing\FilesProcessor
* 10 {
* references.fieldName = image
* }
* 20 = BK2K\BootstrapPackage\DataProcessing\FileFilterProcessor
* 20 {
* allowedFileExtensions = jpg, jpeg, gif
* }
*/
class FileFilterProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
$confVars = $GLOBALS['TYPO3_CONF_VARS'];
$predefinedLists = [
'image' => isset($confVars['GFX']['imagefile_ext']) ? $confVars['GFX']['imagefile_ext'] : 'gif,jpg,jpeg,tif,tiff,bmp,pcx,tga,png,pdf,ai,svg',
'media' => isset($confVars['SYS']['mediafile_ext']) ? $confVars['SYS']['mediafile_ext'] : 'gif,jpg,jpeg,bmp,png,pdf,svg,ai,mp3,wav,mp4,ogg,flac,opus,webm,youtube,vimeo',
'text' => isset($confVars['SYS']['textfile_ext']) ? $confVars['SYS']['textfile_ext'] : 'txt,ts,typoscript,html,htm,css,tmpl,js,sql,xml,csv,xlf,yaml,yml',
];
$predefinedList = (string) $cObj->stdWrapValue('predefinedList', $processorConfiguration, 'image');
$allowedFileExtensions = isset($predefinedLists[$predefinedList]) ? $predefinedLists[$predefinedList] : '';
$allowedFileExtensions = GeneralUtility::trimExplode(',', (string) $cObj->stdWrapValue('allowedFileExtensions', $processorConfiguration, $allowedFileExtensions));
if (count($allowedFileExtensions) === 0) {
return $processedData;
}
$variableName = (string) $cObj->stdWrapValue('variableName', $processorConfiguration, 'files');
if (!isset($processedData[$variableName]) || count($processedData[$variableName]) === 0) {
return $processedData;
}
foreach ($processedData[$variableName] as $key => $value) {
if (is_object($value)
&& ($value instanceof FileReference || $value instanceof File)
&& !in_array($value->getExtension(), $allowedFileExtensions, true)
) {
unset($processedData[$variableName][$key]);
}
}
return $processedData;
}
}
@@ -0,0 +1,84 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\Service\FlexFormService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* Minimal TypoScript configuration
* Process field pi_flexform and overrides the values stored in data
*
* 10 = BK2K\BootstrapPackage\DataProcessing\FlexFormProcessor
*
*
* Advanced TypoScript configuration
* Process field assigned in fieldName and stores processed data to new key
*
* 10 = BK2K\BootstrapPackage\DataProcessing\FlexFormProcessor
* 10 {
* fieldName = pi_flexform
* as = flexform
* }
*/
class FlexFormProcessor implements DataProcessorInterface
{
/**
* @var FlexFormService
*/
protected $flexFormService;
/**
* Constructor
*/
public function __construct()
{
$this->flexFormService = GeneralUtility::makeInstance(FlexFormService::class);
}
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
// The field name to process
$fieldName = (string) $cObj->stdWrapValue('fieldName', $processorConfiguration);
if ($fieldName === '') {
$fieldName = 'pi_flexform';
}
if (!isset($processedData['data'][$fieldName])) {
return $processedData;
}
// Process Flexform
$originalValue = $processedData['data'][$fieldName];
if (!is_string($originalValue)) {
return $processedData;
}
$flexformData = $this->flexFormService->convertFlexFormContentToArray($originalValue);
// Set the target variable
$targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration);
if ($targetVariableName !== '') {
$processedData[$targetVariableName] = $flexformData;
} else {
$processedData['data'][$fieldName] = $flexformData;
}
return $processedData;
}
}
@@ -0,0 +1,91 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use BK2K\BootstrapPackage\Icons\FileIcon;
use BK2K\BootstrapPackage\Service\IconService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
use TYPO3\CMS\Frontend\DataProcessing\FilesProcessor;
/**
* Minimal TypoScript configuration
*
* 10 = BK2K\BootstrapPackage\DataProcessing\IconsDataProcessor
* 10 {
* iconSetFieldName = icon_set
* iconIdentifierFieldName = icon
* iconFileFieldName = icon_file
* as = icon
* }
*/
class IconsDataProcessor implements DataProcessorInterface
{
/**
* @var IconService
*/
protected $iconService;
/**
* Constructor
*/
public function __construct()
{
$this->iconService = GeneralUtility::makeInstance(IconService::class);
}
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
$icon = null;
$config = [
'iconSet' => (string) $cObj->stdWrapValue('iconSet', $processorConfiguration, ''),
'iconIdentifier' => (string) $cObj->stdWrapValue('iconIdentifier', $processorConfiguration, ''),
'iconFileFieldName' => (string) $cObj->stdWrapValue('iconFileFieldName', $processorConfiguration, ''),
];
if ($config['iconSet'] !== '' && $config['iconIdentifier'] !== '') {
$iconProvider = $this->iconService->getIconProviderForIdentifier($config['iconSet']);
if ($iconProvider !== null) {
$icon = $iconProvider->getIconList()->getIcon($config['iconIdentifier']);
}
} elseif ($config['iconFileFieldName'] !== '') {
$filesProcessor = GeneralUtility::makeInstance(FilesProcessor::class);
$filesData = $filesProcessor->process(
$cObj,
$contentObjectConfiguration,
['references.' => ['fieldName' => $config['iconFileFieldName']]],
['data' => $processedData['data']]
);
if (isset($filesData['files'][0])) {
$file = $filesData['files'][0];
$icon = (new FileIcon())
->setFile($file)
->setIdentifier($file->getIdentifier())
->setName($file->getName())
->setPreviewImage($file->getPublicUrl())
;
}
}
$targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration, 'icon');
$processedData[$targetVariableName] = $icon;
return $processedData;
}
}
@@ -0,0 +1,81 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\DataProcessing;
use TYPO3\CMS\Core\Resource\ResourceFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
use TYPO3\CMS\Frontend\ContentObject\DataProcessorInterface;
/**
* This processor generates a set of file objects.
*
* 10 = BK2K\BootstrapPackage\DataProcessing\StaticFilesProcessor
* 10 {
* files {
* 0.field = image
* 1 = EXT:bootstrap_package/Resources/Public/Images/Icons/icon-1.png
* circle = EXT:bootstrap_package/Resources/Public/Images/Icons/icon-circle.png
* }
* as = staticFiles
* }
*/
class StaticFilesProcessor implements DataProcessorInterface
{
/**
* @param ContentObjectRenderer $cObj The data of the content element or page
* @param array $contentObjectConfiguration The configuration of Content Object
* @param array $processorConfiguration The configuration of this processor
* @param array $processedData Key/value store of processed data (e.g. to be passed to a Fluid View)
* @return array the processed data as key/value store
*/
public function process(ContentObjectRenderer $cObj, array $contentObjectConfiguration, array $processorConfiguration, array $processedData)
{
if (isset($processorConfiguration['if.']) && !$cObj->checkIf($processorConfiguration['if.'])) {
return $processedData;
}
// Collect possible files
$files = [];
if (count($processorConfiguration['files.']) > 0) {
$filesConfiguration = $processorConfiguration['files.'];
foreach ($filesConfiguration as $key => $file) {
$key = substr($key, -1) === '.' ? substr_replace($key, '', -1) : $key;
$value = (string) $cObj->stdWrapValue($key, $filesConfiguration);
if ($value !== '') {
$files[$key] = $value;
}
}
}
// Get file objects
$images = [];
if (count($files) !== 0) {
$resourceFactory = GeneralUtility::makeInstance(ResourceFactory::class);
foreach ($files as $key => $file) {
$absFilename = GeneralUtility::getFileAbsFileName($file);
if (file_exists($absFilename)) {
// Do not use absolute file name to ensure correct path resolution from ResourceFactory.
$images[$key] = $resourceFactory->retrieveFileOrFolderObject($file);
}
}
}
// Set the target variable
$targetVariableName = (string) $cObj->stdWrapValue('as', $processorConfiguration);
if ($targetVariableName !== '') {
$processedData[$targetVariableName] = $images;
} else {
$processedData['staticFiles'] = $images;
}
return $processedData;
}
}
@@ -0,0 +1,27 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ExpressionLanguage;
use TYPO3\CMS\Core\ExpressionLanguage\AbstractProvider;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* ConditionProvider
*/
class ConditionProvider extends AbstractProvider
{
public function __construct()
{
$this->expressionLanguageVariables = [
'extension' => GeneralUtility::makeInstance(ExtensionWrapper::class)
];
}
}
@@ -0,0 +1,28 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ExpressionLanguage;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* ExtensionWrapper
*/
class ExtensionWrapper
{
/**
* @param string $extensionKey
* @return bool
*/
public function isLoaded($extensionKey): bool
{
return ExtensionManagementUtility::isLoaded($extensionKey);
}
}
@@ -0,0 +1,106 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Form\FieldWizard;
use BK2K\BootstrapPackage\Service\IconService;
use TYPO3\CMS\Backend\Form\AbstractNode;
use TYPO3\CMS\Backend\Form\Utility\FormEngineUtility;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\GeneralUtility;
class IconWizard extends AbstractNode
{
public function render(): array
{
$selectIcons = [];
$result = $this->initializeResultArray();
$parameterArray = $this->data['parameterArray'];
$iconSetField = $parameterArray['fieldConf']['config']['itemsProcConfig']['iconSetField'] ?? 'icon_set';
$iconProviderIdentifier = $this->data['databaseRow'][$iconSetField][0] ?? '';
$iconProvider = GeneralUtility::makeInstance(IconService::class)->getIconProviderForIdentifier($iconProviderIdentifier);
$iconList = $iconProvider !== null ? $iconProvider->getIconList() : null;
$selectItems = $parameterArray['fieldConf']['config']['items'];
$selectItemCounter = 0;
foreach ($selectItems as $item) {
if ((new Typo3Version())->getMajorVersion() < 12) {
$item = [
'label' => $item[0] ?? '',
'value' => $item[1] ?? '',
'icon' => $item[2] ?? '',
];
}
if ($item['value'] === '--div--') {
continue;
}
$icon = null;
if ($iconList !== null) {
$iconSetIcon = $iconList->getIcon((string) $item['value']);
if ($iconSetIcon !== null) {
$iconSetIcon->setHeight(32);
$iconSetIcon->setWidth(32);
$icon = $iconSetIcon->render();
}
}
if ($icon === null) {
$icon = isset($item['icon']) && trim($item['icon']) !== '' ? FormEngineUtility::getIconHtml($item['icon'], $item['label'], $item['label']) : '';
}
if ($icon !== '') {
$fieldValue = $this->data['databaseRow'][$this->data['fieldName']];
$selectIcons[] = [
'title' => $item['label'],
'active' => ($fieldValue[0] ?? false) === (string)($item['value'] ?? ''),
'icon' => $icon,
'index' => $selectItemCounter,
];
}
$selectItemCounter++;
}
$html = [];
if (count($selectIcons) > 0) {
if ((new Typo3Version())->getMajorVersion() < 12) {
$html[] = '<div class="t3js-forms-select-single-icons icon-list">';
$html[] = '<div class="row">';
foreach ($selectIcons as $selectIcon) {
$active = $selectIcon['active'] ? ' active' : '';
$html[] = '<div class="col col-auto item' . $active . '">';
$html[] = '<a href="#" title="' . htmlspecialchars($selectIcon['title'], ENT_COMPAT, 'UTF-8', false) . '" data-select-index="' . htmlspecialchars((string)$selectIcon['index']) . '">';
$html[] = $selectIcon['icon'];
$html[] = '</a>';
$html[] = '</div>';
}
$html[] = '</div>';
$html[] = '</div>';
} else {
$html[] = '<div class="t3js-forms-select-single-icons form-wizard-icon-list">';
foreach ($selectIcons as $selectIcon) {
$active = $selectIcon['active'] ? ' active' : '';
$html[] = '<div class="form-wizard-icon-list-item">';
$html[] = '<a class="' . $active . '" href="#" title="' . htmlspecialchars($selectIcon['title'], ENT_COMPAT, 'UTF-8', false) . '" data-select-index="' . htmlspecialchars((string)$selectIcon['index']) . '">';
$html[] = $selectIcon['icon'];
$html[] = '</a>';
$html[] = '</div>';
}
$html[] = '</div>';
}
}
$result['html'] = implode(LF, $html);
return $result;
}
}
@@ -0,0 +1,110 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Hooks\PageRenderer;
use BK2K\BootstrapPackage\Service\GoogleFontService;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* GoogleFontHook
*/
class GoogleFontHook
{
/**
* @var array
*/
protected $includeMapping = [
'includeCSSLibs' => 'cssLibs',
'includeCSS' => 'cssFiles'
];
/**
* @var \BK2K\BootstrapPackage\Service\GoogleFontService
*/
protected $googleFontService;
/**
* @param array $params
* @param \TYPO3\CMS\Core\Page\PageRenderer $pagerenderer
*/
public function execute(&$params, &$pagerenderer): void
{
if (!($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface ||
!ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend() ||
(!is_array($params['cssFiles']) && !is_array($params['cssLibs']))
) {
return;
}
foreach ($this->includeMapping as $include => $section) {
if (is_array($params[$section])) {
$files = [];
foreach ($params[$section] as $file => $settings) {
$cachedFile = $this->getGoogleFontService()->getCachedFile($file);
if ($cachedFile !== null) {
$this->adjustTypoScriptCssConfiguration($include, $file, $cachedFile);
$settings['file'] = $cachedFile;
$files[$cachedFile] = $settings;
} else {
$files[$file] = $settings;
}
$params[$section] = $files;
}
}
}
}
/**
* @param string $include
* @param string $file
* @param string $cachedFile
*/
protected function adjustTypoScriptCssConfiguration($include, $file, $cachedFile): void
{
$includeFilesConfiguration = $this->getTemplateService()->setup['page.'][$include . '.'];
if (is_array($includeFilesConfiguration) && count($includeFilesConfiguration) > 0) {
foreach ($includeFilesConfiguration as $includeKey => $includeFilename) {
if (substr($includeKey, -1) === '.') {
continue;
}
if ($file === $includeFilename) {
$this->getTemplateService()->setup['page.'][$include . '.'][$includeKey] = $cachedFile;
break;
}
}
}
}
/**
* Get the google font service
*
* @return GoogleFontService
*/
protected function getGoogleFontService(): GoogleFontService
{
if ($this->googleFontService === null) {
$this->googleFontService = GeneralUtility::makeInstance(GoogleFontService::class);
}
return $this->googleFontService;
}
/**
* @return TemplateService
*/
private function getTemplateService(): TemplateService
{
$frontendController = $GLOBALS['TYPO3_REQUEST']->getAttribute('frontend.controller', $GLOBALS['TSFE']);
return $frontendController->tmpl;
}
}
@@ -0,0 +1,67 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Hooks\PageRenderer;
use BK2K\BootstrapPackage\Service\CompileService;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Http\ApplicationType;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* PreProcessHook
*/
class PreProcessHook
{
/**
* @var \BK2K\BootstrapPackage\Service\CompileService
*/
protected $compileService;
/**
* @param array $params
* @param \TYPO3\CMS\Core\Page\PageRenderer $pagerenderer
*/
public function execute(&$params, &$pagerenderer): void
{
if (!($GLOBALS['TYPO3_REQUEST'] ?? null) instanceof ServerRequestInterface ||
!ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isFrontend()) {
return;
}
foreach (['cssLibs', 'cssFiles'] as $key) {
$files = [];
if (is_array($params[$key])) {
foreach ($params[$key] as $file => $settings) {
$compiledFile = $this->getCompileService()->getCompiledFile($file);
if ($compiledFile !== null) {
$settings['file'] = $compiledFile;
$files[$compiledFile] = $settings;
} else {
$files[$file] = $settings;
}
}
$params[$key] = $files;
}
}
}
/**
* Get the compile service
*
* @return CompileService
*/
protected function getCompileService(): CompileService
{
if ($this->compileService === null) {
$this->compileService = GeneralUtility::makeInstance(CompileService::class);
}
return $this->compileService;
}
}
@@ -0,0 +1,140 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
/**
* AbstractIcon
*/
abstract class AbstractIcon implements IconInterface
{
/**
* @var string
*/
protected $identifier;
/**
* @var string
*/
protected $name;
/**
* @var string
*/
protected $previewImage;
/**
* @var int
*/
protected $height = 16;
/**
* @var int
*/
protected $width = 16;
/**
* @param string $identifier
* @return self
*/
public function setIdentifier(string $identifier)
{
$this->identifier = $identifier;
return $this;
}
/**
* @return string
*/
public function getIdentifier(): string
{
return $this->identifier;
}
/**
* @param string $name
* @return self
*/
public function setName(string $name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getName(): string
{
return $this->name;
}
/**
* @param string $previewImage
* @return self
*/
public function setPreviewImage(string $previewImage)
{
$this->previewImage = $previewImage;
return $this;
}
/**
* @return string
*/
public function getPreviewImage(): string
{
return $this->previewImage;
}
/**
* @param int $height
* @return self
*/
public function setHeight(int $height)
{
$this->height = $height;
return $this;
}
/**
* @return int
*/
public function getHeight(): int
{
return $this->height;
}
/**
* @param int $width
* @return self
*/
public function setWidth(int $width)
{
$this->width = $width;
return $this;
}
/**
* @return int
*/
public function getWidth(): int
{
return $this->width;
}
/**
* @return string
*/
public function render(): string
{
return '';
}
}
@@ -0,0 +1,84 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
use BK2K\BootstrapPackage\Utility\SvgUtility;
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Service\ImageService;
/**
* FileIcon
*/
class FileIcon extends AbstractIcon
{
/**
* @var FileInterface
*/
protected $file;
/**
* @param FileInterface $file
* @return self
*/
public function setFile(FileInterface $file): self
{
$this->file = $file;
return $this;
}
/**
* @return FileInterface
*/
public function getFile(): FileInterface
{
return $this->file;
}
/**
* @return string
*/
public function render(): string
{
try {
$imageService = GeneralUtility::makeInstance(ImageService::class);
$image = $imageService->getImage('', $this->file, false);
$height = $this->getHeight();
$width = $this->getWidth();
if ($image->getExtension() === 'svg') {
return SvgUtility::getInlineSvg('', $image, $width, $height);
}
$processingInstructions = [
'width' => $width . 'c',
'height' => $height . 'c'
];
$processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);
$imageUri = $imageService->getImageUri($processedImage);
return '<img loading="lazy" src="' . $imageUri . '" height="' . $height . '" width="' . $width . '" />';
} catch (ResourceDoesNotExistException $e) {
// thrown if file does not exist
throw new \Exception($e->getMessage(), 1628773040, $e);
} catch (\UnexpectedValueException $e) {
// thrown if a file has been replaced with a folder
throw new \Exception($e->getMessage(), 1628773041, $e);
} catch (\RuntimeException $e) {
// RuntimeException thrown if a file is outside of a storage
throw new \Exception($e->getMessage(), 1628773042, $e);
} catch (\InvalidArgumentException $e) {
// thrown if file storage does not exist
throw new \Exception($e->getMessage(), 1628773043, $e);
}
}
}
@@ -0,0 +1,74 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* GlyphiconsProvider
*/
class GlyphiconsProvider implements IconProviderInterface
{
/**
* @return string
*/
public function getIdentifier(): string
{
return 'EXT:bootstrap_package/Resources/Public/Images/Icons/Glyphicons/';
}
/**
* @return string
*/
public function getName(): string
{
return 'Glyphicons';
}
/**
* @param string $identifier
* @return bool
*/
public function supports(string $identifier): bool
{
return 'EXT:bootstrap_package/Resources/Public/Images/Icons/Glyphicons/' === $identifier;
}
/**
* @return IconList
*/
public function getIconList(): IconList
{
$icons = new IconList();
$directory = 'EXT:bootstrap_package/Resources/Public/Images/Icons/Glyphicons/';
$path = GeneralUtility::getFileAbsFileName($directory);
$files = iterator_to_array(new \FilesystemIterator($path, \FilesystemIterator::KEY_AS_PATHNAME));
ksort($files);
foreach ($files as $key => $fileinfo) {
if ($fileinfo instanceof \SplFileInfo
&& $fileinfo->isFile()
&& strtolower($fileinfo->getExtension()) === 'svg'
) {
$icons->addIcon(
(new SvgIcon())
->setSrc($directory . $fileinfo->getFilename())
->setIdentifier($directory . $fileinfo->getFilename())
->setName($fileinfo->getBasename('.' . $fileinfo->getExtension()))
->setPreviewImage($directory . $fileinfo->getFilename())
);
}
}
return $icons;
}
}
@@ -0,0 +1,76 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
/**
* IconInterface
*/
interface IconInterface
{
/**
* @param string $identifier
* @return self
*/
public function setIdentifier(string $identifier);
/**
* @return string
*/
public function getIdentifier(): string;
/**
* @param string $name
* @return self
*/
public function setName(string $name);
/**
* @return string
*/
public function getName(): string;
/**
* @param string $previewImage
* @return self
*/
public function setPreviewImage(string $previewImage);
/**
* @return string
*/
public function getPreviewImage(): string;
/**
* @param int $width
* @return self
*/
public function setWidth(int $width);
/**
* @return int
*/
public function getWidth(): int;
/**
* @param int $height
* @return self
*/
public function setHeight(int $height);
/**
* @return int
*/
public function getHeight(): int;
/**
* @return string
*/
public function render(): string;
}
@@ -0,0 +1,61 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
/**
* IconList
*/
class IconList
{
/**
* @var IconInterface[] $icons
*/
protected $icons = [];
/**
* @return IconInterface[]
*/
public function getIcons(): array
{
return $this->icons;
}
/**
* @param IconInterface $icon
* @return self
*/
public function addIcon(IconInterface $icon): self
{
$this->icons[$icon->getIdentifier()] = $icon;
return $this;
}
/**
* @param IconInterface $icon
* @return self
*/
public function removeIcon(IconInterface $icon): self
{
if (isset($this->icons[$icon->getIdentifier()])) {
unset($this->icons[$icon->getIdentifier()]);
}
return $this;
}
/**
* @param string $identifier
* @return IconInterface|null
*/
public function getIcon(string $identifier): ?IconInterface
{
return $this->icons[$identifier] ?? null;
}
}
@@ -0,0 +1,37 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
/**
* IconProviderInterface
*/
interface IconProviderInterface
{
/**
* @return string
*/
public function getIdentifier(): string;
/**
* @return string
*/
public function getName(): string;
/**
* @param string $identifier
* @return bool
*/
public function supports(string $identifier): bool;
/**
* @return IconList
*/
public function getIconList(): IconList;
}
@@ -0,0 +1,74 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* IoniconsProvider
*/
class IoniconsProvider implements IconProviderInterface
{
/**
* @return string
*/
public function getIdentifier(): string
{
return 'EXT:bootstrap_package/Resources/Public/Images/Icons/Ionicons/';
}
/**
* @return string
*/
public function getName(): string
{
return 'Ionicons';
}
/**
* @param string $identifier
* @return bool
*/
public function supports(string $identifier): bool
{
return 'EXT:bootstrap_package/Resources/Public/Images/Icons/Ionicons/' === $identifier;
}
/**
* @return IconList
*/
public function getIconList(): IconList
{
$icons = new IconList();
$directory = 'EXT:bootstrap_package/Resources/Public/Images/Icons/Ionicons/';
$path = GeneralUtility::getFileAbsFileName($directory);
$files = iterator_to_array(new \FilesystemIterator($path, \FilesystemIterator::KEY_AS_PATHNAME));
ksort($files);
foreach ($files as $key => $fileinfo) {
if ($fileinfo instanceof \SplFileInfo
&& $fileinfo->isFile()
&& strtolower($fileinfo->getExtension()) === 'svg'
) {
$icons->addIcon(
(new SvgIcon())
->setSrc($directory . $fileinfo->getFilename())
->setIdentifier($directory . $fileinfo->getFilename())
->setName($fileinfo->getBasename('.' . $fileinfo->getExtension()))
->setPreviewImage($directory . $fileinfo->getFilename())
);
}
}
return $icons;
}
}
@@ -0,0 +1,54 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Icons;
use BK2K\BootstrapPackage\Utility\SvgUtility;
/**
* SvgIcon
*/
class SvgIcon extends AbstractIcon
{
/**
* @var string
*/
protected $src;
/**
* @param string $src
* @return self
*/
public function setSrc(string $src): self
{
$this->src = $src;
return $this;
}
/**
* @return string
*/
public function getSrc(): string
{
return $this->src;
}
/**
* @return string
*/
public function render(): string
{
$src = $this->getSrc();
$height = $this->getHeight();
$width = $this->getWidth();
return SvgUtility::getInlineSvg($src, null, $width, $height);
}
}
@@ -0,0 +1,133 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Parser;
use TYPO3\CMS\Core\Cache\CacheManager;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* AbstractParser
*/
abstract class AbstractParser implements ParserInterface
{
/**
* @param string $extension
* @return bool
*/
public function supports(string $extension): bool
{
return false;
}
/**
* @param string $file
* @param array $settings
* @return string
*/
public function compile(string $file, array $settings): string
{
return $file;
}
/**
* @param string $file
* @param array $settings
* @return bool
*/
protected function isCached(string $file, array $settings): bool
{
$cacheIdentifier = $this->getCacheIdentifier($file, $settings);
$cacheFile = $this->getCacheFile($cacheIdentifier, $settings['cache']['tempDirectory']);
$cacheFileMeta = $this->getCacheFileMeta($cacheFile);
return file_exists($cacheFile) && file_exists($cacheFileMeta);
}
/**
* @param string $cacheFile
* @param string $cacheFileMeta
* @param array $settings
* @return bool
*/
protected function needsCompile(string $cacheFile, string $cacheFileMeta, array $settings): bool
{
$needCompilation = false;
$fileModificationTime = filemtime($cacheFile);
$metadata = unserialize((string) file_get_contents($cacheFileMeta), ['allowed_classes' => false]);
foreach ($metadata['files'] as $file) {
if (filemtime($file) > $fileModificationTime) {
$needCompilation = true;
break;
}
}
if (!$needCompilation && $settings['variables'] !== $metadata['variables']) {
$needCompilation = true;
}
if (!$needCompilation && $settings['options']['sourceMap'] !== $metadata['sourceMap']) {
$needCompilation = true;
}
return $needCompilation;
}
/**
* @param string $cacheIdentifier
* @param string $tempDirectory
* @return string
*/
protected function getCacheFile(string $cacheIdentifier, string $tempDirectory): string
{
return $tempDirectory . $cacheIdentifier . '.css';
}
/**
* @param string $filename
* @return string
*/
protected function getCacheFileMeta(string $filename)
{
return $filename . '.meta';
}
/**
* @param string $file
* @param array $settings
* @return string
*/
protected function getCacheIdentifier(string $file, array $settings): string
{
$filehash = md5($file);
$hash = hash('sha256', $filehash . serialize($settings));
$extension = pathinfo($file, PATHINFO_EXTENSION);
return basename($file, '.' . $extension) . '-' . $hash;
}
/**
* @return string
*/
protected function getPathSite(): string
{
return Environment::getPublicPath() . '/';
}
/**
* Clear all page caches
* @throws \TYPO3\CMS\Core\Cache\Exception\NoSuchCacheGroupException
*/
protected function clearPageCaches(): void
{
GeneralUtility::makeInstance(CacheManager::class)->flushCachesInGroup('pages');
}
}
@@ -0,0 +1,29 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Parser;
/**
* ParserInterface
*/
interface ParserInterface
{
/**
* @param string $extension
* @return bool
*/
public function supports(string $extension): bool;
/**
* @param string $file
* @param array $settings
* @return string
*/
public function compile(string $file, array $settings): string;
}
@@ -0,0 +1,171 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Parser;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\OutputStyle;
use ScssPhp\ScssPhp\Version;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\PathUtility;
/**
* ScssParser
*/
class ScssParser extends AbstractParser
{
/**
* Constructor
*/
public function __construct()
{
if (!class_exists('ScssPhp\ScssPhp\Version')) {
require_once ExtensionManagementUtility::extPath('bootstrap_package') . '/Contrib/scssphp/scss.inc.php';
}
}
/**
* @param string $extension
* @return bool
*/
public function supports(string $extension): bool
{
return $extension === 'scss';
}
/**
* @param string $file
* @param array $settings
* @return string
*/
public function compile(string $file, array $settings): string
{
$cacheIdentifier = $this->getCacheIdentifier($file, $settings);
$cacheFile = $this->getCacheFile($cacheIdentifier, $settings['cache']['tempDirectory']);
$cacheFileMeta = $this->getCacheFileMeta($cacheFile);
$compile = false;
if (!$this->isCached($file, $settings)
|| $this->needsCompile($cacheFile, $cacheFileMeta, $settings)) {
$compile = true;
}
if ($compile) {
$result = $this->parseFile($file, $settings);
GeneralUtility::writeFile(GeneralUtility::getFileAbsFileName($cacheFile), $result['css']);
GeneralUtility::writeFile(GeneralUtility::getFileAbsFileName($cacheFileMeta), serialize($result['cache']));
$this->clearPageCaches();
}
return $cacheFile;
}
/**
* @param string $file
* @param array $settings
* @return array
*/
protected function parseFile(string $file, array $settings): array
{
$scss = new Compiler();
$scss->setOutputStyle(OutputStyle::COMPRESSED);
$scss->addVariables($settings['variables']);
if ($settings['options']['sourceMap']) {
$scss->setSourceMap(Compiler::SOURCE_MAP_INLINE);
$scss->setSourceMapOptions([
'sourceMapRootpath' => $settings['cache']['tempDirectoryRelativeToRoot'],
'sourceMapBasepath' => '<PATH DOES NOT EXIST BUT SUPRESSES WARNINGS>'
]);
}
$absoluteFilename = $settings['file']['absolute'];
// Adds visual directory path of the initial file as import path
// This scenarios happens, when e.g. developing packages using the `path`
// repository feature of Composer - having one package in `public/typo3conf/ext/`
// and the other one symlinked in e.g. `packages/`.
// Since the PHP SCSS parser works on resolved real paths, the symlinked context is lost.
$visualImportPath = dirname($absoluteFilename);
$scss->addImportPath(function ($url) use ($visualImportPath): ?string {
// Resolve potential back paths manually using PathUtility::getCanonicalPath,
// but make sure we do not break out of TYPO3 application path using GeneralUtility::getFileAbsFileName
// Also resolve EXT: paths if given
$isTypo3Absolute = (strpos($url, 'EXT:') === 0) || PathUtility::isAbsolutePath($url);
$fileName = $isTypo3Absolute ? $url : $visualImportPath . '/' . $url;
$full = GeneralUtility::getFileAbsFileName(PathUtility::getCanonicalPath($fileName));
// The API forces us to check the existence of files paths, with or without url.
// We must only return a string if the file to be imported actually exists.
$hasExtension = (bool) preg_match('/[.]s?css$/', $url);
if (
is_file($file = $full . '.scss') ||
($hasExtension && is_file($file = $full))
) {
// We could trigger a deprecation message here at some point
return $file;
}
return null;
});
// Add extensions path to import paths, so that we can use paths relative to this directory to resolve imports
$scss->addImportPath(Environment::getExtensionsPath());
// Make paths in url() statements relative to site root
$absoluteFilePath = dirname($absoluteFilename);
$relativeFilePath = PathUtility::getAbsoluteWebPath($absoluteFilePath);
$absoluteBootstrapPackageThemePath =
ExtensionManagementUtility::extPath('bootstrap_package') . 'Resources/Public/Scss/Theme';
$relativeBootstrapPackageThemePath = PathUtility::getAbsoluteWebPath($absoluteBootstrapPackageThemePath);
$scss->registerFunction(
'url',
function ($args) use (
$scss,
$absoluteFilePath,
$relativeFilePath,
$absoluteBootstrapPackageThemePath,
$relativeBootstrapPackageThemePath
) : string {
$marker = $args[0][1];
$args[0][1] = '';
$result = $scss->compileValue($args[0]);
if (substr_compare($result, 'data:', 0, 5, true) !== 0) {
if (is_file(PathUtility::getCanonicalPath($absoluteFilePath . '/' . $result))) {
$result = PathUtility::getCanonicalPath($relativeFilePath . '/' . $result);
} elseif (is_file(PathUtility::getCanonicalPath($absoluteBootstrapPackageThemePath . '/' . $result))) {
$result = PathUtility::getCanonicalPath($relativeBootstrapPackageThemePath . '/' . $result);
}
$result = substr($result, 0, 1) === '/' ? substr($result, 1) : $result;
}
return 'url(' . $marker . $result . $marker . ')';
}
);
// Compile file
$compilationResult = $scss->compileString('@import "' . $absoluteFilename . '"');
$css = $compilationResult->getCss();
// Fix paths in url() statements to be relative to temp directory
$relativeTempPath = $settings['cache']['tempDirectoryRelativeToRoot'];
$search = '%url\s*\(\s*[\\\'"]?(?!(((?:https?:)?\/\/)|(?:data:?:)))([^\\\'")]+)[\\\'"]?\s*\)%';
$replace = 'url("' . $relativeTempPath . '$3")';
$css = (string) preg_replace($search, $replace, $css);
return [
'css' => $css,
'cache' => [
'version' => Version::VERSION,
'date' => date('r'),
'css' => $css,
'etag' => md5($css),
'files' => $compilationResult->getIncludedFiles(),
'variables' => $settings['variables'],
'sourceMap' => $settings['options']['sourceMap']
]
];
}
}
@@ -0,0 +1,60 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Service;
use TYPO3\CMS\Core\Configuration\ExtensionConfiguration;
use TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* BrandingService
*/
class BrandingService
{
public function __invoke(AfterPackageActivationEvent $event): void
{
if ($event->getPackageKey() === 'bootstrap_package') {
$this->setBackendStyling();
}
}
public function setBackendStyling(): void
{
if (class_exists(ExtensionConfiguration::class)) {
$extensionConfiguration = GeneralUtility::makeInstance(
ExtensionConfiguration::class
);
$backendConfiguration = $extensionConfiguration->get('backend');
if (!isset($backendConfiguration['loginLogo']) || trim($backendConfiguration['loginLogo']) === '') {
$backendConfiguration['loginLogo'] = 'EXT:bootstrap_package/Resources/Public/Images/Backend/login-logo.svg';
}
if (!isset($backendConfiguration['loginBackgroundImage']) || trim($backendConfiguration['loginBackgroundImage']) === '') {
$backendConfiguration['loginBackgroundImage'] = 'EXT:bootstrap_package/Resources/Public/Images/Backend/login-background-image.jpg';
}
if (!isset($backendConfiguration['backendLogo']) || trim($backendConfiguration['backendLogo']) === '') {
$backendConfiguration['backendLogo'] = 'EXT:bootstrap_package/Resources/Public/Images/Backend/backend-logo.svg';
}
// Workaround for
// https://review.typo3.org/c/Packages/TYPO3.CMS/+/62650
$reflection = new \ReflectionClass(ExtensionConfiguration::class);
$parameters = $reflection->getMethod('set')->getParameters();
$arguments = [];
$arguments[] = 'backend';
if (count($parameters) === 3) {
$arguments[] = '';
}
$arguments[] = $backendConfiguration;
$extensionConfiguration->set(...$arguments);
}
}
}
@@ -0,0 +1,142 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Service;
use BK2K\BootstrapPackage\Parser\ParserInterface;
use TYPO3\CMS\Core\Core\Environment;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* This service handles the parsing of css files for the frontend.
*/
class CompileService
{
/**
* @var string
*/
protected $tempDirectory = 'typo3temp/assets/bootstrappackage/css/';
/**
* @var string
*/
protected $tempDirectoryRelativeToRoot = '../../../../';
/**
* @param string $file
* @return string|null
* @throws \Exception
*/
public function getCompiledFile(string $file): ?string
{
$absoluteFile = GeneralUtility::getFileAbsFileName($file);
$configuration = $GLOBALS['TSFE']->tmpl->setup['plugin.']['tx_bootstrappackage.']['settings.'] ?? [];
// Ensure cache directory exists
if (!file_exists(Environment::getPublicPath() . '/' . $this->tempDirectory)) {
GeneralUtility::mkdir_deep(Environment::getPublicPath() . '/' . $this->tempDirectory);
}
// Settings
$settings = [
'file' => [
'absolute' => $absoluteFile,
'relative' => $file,
'info' => pathinfo($absoluteFile)
],
'cache' => [
'tempDirectory' => $this->tempDirectory,
'tempDirectoryRelativeToRoot' => $this->tempDirectoryRelativeToRoot,
],
'options' => [
'override' => $configuration['overrideParserVariables'] ? true: false,
'sourceMap' => $configuration['cssSourceMapping'] ? true : false,
'compress' => true
],
'variables' => []
];
// Parser
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/css']['parser'])
&& is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/css']['parser'])
) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/css']['parser'] as $className) {
$parser = GeneralUtility::makeInstance($className);
if ($parser instanceof ParserInterface
&& isset($settings['file']['info']['extension'])
&& $parser->supports($settings['file']['info']['extension'])
) {
if ($configuration['overrideParserVariables']) {
$settings['variables'] = $this->getVariablesFromConstants($settings['file']['info']['extension']);
}
try {
return $parser->compile($file, $settings);
} catch (\Exception $e) {
$this->clearCompilerCaches();
throw $e;
}
}
}
}
return null;
}
/**
* @param string $extension
* @return array
*/
protected function getVariablesFromConstants(string $extension): array
{
$constants = $this->getConstants();
$extension = strtolower($extension);
$variables = [];
// Fetch Google Font
$variables['google-webfont'] = 'sans-serif';
if (isset($constants['page.theme.googleFont.enable'])
&& (bool) $constants['page.theme.googleFont.enable']
&& isset($constants['page.theme.googleFont.font'])
&& $constants['page.theme.googleFont.font'] !== ''
) {
$variables['google-webfont'] = $constants['page.theme.googleFont.font'];
}
// Fetch settings
$prefix = 'plugin.bootstrap_package.settings.' . $extension . '.';
foreach ($constants as $constant => $value) {
if (strpos($constant, $prefix) === 0) {
$variables[substr($constant, strlen($prefix))] = $value;
}
}
return $variables;
}
/**
* @return array
*/
protected function getConstants(): array
{
if ($GLOBALS['TSFE']->tmpl->flatSetup === null
|| !is_array($GLOBALS['TSFE']->tmpl->flatSetup)
|| count($GLOBALS['TSFE']->tmpl->flatSetup) === 0) {
$GLOBALS['TSFE']->tmpl->generateConfig();
}
return $GLOBALS['TSFE']->tmpl->flatSetup;
}
/**
* Clear all caches for the compiler.
*/
protected function clearCompilerCaches(): void
{
GeneralUtility::rmdir(Environment::getPublicPath() . '/' . $this->tempDirectory, true);
}
}
@@ -0,0 +1,157 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Service;
use Psr\Http\Message\ResponseInterface;
use TYPO3\CMS\Core\Http\RequestFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* GoogleFontService
*/
class GoogleFontService
{
/**
* @var string
*/
protected $tempDirectory = 'typo3temp/assets/bootstrappackage/fonts';
/**
* @var string
*/
protected $googleFontApiUrl = 'fonts.googleapis.com/css';
/**
* @param string $file
* @return string|null
* @throws \Exception
*/
public function getCachedFile(string $file): ?string
{
if (!$this->supports($file)) {
return null;
}
if ($this->isCached($file)) {
return $this->getCssFileCacheName($file);
}
return $this->cacheFile($file) ? $this->getCssFileCacheName($file) : null;
}
/**
* @param string $file
* @return bool
*/
protected function cacheFile(string $file): bool
{
/** @var RequestFactory */
$requestFactory = GeneralUtility::makeInstance(RequestFactory::class);
/** @var ResponseInterface */
$response = $requestFactory->request($file, 'GET', [
'headers' => ['User-Agent' => 'Mozilla/5.0 Gecko/20100101 Firefox/94.0 AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36 Edg/97.0.1072.55']
]);
if ($response->getStatusCode() >= 300) {
return false;
} else {
$content = $response->getBody()->getContents();
}
// Ensure cache directory exists
GeneralUtility::mkdir_deep($this->tempDirectory . '/' . $this->getCacheIdentifier($file));
// Find and Download font files
$pattern = '%url\((.*?)\)%';
preg_match_all($pattern, $content, $matches, PREG_SET_ORDER);
$fontFiles = [];
foreach ($matches as $match) {
$fontFiles[$match[1]] = $match[1];
}
foreach ($fontFiles as $fontFile) {
$localFontFile = $this->getCacheDirectory($file) . '/' . basename($fontFile);
/** @var ResponseInterface */
$response = $requestFactory->request($fontFile);
if ($response->getStatusCode() >= 300) {
continue;
} else {
$fontFileContent = $response->getBody()->getContents();
}
file_put_contents($localFontFile, $fontFileContent);
GeneralUtility::fixPermissions($localFontFile);
$content = str_replace($fontFile, basename($fontFile), $content);
}
// Save CSS File
$cacheFile = $this->getCacheDirectory($file) . '/' . 'webfont.css';
file_put_contents(GeneralUtility::getFileAbsFileName($cacheFile), $content);
GeneralUtility::fixPermissions($cacheFile);
return true;
}
/**
* @param string $file
* @return bool
*/
protected function supports(string $file): bool
{
return (bool) strpos($file, $this->googleFontApiUrl);
}
/**
* @param string $file
* @return bool
*/
protected function isCached(string $file): bool
{
$cacheFile = $this->getCssFileCacheName($file);
$absoluteFile = GeneralUtility::getFileAbsFileName($cacheFile);
if (!file_exists($absoluteFile)) {
return false;
}
// Discard cache after 24 hours
if ((time() - (int) filemtime($absoluteFile)) > 86400) {
GeneralUtility::rmdir($this->getCacheDirectory($file));
return false;
}
return true;
}
/**
* @param string $file
* @return string
*/
protected function getCssFileCacheName(string $file): string
{
return $this->getCacheDirectory($file) . '/' . 'webfont.css';
}
/**
* @param string $file
* @return string
*/
protected function getCacheDirectory(string $file): string
{
return $this->tempDirectory . '/' . $this->getCacheIdentifier($file);
}
/**
* @param string $file
* @return string
*/
protected function getCacheIdentifier(string $file): string
{
return hash('sha256', $file);
}
}
@@ -0,0 +1,88 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Service;
use BK2K\BootstrapPackage\Icons\IconProviderInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* IconService
*/
class IconService
{
public function getIconSetItems(array &$configuration): void
{
$iconSets = [];
$iconSets[] = ['LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.none', ''];
$iconProviders = $this->getIconProviders();
foreach ($iconProviders as $iconProvider) {
$iconSets[] = [
$iconProvider->getName(),
$iconProvider->getIdentifier()
];
}
$configuration['items'] = $iconSets;
}
public function getIconItems(array &$configuration): void
{
$iconItems = [];
$iconItems[] = [
'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.none',
0,
'EXT:bootstrap_package/Resources/Public/Images/Icons/none.svg'
];
$iconSetField = $configuration['config']['itemsProcConfig']['iconSetField'] ?? 'icon_set';
$iconProviderIdentifier = $configuration['row'][$iconSetField][0] ?? '';
$iconProvider = $this->getIconProviderForIdentifier($iconProviderIdentifier);
if ($iconProvider !== null) {
$icons = $iconProvider->getIconList()->getIcons();
foreach ($icons as $icon) {
$iconItems[] = [
$icon->getName(),
$icon->getIdentifier(),
$icon->getPreviewImage()
];
}
}
$configuration['items'] = $iconItems;
}
public function getIconProviderForIdentifier(string $identifier): ?IconProviderInterface
{
$iconProviders = $this->getIconProviders();
foreach ($iconProviders as $iconProvider) {
if ($iconProvider->supports($identifier)) {
return $iconProvider;
}
}
return null;
}
public function getIconProviders(): array
{
$iconProviders = [];
if (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/icons']['provider'])
&& is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/icons']['provider'])
) {
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/bootstrap-package/icons']['provider'] as $className) {
$iconProviders[] = GeneralUtility::makeInstance($className);
}
}
return $iconProviders;
}
}
@@ -0,0 +1,173 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use BK2K\BootstrapPackage\Updates\Criteria\CreaterThanCriteria;
use BK2K\BootstrapPackage\Updates\Criteria\EqualStringCriteria;
use BK2K\BootstrapPackage\Updates\Criteria\InCriteria;
use BK2K\BootstrapPackage\Updates\Criteria\LikeCriteria;
use Doctrine\DBAL\Result;
use TYPO3\CMS\Core\Database\Connection;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
abstract class AbstractUpdate
{
const CONDITION_AND = 'AND';
const CONDITION_OR = 'OR';
/**
* @var string
*/
protected $title = '';
/**
* @var string
*/
protected $description = '';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var Connection|null
*/
protected $connection = null;
public function getIdentifier(): string
{
return get_class($this);
}
public function getTitle(): string
{
return $this->title;
}
public function getDescription(): string
{
return $this->description;
}
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class
];
}
protected function getConnection(): Connection
{
if ($this->connection === null) {
$this->connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($this->table);
}
return $this->connection;
}
protected function createQueryBuilder(): QueryBuilder
{
$queryBuilder = $this->getConnection()->createQueryBuilder();
$queryBuilder->getRestrictions()->removeAll();
return $queryBuilder;
}
protected function tableHasColumn(string $column): bool
{
/** @phpstan-ignore-next-line */
if (method_exists($this->getConnection(), 'createSchemaManager')) {
$schemaManager = $this->getConnection()->createSchemaManager();
} else {
$schemaManager = $this->getConnection()->getSchemaManager();
}
$tableColumns = $schemaManager->listTableColumns($this->table);
if (array_key_exists($column, $tableColumns)) {
return true;
}
return false;
}
protected function createCreaterThanCriteria(QueryBuilder $queryBuilder, string $field, int $value): CreaterThanCriteria
{
return (new CreaterThanCriteria($queryBuilder, $field))
->setValue($value);
}
protected function createEqualStringCriteria(QueryBuilder $queryBuilder, string $field, string $value): EqualStringCriteria
{
return (new EqualStringCriteria($queryBuilder, $field))
->setValue($value);
}
protected function createInCriteria(QueryBuilder $queryBuilder, string $field, array $values): InCriteria
{
return (new InCriteria($queryBuilder, $field))
->setValues($values);
}
protected function createLikeCriteria(QueryBuilder $queryBuilder, string $field, string $value): LikeCriteria
{
return (new LikeCriteria($queryBuilder, $field))
->setValue($value);
}
protected function getRecordsByCriteria(QueryBuilder $queryBuilder, array $criteria, string $condition = self::CONDITION_AND): array
{
$queryBuilder->select('*');
$queryBuilder->from($this->table);
if ($condition === self::CONDITION_AND) {
$queryBuilder->where(...$criteria);
} else {
$queryBuilder->orWhere(...$criteria);
}
/** @phpstan-ignore-next-line */
if (method_exists($queryBuilder, 'executeQuery')) {
$result = $queryBuilder->executeQuery();
} else {
/** @var Result $result */
/** @phpstan-ignore-next-line */
$result = $queryBuilder->execute();
}
/** @phpstan-ignore-next-line */
if (method_exists($result, 'fetchAllAssociative')) {
return $result->fetchAllAssociative(); /** @phpstan-ignore-line */
}
return $result->fetchAll(\PDO::FETCH_ASSOC); /** @phpstan-ignore-line */
}
protected function updateRecord(int $uid, array $values): void
{
$queryBuilder = $this->createQueryBuilder();
$queryBuilder->update($this->table)
->where($queryBuilder->expr()->eq('uid', $queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)));
foreach ($values as $field => $value) {
$queryBuilder->set($field, $value);
}
/** @phpstan-ignore-next-line */
if (method_exists($queryBuilder, 'executeStatement')) {
$queryBuilder->executeStatement();
} else {
$queryBuilder->execute();
}
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* AccordionContentElementUpdate
*/
class AccordionContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate accordion content element';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'CType';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_accordion')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_accordion')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => 'accordion']
);
}
return true;
}
}
@@ -0,0 +1,78 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* AccordionMediaOrientUpdate
*/
class AccordionMediaOrientUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate media orientation of accordion content element';
/**
* @var string
*/
protected $table = 'tx_bootstrappackage_accordion_item';
/**
* @var string
*/
protected $field = 'mediaorient';
/**
* @var array
*/
protected $mapping = [
0 => 'left',
1 => 'right'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
if (null !== $newValue = $this->mapValues(intval($record[$this->field]))) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => $newValue]
);
}
}
return true;
}
protected function mapValues(int $value): ?string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return null;
}
}
@@ -0,0 +1,89 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* BackendLayoutUpdate
*/
class BackendLayoutUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate backend layouts';
/**
* @var string
*/
protected $table = 'pages';
/**
* @var array
*/
protected $mapping = [
'pagets__clean' => 'pagets__simple',
'pagets__default_clean' => 'pagets__simple',
'pagets__default_2_columns' => 'pagets__2_columns',
'pagets__default_2_columns_25_75' => 'pagets__2_columns_25_75',
'pagets__default_2_columns_50_50' => 'pagets__2_columns_50_50',
'pagets__default_2_columns_offset_right' => 'pagets__2_columns_offset_right',
'pagets__default_3_columns' => 'pagets__3_columns',
'pagets__default_subnavigation_right' => 'pagets__subnavigation_right',
'pagets__default_subnavigation_right_2_columns' => 'pagets__subnavigation_right_2_columns',
'pagets__default_subnavigation_left' => 'pagets__subnavigation_left',
'pagets__default_subnavigation_left_2_columns' => 'pagets__subnavigation_left_2_columns'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createInCriteria($queryBuilder, 'backend_layout', array_keys($this->mapping)),
$this->createInCriteria($queryBuilder, 'backend_layout_next_level', array_keys($this->mapping)),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createInCriteria($queryBuilder, 'backend_layout', array_keys($this->mapping)),
$this->createInCriteria($queryBuilder, 'backend_layout_next_level', array_keys($this->mapping)),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'backend_layout' => $this->mapValues(strval($record['backend_layout'])),
'backend_layout_next_level' => $this->mapValues(strval($record['backend_layout_next_level']))
]
);
}
return true;
}
protected function mapValues(string $value): string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return $value;
}
}
@@ -0,0 +1,75 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* BulletContentElementUpdate
*/
class BulletContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate bullet content element';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createEqualStringCriteria($queryBuilder, 'CType', 'bullets'),
$this->createInCriteria($queryBuilder, 'layout', [100, 110, 120, 130]),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createEqualStringCriteria($queryBuilder, 'CType', 'bullets'),
$this->createInCriteria($queryBuilder, 'layout', [100, 110, 120, 130]),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'layout' => (string) 0,
'bullets_type' => (string) $this->mapValues(intval($record['layout']))
]
);
}
return true;
}
protected function mapValues(int $layout): int
{
$mapping = [
110 => 1
];
if (array_key_exists($layout, $mapping)) {
return $mapping[$layout];
}
return 0;
}
}
@@ -0,0 +1,78 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* CarouselContentElementUpdate
*/
class CarouselContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate carousel content element';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'CType', 'bootstrap_package_carousel')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'CType', 'bootstrap_package_carousel')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'layout' => $this->resetLayout(intval($record['layout'])),
'CType' => $this->mapValues(intval($record['layout']))
]
);
}
return true;
}
protected function resetLayout(int $layout): string
{
if (in_array($layout, [100, 110, 120], true)) {
return '0';
}
return (string)$layout;
}
protected function mapValues(int $layout): string
{
$mapping = [
110 => 'carousel_small',
120 => 'carousel_fullscreen'
];
if (array_key_exists($layout, $mapping)) {
return $mapping[$layout];
}
return 'carousel';
}
}
@@ -0,0 +1,55 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* CarouselItemLayoutUpdate
*/
class CarouselItemLayoutUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate carousel item layouts';
/**
* @var string
*/
protected $table = 'tx_bootstrappackage_carousel_item';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'layout', '')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'layout', '')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
['layout' => 'custom']
);
}
return true;
}
}
@@ -0,0 +1,67 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* CarouselItemTypeUpdate
*/
class CarouselItemTypeUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate carousel item types';
/**
* @var string
*/
protected $table = 'tx_bootstrappackage_carousel_item';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, 'item_type', ['textandimage', 'backgroundimage'])];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, 'item_type', ['textandimage', 'backgroundimage'])];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
['item_type' => $this->mapValues(strval($record['item_type']))]
);
}
return true;
}
protected function mapValues(string $type): string
{
$mapping = [
'textandimage' => 'text_and_image',
'backgroundimage' => 'background_image'
];
if (array_key_exists($type, $mapping)) {
return $mapping[$type];
}
return 'header';
}
}
@@ -0,0 +1,37 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
use TYPO3\CMS\Core\Database\Query\QueryBuilder;
abstract class AbstractCriteria
{
/**
* @var QueryBuilder
*/
protected $queryBuilder;
/**
* @var string
*/
protected $field;
public function __construct(QueryBuilder $queryBuilder, string $field)
{
$this->queryBuilder = $queryBuilder;
$this->field = $field;
}
public function getField(): string
{
return $this->field;
}
}
@@ -0,0 +1,38 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
class CreaterThanCriteria extends AbstractCriteria implements CriteriaInterface
{
/**
* @var int
*/
protected $value = 0;
public function setValue(int $value): self
{
$this->value = $value;
return $this;
}
public function getValue(): int
{
return $this->value;
}
public function __toString(): string
{
return $this->queryBuilder->expr()->gt(
$this->getField(),
$this->getValue()
);
}
}
@@ -0,0 +1,16 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
interface CriteriaInterface
{
public function __toString(): string;
}
@@ -0,0 +1,43 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
use TYPO3\CMS\Core\Database\Connection;
class EqualStringCriteria extends AbstractCriteria implements CriteriaInterface
{
/**
* @var string
*/
protected $value = '';
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getValue(): string
{
return $this->value;
}
public function __toString(): string
{
return $this->queryBuilder->expr()->eq(
$this->getField(),
$this->queryBuilder->createNamedParameter(
$this->getValue(),
Connection::PARAM_STR
)
);
}
}
@@ -0,0 +1,43 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
use TYPO3\CMS\Core\Database\Connection;
class InCriteria extends AbstractCriteria implements CriteriaInterface
{
/**
* @var array
*/
protected $values = [];
public function setValues(array $values): self
{
$this->values = $values;
return $this;
}
public function getValues(): array
{
return $this->values;
}
public function __toString(): string
{
return $this->queryBuilder->expr()->in(
$this->getField(),
$this->queryBuilder->createNamedParameter(
$this->getValues(),
Connection::PARAM_STR_ARRAY
)
);
}
}
@@ -0,0 +1,38 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates\Criteria;
class LikeCriteria extends AbstractCriteria implements CriteriaInterface
{
/**
* @var string
*/
protected $value = '';
public function setValue(string $value): self
{
$this->value = $value;
return $this;
}
public function getValue(): string
{
return $this->value;
}
public function __toString(): string
{
return $this->queryBuilder->expr()->like(
$this->getField(),
$this->queryBuilder->expr()->literal($this->getValue())
);
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* ExternalMediaContentElementUpdate
*/
class ExternalMediaContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate external media content element';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'CType';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_external_media')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_external_media')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => 'external_media']
);
}
return true;
}
}
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* FrameClassToBackgroundUpdate
*/
class FrameClassToBackgroundUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate obsolete frame_class options to background color';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'frame_class';
/**
* @var array
*/
protected $mapping = [
'well' => 'light',
'jumbotron' => 'primary'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
if (null !== $newValue = $this->mapValues(strval($record[$this->field]))) {
$this->updateRecord(
(int) $record['uid'],
[
$this->field => 'default',
'background_color_class' => $newValue
]
);
}
}
return true;
}
protected function mapValues(string $value): ?string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return null;
}
}
@@ -0,0 +1,81 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* FrameClassUpdate
*/
class FrameClassUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate the field "section_frame" for all content elements to "frame_class"';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
if (!$this->tableHasColumn('section_frame')) {
return false;
}
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createCreaterThanCriteria($queryBuilder, 'section_frame', 0)];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createCreaterThanCriteria($queryBuilder, 'section_frame', 0)];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'section_frame' => '0',
'frame_class' => $this->mapSectionFrame(intval($record['section_frame']))
]
);
}
return true;
}
protected function mapSectionFrame(int $sectionFrame): string
{
$mapping = [
0 => 'default',
5 => 'ruler-before',
6 => 'ruler-after',
10 => 'indent',
11 => 'indent-left',
12 => 'indent-right',
20 => 'well',
21 => 'jumbotron',
66 => 'none'
];
if (array_key_exists($sectionFrame, $mapping)) {
return $mapping[$sectionFrame];
}
return 'custom-' . $sectionFrame;
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* ListGroupContentElementUpdate
*/
class ListGroupContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate list group content element';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'CType';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_listgroup')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_listgroup')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => 'listgroup']
);
}
return true;
}
}
@@ -0,0 +1,74 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* PanelContentElementUpdate
*/
class PanelContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate panel content element';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'CType', 'bootstrap_package_panel')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, 'CType', 'bootstrap_package_panel')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'CType' => 'panel',
'layout' => '0',
'panel_class' => $this->mapValues(intval($record['layout']))
]
);
}
return true;
}
protected function mapValues(int $layout): string
{
$mapping = [
110 => 'primary',
120 => 'success',
130 => 'info',
140 => 'warning',
150 => 'danger',
];
if (array_key_exists($layout, $mapping)) {
return $mapping[$layout];
}
return 'default';
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TabContentElementUpdate
*/
class TabContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate tab content element';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'CType';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_tab')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_tab')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => 'tab']
);
}
return true;
}
}
@@ -0,0 +1,78 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TabMediaOrientUpdate
*/
class TabMediaOrientUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate media orientation of tab content element';
/**
* @var string
*/
protected $table = 'tx_bootstrappackage_tab_item';
/**
* @var string
*/
protected $field = 'mediaorient';
/**
* @var array
*/
protected $mapping = [
0 => 'left',
1 => 'right'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
if (null !== $newValue = $this->mapValues(intval($record[$this->field]))) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => $newValue]
);
}
}
return true;
}
protected function mapValues(int $value): ?string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return null;
}
}
@@ -0,0 +1,77 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TableContentElementUpdate
*/
class TableContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate table content element';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createEqualStringCriteria($queryBuilder, 'CType', 'table'),
$this->createInCriteria($queryBuilder, 'layout', [100, 110, 120, 130, 140, 150]),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createEqualStringCriteria($queryBuilder, 'CType', 'table'),
$this->createInCriteria($queryBuilder, 'layout', [100, 110, 120, 130, 140, 150]),
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[
'layout' => '0',
'table_class' => $this->mapValues(intval($record['layout']))
]
);
}
return true;
}
protected function mapValues(int $layout): string
{
$mapping = [
100 => '',
110 => '',
120 => 'striped',
130 => 'bordered',
140 => 'hover',
150 => 'condensed',
];
return $mapping[$layout];
}
}
@@ -0,0 +1,60 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TexticonContentElementUpdate
*/
class TexticonContentElementUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate text and icon content element';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'CType';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_texticon')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createEqualStringCriteria($queryBuilder, $this->field, 'bootstrap_package_texticon')];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => 'texticon']
);
}
return true;
}
}
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TexticonIconUpdate
*/
class TexticonIconUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate text and icon identifier and name';
/**
* @var string
*/
protected $table = 'tt_content';
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createLikeCriteria($queryBuilder, 'icon', 'Glyphicons%'),
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%')
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [
$this->createLikeCriteria($queryBuilder, 'icon', 'Glyphicons%'),
$this->createLikeCriteria($queryBuilder, 'icon', 'Ionicons%')
];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria, AbstractUpdate::CONDITION_OR);
foreach ($records as $record) {
$icon = explode('__', strval($record['icon']));
$this->updateRecord(
(int) $record['uid'],
[
'icon' => 'EXT:bootstrap_package/Resources/Public/Images/Icons/' . $icon[0] . '/' . $icon[1] . '.svg',
'icon_set' => 'EXT:bootstrap_package/Resources/Public/Images/Icons/' . $icon[0] . '/',
]
);
}
return true;
}
}
@@ -0,0 +1,80 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TexticonSizeUpdate
*/
class TexticonSizeUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate text and icon size options';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'icon_size';
/**
* @var array
*/
protected $mapping = [
0 => 'default',
1 => 'medium',
2 => 'large',
3 => 'awesome'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
if (null !== $newValue = $this->mapValues(intval($record[$this->field]))) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => $newValue]
);
}
}
return true;
}
protected function mapValues(int $value): ?string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return null;
}
}
@@ -0,0 +1,79 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Updates;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
/**
* TexticonTypeUpdate
*/
class TexticonTypeUpdate extends AbstractUpdate implements UpgradeWizardInterface, RepeatableInterface
{
/**
* @var string
*/
protected $title = 'EXT:bootstrap_package: Migrate text and icon type options';
/**
* @var string
*/
protected $table = 'tt_content';
/**
* @var string
*/
protected $field = 'icon_type';
/**
* @var array
*/
protected $mapping = [
0 => 'default',
1 => 'square',
2 => 'circle'
];
public function updateNecessary(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
return (bool) count($records);
}
public function executeUpdate(): bool
{
$queryBuilder = $this->createQueryBuilder();
$criteria = [$this->createInCriteria($queryBuilder, $this->field, array_keys($this->mapping))];
$records = $this->getRecordsByCriteria($queryBuilder, $criteria);
foreach ($records as $record) {
if (null !== $newValue = $this->mapValues(intval($record[$this->field]))) {
$this->updateRecord(
(int) $record['uid'],
[$this->field => $newValue]
);
}
}
return true;
}
protected function mapValues(int $value): ?string
{
if (array_key_exists($value, $this->mapping)) {
return $this->mapping[$value];
}
return null;
}
}
@@ -0,0 +1,21 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Userfuncs;
use TYPO3\CMS\Backend\Utility\BackendUtility;
class Tca
{
public function timelineItemLabel(array &$parameters): void
{
$record = BackendUtility::getRecord($parameters['table'], $parameters['row']['uid']) ?? [];
$parameters['title'] = ($record['date'] ?? '') . ' - ' . ($record['header'] ?? '');
}
}
@@ -0,0 +1,142 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Utility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* ExternalMediaUtility
*/
class ExternalMediaUtility
{
/**
* @var array Provider that can be handled, the provider is equal the hostname and needs a process function
*/
protected $mediaProvider = [
'youtube',
'youtu',
'vimeo'
];
/**
* Get the embed code for the given url if possible
* and add a css class on the iframe
*
* @param string $url
* @param string $class
* @return string|null
*/
public function getEmbedCode(string $url, string $class): ?string
{
// Prepare url
$url = $this->setProtocolToHttps($url);
// Get method
$method = $this->getMethod($url);
if ($method !== null) {
$embedUrl = $this->{$method}($url);
if ($embedUrl !== null) {
return '<iframe ' . GeneralUtility::implodeAttributes([
'class' => $class,
'src' => $embedUrl,
'frameborder' => '0'
], true) . ' allowfullscreen></iframe>';
}
}
return null;
}
/**
* Resolves if possible a method name to process the url
*
* @param string $url
* @return string|null
*/
protected function getMethod(string $url): ?string
{
$urlInformation = @parse_url($url);
if (is_array($urlInformation) && isset($urlInformation['host'])) {
$hostName = GeneralUtility::trimExplode('.', $urlInformation['host'], true);
foreach ($this->mediaProvider as $provider) {
$functionName = 'process' . ucfirst($provider);
if (in_array($provider, $hostName, true) && is_callable([$this, $functionName])) {
return $functionName;
}
}
}
return null;
}
/**
* Processes YouTube url
*
* @param string $url
* @return string|null
*/
protected function processYoutube(string $url): ?string
{
$firstMatches = [];
$pattern = '%^(?:https?://)?(?:www\.)?(?:youtu\.be/|youtube\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=))([^"&?/ ]{11})(?:.+)?$%xs';
if ((bool) preg_match($pattern, $url, $firstMatches)) {
$toEmbed = $firstMatches[1];
$patternForAdditionalParams = '%^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=))(?:[^"&?\/ ]{11})(.+)?(?:.+)?$%xs';
$secondMatches = [];
if (preg_match($patternForAdditionalParams, $url, $secondMatches) > 1) {
$toEmbed .= '?' . substr($secondMatches[1], 1);
}
return 'https://www.youtube-nocookie.com/embed/' . $toEmbed;
}
return null;
}
/**
* Process YouTube short url
*
* @param string $url
* @return string|null
*/
protected function processYoutu(string $url): ?string
{
return $this->processYoutube($url);
}
/**
* Processes Vimeo url
*
* @param string $url
* @return string
*/
protected function processVimeo(string $url): ?string
{
$matches = [];
if ((bool) preg_match('/[\\/#](\\d+)$/', $url, $matches)) {
return 'https://player.vimeo.com/video/' . $matches[1];
}
return null;
}
/**
* Change every protocol to https and add it if missing
*
* @param string $url URL
* @return string
*/
protected function setProtocolToHttps(string $url): string
{
$processUrl = trim($url);
if (strpos($url, 'http://') === 0) {
$processUrl = substr($processUrl, 7);
} elseif (strpos($processUrl, 'https://') === 0) {
$processUrl = substr($processUrl, 8);
} elseif (strpos($processUrl, '//') === 0) {
$processUrl = substr($processUrl, 2);
}
return 'https://' . $processUrl;
}
}
@@ -0,0 +1,246 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Utility;
/**
* Calculate image variants
*/
class ImageVariantsUtility
{
/**
* @var array
*/
protected static $allowedVariantProperties = [
'breakpoint',
'width',
'aspectRatio',
'sizes',
];
/**
* @var array
*/
protected static $defaultVariants = [
'default' => [
'breakpoint' => 1400,
'width' => 1280
],
'xlarge' => [
'breakpoint' => 1200,
'width' => 1100
],
'large' => [
'breakpoint' => 992,
'width' => 920
],
'medium' => [
'breakpoint' => 768,
'width' => 680
],
'small' => [
'breakpoint' => 576,
'width' => 500
],
'extrasmall' => [
'width' => 374
]
];
/**
* @param array|null $variants
* @param array|null $multiplier
* @param array|null $gutters
* @param array|null $corrections
* @param float|null $aspectRatio
* @return array
*/
public static function getImageVariants(?array $variants = null, ?array $multiplier = null, ?array $gutters = null, ?array $corrections = null, ?float $aspectRatio = null): array
{
$variants = $variants !== null ? $variants : [];
$variants = self::processVariants($variants);
$variants = self::processResolutions($variants);
if ($gutters !== null) {
$variants = self::removeGutters($variants, $gutters);
}
if ($multiplier !== null) {
$variants = self::processMultiplier($variants, $multiplier);
}
if ($corrections !== null) {
$variants = self::processCorrections($variants, $corrections);
}
if ($aspectRatio !== null) {
$variants = self::processAspectRatio($variants, $aspectRatio);
}
return $variants;
}
/**
* @param array $variants
* @return array
*/
protected static function processResolutions(array $variants): array
{
foreach ($variants as $variant => $properties) {
if (!array_key_exists('sizes', $properties)) {
$properties['sizes'] = [];
}
$properties['sizes'] = self::processSizes($properties['sizes']);
$variants[$variant] = $properties;
}
return $variants;
}
/**
* @param array $sizes
* @return array
*/
protected static function processSizes(array $sizes): array
{
$resultSizes = [];
$workingSizes = [];
foreach ($sizes as $key => $settings) {
if (!array_key_exists('multiplier', $settings) ||
!is_numeric($settings['multiplier']) ||
$settings['multiplier'] < 1 ||
!self::isValidSizeKey($key)
) {
continue;
}
$settings['multiplier'] = gettype($settings['multiplier']) === 'double' ? $settings['multiplier'] : (int) $settings['multiplier'];
$workingSizes[substr($key, 0, -1) . ''] = [
'multiplier' => 1 * $settings['multiplier'],
];
}
if (!isset($workingSizes['1'])) {
$workingSizes['1'] = ['multiplier' => 1];
}
ksort($workingSizes);
foreach ($workingSizes as $workingKey => $workingSettings) {
$resultSizes[$workingKey . 'x'] = $workingSettings;
}
return $resultSizes;
}
/**
* @param array $variants
* @return array
*/
protected static function processVariants(array $variants): array
{
$variants = count($variants) > 0 ? $variants : self::$defaultVariants;
foreach ($variants as $variant => $properties) {
if (!is_array($properties)) {
unset($variants[$variant]);
continue;
}
foreach ($properties as $key => $value) {
if (!in_array($key, self::$allowedVariantProperties, true)) {
unset($variants[$variant][$key]);
continue;
}
if ($key === 'sizes') {
continue;
} elseif ($key === 'aspectRatio') {
if (is_numeric($value) && $value > 0) {
$variants[$variant][$key] = (float) $value;
} else {
unset($variants[$variant][$key]);
}
} elseif (is_numeric($value) && $value > 0) {
$variants[$variant][$key] = (int) $value;
} else {
unset($variants[$variant][$key]);
}
}
if (count($variants[$variant]) === 0 || !isset($variants[$variant]['width'])) {
unset($variants[$variant]);
}
}
return $variants;
}
/**
* @param array $variants
* @param array $gutters
* @return array
*/
protected static function removeGutters(array $variants, array $gutters): array
{
foreach ($gutters as $variant => $value) {
if (is_numeric($value) && $value > 0 && isset($variants[$variant]['width'])) {
$variants[$variant]['width'] = (int) ceil($variants[$variant]['width'] - (float) $value);
}
}
return $variants;
}
/**
* @param array $variants
* @param array $multiplier
* @return array
*/
protected static function processMultiplier(array $variants, array $multiplier): array
{
foreach ($multiplier as $variant => $value) {
if (is_numeric($value) && $value > 0 && isset($variants[$variant]['width'])) {
$variants[$variant]['width'] = (int) ceil($variants[$variant]['width'] * (float) $value);
}
}
return $variants;
}
/**
* @param array $variants
* @param array $corrections
* @return array
*/
protected static function processCorrections(array $variants, array $corrections): array
{
foreach ($corrections as $variant => $value) {
if (is_numeric($value) && $value > 0 && isset($variants[$variant]['width'])) {
$variants[$variant]['width'] -= $value;
}
}
return $variants;
}
/**
* @param array $variants
* @param float $aspectRatio
* @return array
*/
protected static function processAspectRatio(array $variants, float $aspectRatio): array
{
if ($aspectRatio > 0) {
foreach ($variants as $variant => $value) {
$variants[$variant]['aspectRatio'] = $aspectRatio;
}
}
return $variants;
}
/**
* @param mixed $key
* @return bool
*/
public static function isValidSizeKey($key): bool
{
return !(
!is_string($key) ||
substr($key, -1, 1) !== 'x' ||
!is_numeric(substr($key, 0, -1)) ||
(float) substr($key, 0, -1) < 1 ||
(float) substr($key, 0, -1) !== round((float) substr($key, 0, -1), 1)
);
}
}
@@ -0,0 +1,128 @@
<?php
declare(strict_types = 1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\Utility;
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
use TYPO3\CMS\Core\Resource\FileInterface;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Service\ImageService;
/**
* SvgUtility
*/
class SvgUtility
{
/**
* @param string $src
* @param FileInterface|null $image
* @param int|null $height
* @param int|null $width
* @param string|null $class
* @return string
*/
public static function getInlineSvg(
string $src = '',
?FileInterface $image = null,
?int $width = null,
?int $height = null,
?string $class = null
): string {
if (($src === '' && $image === null) || ($src !== '' && $image !== null)) {
throw new \Exception('You must either specify a string src or a File object.', 1530601100);
}
try {
$imageService = self::getImageService();
$image = $imageService->getImage($src, $image, false);
if ($image->getProperty('extension') !== 'svg') {
return '';
}
$svgContent = $image->getContents();
$svgContent = trim((string) preg_replace('/<script[\s\S]*?>[\s\S]*?<\/script>/i', '', $svgContent));
// Exit if file does not contain content
if ($svgContent === '') {
return '';
}
// Disables the functionality to allow external entities to be loaded when parsing the XML, must be kept
$previousValueOfEntityLoader = false;
if (PHP_MAJOR_VERSION < 8) {
$previousValueOfEntityLoader = libxml_disable_entity_loader(true);
}
$svgElement = simplexml_load_string($svgContent);
if (PHP_MAJOR_VERSION < 8) {
libxml_disable_entity_loader($previousValueOfEntityLoader);
}
if (!$svgElement instanceof \SimpleXMLElement) {
return '';
}
// Override attributes
$class = htmlspecialchars($class ?? '');
$svgElement = self::setAttribute($svgElement, 'class', $class);
$width = intval($width) > 0 ? (string) intval($width) : null;
$svgElement = self::setAttribute($svgElement, 'width', $width);
$height = intval($height) > 0 ? (string) intval($height) : null;
$svgElement = self::setAttribute($svgElement, 'height', $height);
// remove xml version tag
$domXml = dom_import_simplexml($svgElement);
/** @phpstan-ignore-next-line */
if (!$domXml instanceof \DOMElement || !$domXml->ownerDocument instanceof \DOMDocument) {
return '';
}
return (string) $domXml->ownerDocument->saveXML($domXml->ownerDocument->documentElement);
} catch (ResourceDoesNotExistException $e) {
// thrown if file does not exist
throw new \Exception($e->getMessage(), 1530601100, $e);
} catch (\UnexpectedValueException $e) {
// thrown if a file has been replaced with a folder
throw new \Exception($e->getMessage(), 1530601101, $e);
} catch (\RuntimeException $e) {
// RuntimeException thrown if a file is outside of a storage
throw new \Exception($e->getMessage(), 1530601102, $e);
} catch (\InvalidArgumentException $e) {
// thrown if file storage does not exist
throw new \Exception($e->getMessage(), 1530601103, $e);
}
}
/**
* @param \SimpleXMLElement $element
* @param string $attribute
* @param string $value
*/
protected static function setAttribute(\SimpleXMLElement $element, string $attribute, ?string $value): \SimpleXMLElement
{
if ($value !== null) {
if (isset($element->attributes()->$attribute)) {
$element->attributes()->$attribute = $value;
} else {
$element->addAttribute($attribute, $value);
}
}
return $element;
}
/**
* Return an instance of ImageService using object manager
*
* @return ImageService
*/
protected static function getImageService(): ImageService
{
return GeneralUtility::makeInstance(ImageService::class);
}
}
@@ -0,0 +1,82 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
use TYPO3\CMS\Core\Page\AssetCollector;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ImageInfoViewHelper
*/
class ImageInfoViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var array<string, int|string>
*/
protected static $supportedProperties = [
'width' => 0,
'height' => 1,
'type' => 3,
'origFile' => 'origFile',
'origFile_mtime' => 'origFile_mtime',
];
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
$this->registerArgument('src', 'string', 'Path to a file');
$this->registerArgument('property', 'string', 'Possible values: width, height, type, origFile, origFile_mtime');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$src = $arguments['src'];
$property = $arguments['property'];
if (!array_key_exists($property, self::$supportedProperties)) {
throw new \InvalidArgumentException('The value of property is invalid. Valid properties are: width, height, type, origFile or origFile_mtime');
}
$assetCollector = self::getAssetCollector();
$mediaOnPage = $assetCollector->getMedia();
foreach ($mediaOnPage as $mediaName => $mediaData) {
if (strpos($src, $mediaName) !== false) {
return (string) $mediaData[self::$supportedProperties[$property]];
}
}
return '';
}
/**
* @return AssetCollector
*/
protected static function getAssetCollector(): AssetCollector
{
return GeneralUtility::makeInstance(AssetCollector::class);
}
}
@@ -0,0 +1,53 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
use BK2K\BootstrapPackage\Utility\ImageVariantsUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ImageVariantsViewHelper
*/
class ImageVariantsViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('as', 'string', 'Name of variable to create.', true);
$this->registerArgument('variants', 'array', 'Variants for responsive images.', false);
$this->registerArgument('multiplier', 'array', 'Multiplier to calculate responsive image widths.', false);
$this->registerArgument('gutters', 'array', 'Gutter that needs to be respected when calculating responsive image widths.', false);
$this->registerArgument('corrections', 'array', 'Corrections to be applied after calculation of image widths.', false);
$this->registerArgument('aspectRatio', 'float', 'Set aspect ratio for all variants.', false);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$variants = ImageVariantsUtility::getImageVariants($arguments['variants'], $arguments['multiplier'], $arguments['gutters'], $arguments['corrections'], $arguments['aspectRatio']);
$renderingContext->getVariableProvider()->add($arguments['as'], $variants);
return '';
}
}
@@ -0,0 +1,123 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Data;
use Psr\Http\Message\ServerRequestInterface;
use TYPO3\CMS\Core\Pagination\ArrayPaginator;
use TYPO3\CMS\Core\Pagination\SimplePagination;
use TYPO3\CMS\Core\Utility\ArrayUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Pagination\QueryResultPaginator;
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
use TYPO3\CMS\Fluid\View\StandaloneView;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* PaginateViewHelper
*/
class PaginateViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('id', 'string', 'Identifier of the pagination', true);
$this->registerArgument('objects', 'mixed', 'Object', true);
$this->registerArgument('configuration', 'array', 'configuration', false, ['itemsPerPage' => 10, 'insertAbove' => false, 'insertBelow' => true]);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
* @throws \Exception
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$objects = $arguments['objects'];
if (!($objects instanceof QueryResultInterface || is_array($objects))) {
throw new \UnexpectedValueException('Supplied file object type ' . get_class($objects) . ' must be QueryResultInterface or be an array.', 1623322979);
}
$configuration = [
'itemsPerPage' => 10,
'insertAbove' => false,
'insertBelow' => true,
'section' => ''
];
ArrayUtility::mergeRecursiveWithOverrule($configuration, $arguments['configuration'], false);
$id = $arguments['id'];
$itemsPerPage = (int) $configuration['itemsPerPage'];
$currentPage = (int) (self::getRequest()->getQueryParams()['paginate'][$id]['page'] ?? 1);
if ($objects instanceof QueryResultInterface) {
$paginator = new QueryResultPaginator($objects, $currentPage, $itemsPerPage);
} else {
$paginator = new ArrayPaginator($objects, $currentPage, $itemsPerPage);
}
$pagination = new SimplePagination($paginator);
$paginationView = self::getPaginationTemplateObject();
$paginationView->assignMultiple(
[
'id' => $id,
'paginator' => $paginator,
'pagination' => $pagination,
'configuration' => $configuration
]
);
$paginationRendered = $paginationView->render();
$variableProvider = $renderingContext->getVariableProvider();
$variableProvider->add('paginator', $paginator);
$contents = [];
$contents[] = $configuration['insertAbove'] === true ? $paginationRendered : '';
$contents[] = $renderChildrenClosure();
$contents[] = $configuration['insertBelow'] === true ? $paginationRendered : '';
$variableProvider->remove('paginator');
return implode('', $contents);
}
protected static function getPaginationTemplateObject(): StandaloneView
{
/** @var StandaloneView $view */
$view = GeneralUtility::makeInstance(StandaloneView::class);
$view->setLayoutRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Layouts')]);
$view->setPartialRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Partials')]);
$view->setTemplateRootPaths([GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Templates')]);
$view->setTemplatePathAndFilename(GeneralUtility::getFileAbsFileName('EXT:bootstrap_package/Resources/Private/Templates/ViewHelpers/Paginate/Index.html'));
return $view;
}
protected static function getRequest(): ServerRequestInterface
{
return $GLOBALS['TYPO3_REQUEST'];
}
}
@@ -0,0 +1,64 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ExplodeViewHelper
*/
class ExplodeViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('data', 'string', 'The input string', true);
$this->registerArgument('as', 'string', 'Name of variable to create', false, 'items');
$this->registerArgument('delimiter', 'string', 'The boundary string', false, "\n");
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$content = '';
if (isset($arguments['data'])) {
$variableProvider = $renderingContext->getVariableProvider();
$items = GeneralUtility::trimExplode($arguments['delimiter'], $arguments['data']);
$variableProvider->add($arguments['as'], $items);
$content = $renderChildrenClosure();
$variableProvider->remove($arguments['as']);
}
return $content;
}
}
@@ -0,0 +1,66 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers;
use BK2K\BootstrapPackage\Utility\ExternalMediaUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ExternalMediaViewHelper
*/
class ExternalMediaViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('url', 'string', 'External media url');
$this->registerArgument('class', 'string', 'CSS class rendered on the generated iframe code');
}
/**
* Checks if the URL is a valid YouTube/Vimeo Link is. If the video id can
* be extracted the embed code will be returned, else the content of the
* ViewHelper will be displayed.
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$variableProvider = $renderingContext->getVariableProvider();
$externalMediaUtility = GeneralUtility::makeInstance(ExternalMediaUtility::class);
$externalMedia = $externalMediaUtility->getEmbedCode($arguments['url'], $arguments['class']);
$variableProvider->add('externalMedia', $externalMedia);
$content = $renderChildrenClosure();
$variableProvider->remove('externalMedia');
return $content;
}
}
@@ -0,0 +1,87 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers;
use TYPO3\CMS\Core\Resource\FileRepository;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* FalViewHelper
*/
class FalViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('data', 'array', 'Data of current record', true);
$this->registerArgument('table', 'string', 'table', false, 'tt_content');
$this->registerArgument('field', 'string', 'field', false, 'image');
$this->registerArgument('as', 'string', 'Name of variable to create', false, 'items');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$variableProvider = $renderingContext->getVariableProvider();
if (is_array($arguments['data']) && $arguments['data']['uid'] && $arguments['data'][$arguments['field']]) {
$fileRepository = GeneralUtility::makeInstance(FileRepository::class);
$items = $fileRepository->findByRelation(
$arguments['table'],
$arguments['field'],
$arguments['data']['uid']
);
$localizedId = null;
if (isset($arguments['data']['_LOCALIZED_UID'])) {
$localizedId = $arguments['data']['_LOCALIZED_UID'];
} elseif (isset($arguments['data']['_PAGES_OVERLAY_UID'])) {
$localizedId = $arguments['data']['_PAGES_OVERLAY_UID'];
}
$isTableLocalizable = (
isset($GLOBALS['TCA'][$arguments['table']]['ctrl']['languageField'])
&& $GLOBALS['TCA'][$arguments['table']]['ctrl']['languageField'] !== ''
&& isset($GLOBALS['TCA'][$arguments['table']]['ctrl']['transOrigPointerField'])
&& $GLOBALS['TCA'][$arguments['table']]['ctrl']['transOrigPointerField'] !== ''
);
if ($isTableLocalizable && $localizedId !== null) {
$items = $fileRepository->findByRelation($arguments['table'], $arguments['field'], $localizedId);
}
} else {
$items = null;
}
$variableProvider->add($arguments['as'], $items);
$content = $renderChildrenClosure();
$variableProvider->remove($arguments['as']);
return $content;
}
}
@@ -0,0 +1,50 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\File;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class IsAudioViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$file = $renderChildrenClosure();
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['SYS']['audiofile_ext'] ?? '';
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
if (is_object($file)
&& ($file instanceof FileReference || $file instanceof File)
&& (
in_array($file->getExtension(), $allowedFileExtensions, true)
|| $file->getType() === File::FILETYPE_AUDIO
)
) {
return true;
}
return false;
}
}
@@ -0,0 +1,50 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\File;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class IsImageViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$file = $renderChildrenClosure();
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'] ?? '';
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
if (is_object($file)
&& ($file instanceof FileReference || $file instanceof File)
&& (
in_array($file->getExtension(), $allowedFileExtensions, true)
|| $file->getType() === File::FILETYPE_IMAGE
)
) {
return true;
}
return false;
}
}
@@ -0,0 +1,50 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\File;
use TYPO3\CMS\Core\Resource\File;
use TYPO3\CMS\Core\Resource\FileReference;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
class IsMediaViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$file = $renderChildrenClosure();
$allowedFileExtensions = $GLOBALS['TYPO3_CONF_VARS']['SYS']['mediafile_ext'] ?? '';
$allowedFileExtensions = GeneralUtility::trimExplode(',', $allowedFileExtensions);
if (is_object($file)
&& ($file instanceof FileReference || $file instanceof File)
&& (
in_array($file->getExtension(), $allowedFileExtensions, true)
|| $file->getType() === File::FILETYPE_VIDEO
)
) {
return true;
}
return false;
}
}
@@ -0,0 +1,43 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* LowercaseDashedViewHelper
*/
class LowercaseDashedViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string the formatted amount
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
preg_match_all(
'!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!',
$renderChildrenClosure(),
$matches
);
$ret = $matches[0];
foreach ($ret as &$match) {
$match = $match === strtoupper($match) ? strtolower($match) : lcfirst($match);
}
return implode('-', $ret);
}
}
@@ -0,0 +1,34 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* TrimViewHelper
*/
class TrimViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string the formatted amount
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
return trim($renderChildrenClosure());
}
}
@@ -0,0 +1,34 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Format;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* UpperCamelCaseViewHelper
*/
class UpperCamelCaseViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return string the formatted amount
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
return str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($renderChildrenClosure()))));
}
}
@@ -0,0 +1,65 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* IconViewHelper
*/
class IconViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('icon', 'object', 'Icon to render', true);
$this->registerArgument('height', 'int', 'Height');
$this->registerArgument('width', 'int', 'Width');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
* @throws \Exception
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$icon = $arguments['icon'];
if (isset($arguments['width'])) {
$icon->setWidth((int) $arguments['width']);
}
if (isset($arguments['height'])) {
$icon->setHeight((int) $arguments['height']);
}
return $icon->render();
}
}
@@ -0,0 +1,65 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers;
use BK2K\BootstrapPackage\Utility\SvgUtility;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* InlineSvgViewHelper
*/
class InlineSvgViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('image', 'object', 'a FAL object');
$this->registerArgument('src', 'string', 'a path to a file');
$this->registerArgument('class', 'string', 'Css class for the svg');
$this->registerArgument('width', 'string', 'Width of the svg.', false);
$this->registerArgument('height', 'string', 'Height of the svg.', false);
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
* @throws \Exception
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$src = (string)$arguments['src'];
$image = $arguments['image'];
$width = $arguments['width'] ? (int) $arguments['width'] : null;
$height = $arguments['height'] ? (int) $arguments['height'] : null;
$class = $arguments['class'] ? (string) $arguments['class'] : null;
return SvgUtility::getInlineSvg($src, $image, $width, $height, $class);
}
}
@@ -0,0 +1,106 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Link;
use TYPO3\CMS\Core\Imaging\ImageManipulation\CropVariantCollection;
use TYPO3\CMS\Core\Resource\Exception\ResourceDoesNotExistException;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\Service\ImageService;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Exception;
class LightboxViewHelper extends AbstractTagBasedViewHelper
{
/**
* @var string
*/
protected $tagName = 'a';
/**
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerUniversalTagAttributes();
$this->registerTagAttribute('rel', 'string', 'Specifies the relationship between the current document and the linked document', false);
$this->registerArgument('caption', 'string', 'Specifies an caption text', false);
$this->registerArgument('image', 'object', 'image', true);
$this->registerArgument('crop', 'string|bool', 'overrule cropping of image (setting to FALSE disables the cropping set in FileReference)');
$this->registerArgument('cropVariant', 'string', 'select a cropping variant, in case multiple croppings have been specified or stored in FileReference', false, 'default');
$this->registerArgument('width', 'string', 'width of the image. This can be a numeric value representing the fixed width of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.');
$this->registerArgument('height', 'string', 'height of the image. This can be a numeric value representing the fixed height of the image in pixels. But you can also perform simple calculations by adding "m" or "c" to the value. See imgResource.width for possible options.');
$this->registerArgument('minWidth', 'int', 'minimum width of the image');
$this->registerArgument('minHeight', 'int', 'minimum height of the image');
$this->registerArgument('maxWidth', 'int', 'maximum width of the image');
$this->registerArgument('maxHeight', 'int', 'maximum height of the image');
$this->registerArgument('absolute', 'bool', 'Force absolute URL', false, false);
}
public function render(): string
{
try {
$imageService = $this->getImageService();
$image = $imageService->getImage('', $this->arguments['image'], false);
$cropString = $this->arguments['crop'];
if ($cropString === null && $image->hasProperty('crop') && $image->getProperty('crop') !== '') {
$cropString = $image->getProperty('crop');
}
$cropVariantCollection = CropVariantCollection::create((string)$cropString);
$cropVariant = $this->arguments['cropVariant'] ?? 'default';
$cropArea = $cropVariantCollection->getCropArea($cropVariant);
$processingInstructions = [
'width' => $this->arguments['width'],
'height' => $this->arguments['height'],
'minWidth' => $this->arguments['minWidth'],
'minHeight' => $this->arguments['minHeight'],
'maxWidth' => $this->arguments['maxWidth'],
'maxHeight' => $this->arguments['maxHeight'],
'crop' => $cropArea->isEmpty() ? null : $cropArea->makeAbsoluteBasedOnFile($image),
];
$processedImage = $imageService->applyProcessingInstructions($image, $processingInstructions);
$imageUri = $imageService->getImageUri($processedImage, isset($this->arguments['absolute']) ? $this->arguments['absolute'] : false);
$this->tag->addAttribute('href', $imageUri);
$this->tag->addAttribute('data-lightbox-width', $processedImage->getProperty('width'));
$this->tag->addAttribute('data-lightbox-height', $processedImage->getProperty('height'));
$this->tag->addAttribute('data-lightbox-caption', isset($this->arguments['caption']) ? $this->arguments['caption'] : null);
$this->tag->setContent($this->renderChildren());
$this->tag->forceClosingTag(true);
} catch (ResourceDoesNotExistException $e) {
// thrown if file does not exist
throw new Exception($e->getMessage(), 1622197950, $e);
} catch (\UnexpectedValueException $e) {
// thrown if a file has been replaced with a folder
throw new Exception($e->getMessage(), 1622197951, $e);
} catch (\RuntimeException $e) {
// RuntimeException thrown if a file is outside of a storage
throw new Exception($e->getMessage(), 1622197952, $e);
} catch (\InvalidArgumentException $e) {
// thrown if file storage does not exist
throw new Exception($e->getMessage(), 1622197953, $e);
}
return $this->tag->render();
}
/**
* @return ImageService
*/
protected function getImageService(): ImageService
{
return GeneralUtility::makeInstance(ImageService::class);
}
}
@@ -0,0 +1,71 @@
<?php
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\Link;
use TYPO3\CMS\Extbase\Mvc\Web\Routing\UriBuilder;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractTagBasedViewHelper;
class PaginateViewHelper extends AbstractTagBasedViewHelper
{
/**
* @var string
*/
protected $tagName = 'a';
/**
* Initialize arguments
*
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerUniversalTagAttributes();
$this->registerArgument('paginationId', 'string', 'id', true);
$this->registerArgument('paginationPage', 'int', 'page', true);
}
public function render(): string
{
$paginationId = (string) $this->arguments['paginationId'];
$paginationPage = (int) $this->arguments['paginationPage'];
$section = isset($this->arguments['section']) ? (string)$this->arguments['section'] : '';
$arguments = [];
if ($paginationPage > 1) {
$arguments['paginate'][$paginationId]['page'] = $paginationPage;
}
if (method_exists($this->renderingContext, 'getUriBuilder')) {
/** @var UriBuilder $uriBuilder */
$uriBuilder = $this->renderingContext->getUriBuilder();
} elseif (method_exists($this->renderingContext, 'getControllerContext')) {
/** @var UriBuilder $uriBuilder */
$uriBuilder = $this->renderingContext->getControllerContext()->getUriBuilder();
} else {
return $this->renderChildren();
}
$uriBuilder->reset()->setArguments($arguments);
$uri = $uriBuilder->build();
if ($uri !== '') {
$this->tag->addAttribute('href', $uri);
$this->tag->setContent($this->renderChildren());
$this->tag->forceClosingTag(true);
$result = $this->tag->render();
} else {
$result = $this->renderChildren();
}
return $result;
}
}
@@ -0,0 +1,64 @@
<?php
declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
namespace BK2K\BootstrapPackage\ViewHelpers\TypoScript;
use TYPO3Fluid\Fluid\Core\Rendering\RenderingContextInterface;
use TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper;
use TYPO3Fluid\Fluid\Core\ViewHelper\Traits\CompileWithRenderStatic;
/**
* ConstantViewHelper
*/
class ConstantViewHelper extends AbstractViewHelper
{
use CompileWithRenderStatic;
/**
* @var bool
*/
protected $escapeOutput = false;
/**
* Initialize arguments.
*
* @throws \TYPO3Fluid\Fluid\Core\ViewHelper\Exception
* @return void
*/
public function initializeArguments()
{
parent::initializeArguments();
$this->registerArgument('constant', 'string', 'TypoScript constant');
}
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(
array $arguments,
\Closure $renderChildrenClosure,
RenderingContextInterface $renderingContext
) {
$constant = trim($arguments['constant']);
if ($GLOBALS['TSFE']->tmpl->flatSetup === null
|| !is_array($GLOBALS['TSFE']->tmpl->flatSetup)
|| count($GLOBALS['TSFE']->tmpl->flatSetup) === 0) {
$GLOBALS['TSFE']->tmpl->generateConfig();
}
if (!array_key_exists($constant, $GLOBALS['TSFE']->tmpl->flatSetup)) {
return '';
}
return $GLOBALS['TSFE']->tmpl->flatSetup[$constant];
}
}
@@ -0,0 +1,2 @@
Order deny,allow
Deny from all
@@ -0,0 +1,14 @@
<?php declare(strict_types=1);
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
return [
'typoscript' => [
\BK2K\BootstrapPackage\ExpressionLanguage\ConditionProvider::class,
]
];
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<default_element>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:accordion.default_element
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<foreign_table>tx_bootstrappackage_accordion_item</foreign_table>
<foreign_table_where>AND tx_bootstrappackage_accordion_item.tt_content = ###THIS_UID###</foreign_table_where>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">None</numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</default_element>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<parallax>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.parallax</label>
<config>
<type>check</type>
<default>0</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.parallax.description</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</parallax>
<fade>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.fade</label>
<config>
<type>check</type>
<default>0</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.fade.description</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</fade>
<filter>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.filter</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default></default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.filter.none</numIndex>
<numIndex index="1"></numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.filter.blur</numIndex>
<numIndex index="1">blur</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.filter.grayscale</numIndex>
<numIndex index="1">grayscale</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:option.background_image.filter.sepia</numIndex>
<numIndex index="1">sepia</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</filter>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<align>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.card_group.align</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>left</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.card_group.align.left</numIndex>
<numIndex index="1">left</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.card_group.align.center</numIndex>
<numIndex index="1">center</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.card_group.align.right</numIndex>
<numIndex index="1">right</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</align>
<columns>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.card_group.columns</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>2</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">1</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">3</numIndex>
<numIndex index="1">3</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">4</numIndex>
<numIndex index="1">4</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</columns>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<interval>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.interval
</label>
<config>
<type>input</type>
<size>8</size>
<default>5000</default>
<eval>required,int</eval>
</config>
</TCEforms>
</interval>
<transition>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.transition
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>fade</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.transition.fade</numIndex>
<numIndex index="1">fade</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.transition.slide</numIndex>
<numIndex index="1">slide</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</transition>
<wrap>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.wrap</label>
<config>
<type>check</type>
<default>1</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.wrap.description</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</wrap>
<show_nav_title>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.show_nav_title</label>
<config>
<type>check</type>
<default>0</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:carousel.show_nav_title.description</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</show_nav_title>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<align>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.align</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>center</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.align.left</numIndex>
<numIndex index="1">left</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.align.center</numIndex>
<numIndex index="1">center</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.align.right</numIndex>
<numIndex index="1">right</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</align>
<columns>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.columns</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>auto</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.columns.auto</numIndex>
<numIndex index="1">auto</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">1</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">3</numIndex>
<numIndex index="1">3</numIndex>
</numIndex>
<numIndex index="4" type="array">
<numIndex index="0">4</numIndex>
<numIndex index="1">4</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</columns>
<icon_position>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>left-center</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.left-top</numIndex>
<numIndex index="1">left-top</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.left-center</numIndex>
<numIndex index="1">left-center</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.right-top</numIndex>
<numIndex index="1">right-top</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.right-center</numIndex>
<numIndex index="1">right-center</numIndex>
</numIndex>
<numIndex index="4" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.above</numIndex>
<numIndex index="1">above</numIndex>
</numIndex>
<numIndex index="5" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:content_element.icon_group.icon_position.below</numIndex>
<numIndex index="1">below</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</icon_position>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<align>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.card.align</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>left</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.card.align.left</numIndex>
<numIndex index="1">left</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.card.align.center</numIndex>
<numIndex index="1">center</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.card.align.right</numIndex>
<numIndex index="1">right</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</align>
<columns>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.card.columns</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>2</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">1</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">3</numIndex>
<numIndex index="1">3</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">4</numIndex>
<numIndex index="1">4</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</columns>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<align>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.thumbnail.align</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>left</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.thumbnail.align.left</numIndex>
<numIndex index="1">left</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.thumbnail.align.center</numIndex>
<numIndex index="1">center</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.thumbnail.align.right</numIndex>
<numIndex index="1">right</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</align>
<columns>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:menu.thumbnail.columns</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<default>2</default>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">1</numIndex>
<numIndex index="1">1</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">2</numIndex>
<numIndex index="1">2</numIndex>
</numIndex>
<numIndex index="2" type="array">
<numIndex index="0">3</numIndex>
<numIndex index="1">3</numIndex>
</numIndex>
<numIndex index="3" type="array">
<numIndex index="0">4</numIndex>
<numIndex index="1">4</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</columns>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<default_tab>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:tab.default_tab
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<foreign_table>tx_bootstrappackage_tab_item</foreign_table>
<foreign_table_where>AND tx_bootstrappackage_tab_item.tt_content = ###THIS_UID###</foreign_table_where>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0"></numIndex>
<numIndex index="1">0</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</default_tab>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<T3DataStructure>
<meta>
<langDisable>1</langDisable>
</meta>
<sheets>
<sDEF>
<ROOT>
<TCEforms>
<sheetTitle>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:settings</sheetTitle>
</TCEforms>
<type>array</type>
<el>
<sorting>
<TCEforms>
<label>LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:timeline.sorting
</label>
<config>
<type>select</type>
<renderType>selectSingle</renderType>
<items type="array">
<numIndex index="0" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:timeline.sorting.desc</numIndex>
<numIndex index="1">date desc</numIndex>
</numIndex>
<numIndex index="1" type="array">
<numIndex index="0">LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:timeline.sorting.asc</numIndex>
<numIndex index="1">date asc</numIndex>
</numIndex>
</items>
</config>
</TCEforms>
</sorting>
</el>
</ROOT>
</sDEF>
</sheets>
</T3DataStructure>
@@ -0,0 +1,25 @@
TYPO3:
CMS:
Form:
persistenceManager:
allowedExtensionPaths:
110: EXT:bootstrap_package/Resources/Private/Forms/
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
translation:
translationFiles:
110: 'EXT:bootstrap_package/Resources/Private/Language/locallang.xlf'
layoutRootPaths:
20: 'EXT:bootstrap_package/Resources/Private/Layouts/Form/'
templateRootPaths:
20: 'EXT:bootstrap_package/Resources/Private/Templates/Form/'
partialRootPaths:
20: 'EXT:bootstrap_package/Resources/Private/Partials/Form/'
ImageUpload:
properties:
imageLinkMaxWidth: 1200
imageMaxWidth: 200
imageMaxHeight: 200
@@ -0,0 +1,151 @@
imports:
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Processing.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Base.yaml" }
- { resource: "EXT:rte_ckeditor/Configuration/RTE/Editor/Plugins.yaml" }
editor:
externalPlugins:
bootstrappackage_address:
resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Address/plugin.min.js"
bootstrappackage_box:
resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Box/plugin.min.js"
bootstrappackage_columns:
resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Columns/plugin.min.js"
bootstrappackage_indent:
resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Indent/plugin.min.js"
bootstrappackage_table:
resource: "EXT:bootstrap_package/Resources/Public/CKEditor/Plugins/Table/plugin.min.js"
config:
contentsCss: "EXT:bootstrap_package/Resources/Public/Css/bootstrap5-rte.min.css"
stylesSet:
- { name: "Lead", element: "p", attributes: { 'class': 'lead' } }
- { name: "Small", element: "small" }
- { name: "Table", element: "table", attributes: { 'class': 'table' } }
- { name: "Table Striped", element: "table", attributes: { 'class': 'table table-striped' } }
- { name: "Table Bordered", element: "table", attributes: { 'class': 'table table-bordered' } }
- { name: "Table Condensed", element: "table", attributes: { 'class': 'table table-condensed' } }
- { name: "Row Active", element: "tr", attributes: { 'class': 'table-active' } }
- { name: "Row Success", element: "tr", attributes: { 'class': 'table-success' } }
- { name: "Row Info", element: "tr", attributes: { 'class': 'table-info' } }
- { name: "Row Warning", element: "tr", attributes: { 'class': 'table-warning' } }
- { name: "Row Danger", element: "tr", attributes: { 'class': 'table-danger' } }
- { name: "Cell Active", element: "td", attributes: { 'class': 'table-active' } }
- { name: "Cell Success", element: "td", attributes: { 'class': 'table-success' } }
- { name: "Cell Info", element: "td", attributes: { 'class': 'table-info' } }
- { name: "Cell Warning", element: "td", attributes: { 'class': 'table-warning' } }
- { name: "Cell Danger", element: "td", attributes: { 'class': 'table-danger' } }
- { name: "Button Default", element: "a", attributes: { 'class': 'btn btn-default' } }
- { name: "Button Primary", element: "a", attributes: { 'class': 'btn btn-primary' } }
- { name: "Button Secondary", element: "a", attributes: { 'class': 'btn btn-secondary' } }
- { name: "Button Tertiary", element: "a", attributes: { 'class': 'btn btn-tertiary' } }
- { name: "Button Quaternary", element: "a", attributes: { 'class': 'btn btn-quaternary' } }
- { name: "Button Success", element: "a", attributes: { 'class': 'btn btn-success' } }
- { name: "Button Info", element: "a", attributes: { 'class': 'btn btn-info' } }
- { name: "Button Warning", element: "a", attributes: { 'class': 'btn btn-warning' } }
- { name: "Button Danger", element: "a", attributes: { 'class': 'btn btn-danger' } }
- { name: "Button Outline Default", element: "a", attributes: { 'class': 'btn btn-outline-default' } }
- { name: "Button Outline Primary", element: "a", attributes: { 'class': 'btn btn-outline-primary' } }
- { name: "Button Outline Secondary", element: "a", attributes: { 'class': 'btn btn-outline-secondary' } }
- { name: "Button Outline Tertiary", element: "a", attributes: { 'class': 'btn btn-outline-tertiary' } }
- { name: "Button Outline Quaternary", element: "a", attributes: { 'class': 'btn btn-outline-quaternary' } }
- { name: "Button Outline Success", element: "a", attributes: { 'class': 'btn btn-outline-success' } }
- { name: "Button Outline Info", element: "a", attributes: { 'class': 'btn btn-outline-info' } }
- { name: "Button Outline Warning", element: "a", attributes: { 'class': 'btn btn-outline-warning' } }
- { name: "Button Outline Danger", element: "a", attributes: { 'class': 'btn btn-outline-danger' } }
- { name: "Link Arrow", element: "a", attributes: { 'class': 'link-arrow' } }
- { name: "Link Chevron", element: "a", attributes: { 'class': 'link-chevron' } }
- { name: "Link Page", element: "a", attributes: { 'class': 'link-page' } }
- { name: "Link Folder", element: "a", attributes: { 'class': 'link-folder' } }
- { name: "Link File", element: "a", attributes: { 'class': 'link-file' } }
- { name: "Link External", element: "a", attributes: { 'class': 'link-external' } }
- { name: "Link Mail", element: "a", attributes: { 'class': 'link-mail' } }
- { name: "Link Globe", element: "a", attributes: { 'class': 'link-globe' } }
- { name: "List Unstyled", element: "ul", attributes: { 'class': 'list-unstyled' } }
- { name: "List Inline", element: "ul", attributes: { 'class': 'list-inline' } }
- { name: "List Check", element: "ul", attributes: { 'class': 'list-check' } }
- { name: "List Info", element: "ul", attributes: { 'class': 'list-info' } }
- { name: "List Warning", element: "ul", attributes: { 'class': 'list-warning' } }
- { name: "List Ban", element: "ul", attributes: { 'class': 'list-ban' } }
- { name: "List Chevron", element: "ul", attributes: { 'class': 'list-chevron' } }
- { name: "Lowercased text", element: "span", attributes: { 'class': 'text-lowercase' } }
- { name: "Uppercased text", element: "span", attributes: { 'class': 'text-uppercase' } }
- { name: "Capitalized text", element: "span", attributes: { 'class': 'text-capitalize' } }
- { name: "Muted", element: "span", attributes: { 'class': 'text-muted' } }
- { name: "Primary", element: "span", attributes: { 'class': 'text-primary' } }
- { name: "Secondary", element: "span", attributes: { 'class': 'text-secondary' } }
- { name: "Tertiary", element: "span", attributes: { 'class': 'text-tertiary' } }
- { name: "Quaternary", element: "span", attributes: { 'class': 'text-quaternary' } }
- { name: "Success", element: "span", attributes: { 'class': 'text-success' } }
- { name: "Info", element: "span", attributes: { 'class': 'text-info' } }
- { name: "Warning", element: "span", attributes: { 'class': 'text-warning' } }
- { name: "Danger", element: "span", attributes: { 'class': 'text-danger' } }
toolbarGroups:
- { name: styles, groups: [ format, styles ] }
- { name: basicstyles, groups: [ basicstyles ] }
- { name: paragraph, groups: [ list, indent, blocks, align ] }
- "/"
- { name: links, groups: [ links ] }
- { name: clipboard, groups: [ clipboard, cleanup, undo ] }
- { name: editing, groups: [ spellchecker ] }
- { name: insert, groups: [ insert ] }
- { name: tools, groups: [ table, specialchar ] }
- { name: document, groups: [ mode ] }
format_tags: "p;h1;h2;h3;h4;h5;pre"
justifyClasses:
- text-left
- text-center
- text-right
- text-justify
extraPlugins:
- justify
- autolink
- bootstrappackage_address
- bootstrappackage_box
- bootstrappackage_columns
- bootstrappackage_indent
- bootstrappackage_table
removePlugins:
- image
removeButtons:
- Anchor
- Underline
- Strike
classesAnchor:
page:
class: 'link-page'
type: 'page'
folder:
class: 'link-folder'
type: 'folder'
file:
class: 'link-file'
type: 'file'
external:
class: 'link-external'
type: 'url'
mail:
class: 'link-mail'
type: 'mail'
buttons:
link:
properties:
class:
allowedClasses: 'link-arrow, link-page, link-folder, link-file, link-external, link-mail'
@@ -0,0 +1,11 @@
services:
BK2K\BootstrapPackage\Service\BrandingService:
tags:
- name: event.listener
identifier: 'bk2k/bootstrap-package/set-backend-styling'
event: TYPO3\CMS\Core\Package\Event\AfterPackageActivationEvent
BK2K\BootstrapPackage\Backend\ToolbarItem\VersionToolbarItem:
tags:
- name: event.listener
identifier: 'bk2k/bootstrap-package/add-version-information'
event: TYPO3\CMS\Backend\Backend\Event\SystemInformationToolbarCollectorEvent
@@ -0,0 +1,186 @@
<?php
/*
* This file is part of the package bk2k/bootstrap-package.
*
* For the full copyright and license information, please read the
* LICENSE file that was distributed with this source code.
*/
defined('TYPO3') or die('Access denied.');
// Register PageTS
// BackendLayouts
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'bootstrap_package',
'Configuration/TsConfig/Page/Mod/WebLayout/BackendLayouts.tsconfig',
'Bootstrap Package: Backend Layouts'
);
// TCEMAIN
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'bootstrap_package',
'Configuration/TsConfig/Page/TCEMAIN.tsconfig',
'Bootstrap Package: TCEMAIN'
);
// TCEFORM
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'bootstrap_package',
'Configuration/TsConfig/Page/TCEFORM.tsconfig',
'Bootstrap Package: TCEFORM'
);
// Content Elements
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'bootstrap_package',
'Configuration/TsConfig/Page/ContentElement/All.tsconfig',
'Bootstrap Package: All Content Elements'
);
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::registerPageTSConfigFile(
'bootstrap_package',
'Configuration/TsConfig/Page/ContentElement/Categories.tsconfig',
'Bootstrap Package: Categories for Content Elements'
);
// Register fields
$GLOBALS['TCA']['pages']['columns'] = array_replace_recursive(
$GLOBALS['TCA']['pages']['columns'],
[
'nav_icon_set' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon_set',
'onChange' => 'reload',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'itemsProcFunc' => 'BK2K\BootstrapPackage\Service\IconService->getIconSetItems',
],
],
'nav_icon_identifier' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:field.icon',
'displayCond' => 'FIELD:nav_icon_set:REQ:true',
'config' => [
'type' => 'select',
'renderType' => 'selectSingle',
'itemsProcFunc' => 'BK2K\BootstrapPackage\Service\IconService->getIconItems',
'itemsProcConfig' => [
'iconSetField' => 'nav_icon_set'
],
'fieldWizard' => [
'selectIcons' => [
'renderType' => 'iconWizard',
'disabled' => false,
],
],
],
],
'nav_icon' => [
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:pages.nav_icon',
'displayCond' => 'FIELD:nav_icon_set:REQ:false',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'nav_icon',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
],
],
'maxitems' => 1,
],
'gif,png,svg'
),
],
'thumbnail' => [
'exclude' => true,
'label' => 'LLL:EXT:bootstrap_package/Resources/Private/Language/Backend.xlf:pages.thumbnail',
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
'thumbnail',
[
'appearance' => [
'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
],
'overrideChildTca' => [
'types' => [
\TYPO3\CMS\Core\Resource\File::FILETYPE_UNKNOWN => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_TEXT => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
'showitem' => '
title,
alternative,
crop,
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_AUDIO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
'showitem' => '
--palette--;;filePalette
'
],
\TYPO3\CMS\Core\Resource\File::FILETYPE_APPLICATION => [
'showitem' => '
--palette--;;filePalette
'
],
],
],
'minitems' => 0,
'maxitems' => 1,
],
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
),
'l10n_mode' => 'exclude',
],
]
);
// Assign position to fields
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'nav_icon_set', '1,3,4', 'after:nav_title');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'nav_icon_identifier', '1,3,4', 'after:nav_icon_set');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'nav_icon', '1,3,4', 'after:nav_icon_set');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addToAllTCAtypes('pages', 'thumbnail', '1,3,4', 'after:backend_layout_next_level');
Loaded 100 of 2984 files, more files were not shown because too many files have changed in this diff. Show more