Initial commit - Typo3 11.5.41
This commit is contained in:
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
|
||||
$youtubeVideoColumns = array(
|
||||
'tx_youtubevideo_rel' => array (
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_rel.title',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'default' => 1,
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
]
|
||||
],
|
||||
]
|
||||
),
|
||||
'tx_youtubevideo_starttime' => array(
|
||||
'exclude' => 0,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_starttime.title',
|
||||
'config' => array(
|
||||
'type' => 'input',
|
||||
'size' => '8',
|
||||
'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds',
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
),
|
||||
),
|
||||
'tx_youtubevideo_endtime' => array(
|
||||
'exclude' => 0,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_endtime.title',
|
||||
'config' => array(
|
||||
'type' => 'input',
|
||||
'size' => '1',
|
||||
'eval' => 'trim,nospace,Brightside\Youtubevideo\Evaluation\HoursMinutesSeconds',
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
),
|
||||
),
|
||||
'tx_youtubevideo_ratio' => array(
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_ratio.title',
|
||||
'config' => array(
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectSingle',
|
||||
'items' => [
|
||||
['Widescreen (16:9)', 0],
|
||||
['Standard (4:3)', 1],
|
||||
],
|
||||
'size' => 1,
|
||||
'maxitems' => 1,
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
]
|
||||
)
|
||||
),
|
||||
'tx_youtubevideo_mute' => array (
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_mute.title',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
]
|
||||
],
|
||||
]
|
||||
),
|
||||
'tx_youtubevideo_fullscreen' => array (
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_fullscreen.title',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'default' => 1,
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
'invertStateDisplay' => false,
|
||||
]
|
||||
],
|
||||
]
|
||||
),
|
||||
'tx_youtubevideo_loop' => array (
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_loop.title',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
]
|
||||
],
|
||||
]
|
||||
),
|
||||
'tx_youtubevideo_coverimage' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo_cover.image',
|
||||
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
|
||||
'tx_youtubevideo_coverimage',
|
||||
[
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'overrideChildTca' => [
|
||||
'columns' => [
|
||||
'crop' => [
|
||||
'config' => [
|
||||
'cropVariants' => [
|
||||
'widescreen' => [
|
||||
'title' => 'Widescreen (16:9)',
|
||||
'selectedRatio' => '16:9',
|
||||
'allowedAspectRatios' => [
|
||||
'16:9' => [
|
||||
'title' => 'Widescreen',
|
||||
'value' => 16 / 9,
|
||||
],
|
||||
],
|
||||
],
|
||||
'tv' => [
|
||||
'title' => 'Standard (4:3)',
|
||||
'selectedRatio' => '4:3',
|
||||
'allowedAspectRatios' => [
|
||||
'4:3' => [
|
||||
'title' => 'TV',
|
||||
'value' => 4 / 3,
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
'types' => [
|
||||
'0' => [
|
||||
'showitem' => '
|
||||
--palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
|
||||
--palette--;;filePalette'
|
||||
],
|
||||
\TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
|
||||
'showitem' => '
|
||||
crop,
|
||||
--palette--;;filePalette'
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
$GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext']
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns(
|
||||
'sys_file_reference',
|
||||
$youtubeVideoColumns
|
||||
);
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addFieldsToPalette(
|
||||
'sys_file_reference',
|
||||
'youtubevideoOverlayPalette',
|
||||
'title,description,
|
||||
--linebreak--,
|
||||
tx_youtubevideo_mute,tx_youtubevideo_loop,tx_youtubevideo_fullscreen,tx_youtubevideo_rel,
|
||||
--linebreak--,
|
||||
tx_youtubevideo_starttime,tx_youtubevideo_endtime,
|
||||
--linebreak--,
|
||||
tx_youtubevideo_ratio,
|
||||
--linebreak--,
|
||||
tx_youtubevideo_coverimage'
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
defined('TYPO3_MODE') || die('Access denied.');
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addStaticFile(
|
||||
'youtubevideo', 'Configuration/TypoScript/', 'YouTube Video'
|
||||
);
|
||||
@@ -0,0 +1,144 @@
|
||||
<?php
|
||||
|
||||
defined('TYPO3_MODE') || die('Access denied.');
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['youtubevideo_pi1'] = 'youtubevideo_icon';
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addLLrefForTCAdescr(
|
||||
'tt_content', 'EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf'
|
||||
);
|
||||
|
||||
// Get extension configuration
|
||||
$extensionConfiguration = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
|
||||
\TYPO3\CMS\Core\Configuration\ExtensionConfiguration::class
|
||||
);
|
||||
$extensionConfiguration = $extensionConfiguration->get('youtubevideo');
|
||||
|
||||
// Add to content type dropdown
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTcaSelectItem(
|
||||
"tt_content",
|
||||
"CType",
|
||||
[
|
||||
'YouTube Video',
|
||||
'youtubevideo_pi1',
|
||||
'youtubevideo_icon'
|
||||
],
|
||||
'textmedia',
|
||||
'after'
|
||||
);
|
||||
|
||||
$tempColumns = array(
|
||||
'tx_youtubevideo_assets' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'Video',
|
||||
'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig('tx_youtubevideo_assets', [
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
'appearance' => [
|
||||
'createNewRelationLinkTitle' => 'Video',
|
||||
'showPossibleLocalizationRecords' => true,
|
||||
],
|
||||
'overrideChildTca' => [
|
||||
'types' => [
|
||||
\TYPO3\CMS\Core\Resource\File::FILETYPE_VIDEO => [
|
||||
'showitem' => '
|
||||
--palette--;;youtubevideoOverlayPalette,
|
||||
--palette--;;filePalette',
|
||||
],
|
||||
],
|
||||
],
|
||||
], 'youtube'),
|
||||
],
|
||||
'tx_youtubevideo_colcount' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'Columns',
|
||||
'config' => [
|
||||
'type' => 'select',
|
||||
'renderType' => 'selectSingle',
|
||||
'items' => array(),
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
],
|
||||
],
|
||||
'tx_youtubevideo_titles' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'Titles',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
'invertStateDisplay' => true
|
||||
]
|
||||
],
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
'tx_youtubevideo_descriptions' => [
|
||||
'exclude' => 1,
|
||||
'label' => 'Descriptions',
|
||||
'config' => [
|
||||
'type' => 'check',
|
||||
'renderType' => 'checkboxToggle',
|
||||
'items' => [
|
||||
[
|
||||
0 => '',
|
||||
1 => '',
|
||||
]
|
||||
],
|
||||
'behaviour' => [
|
||||
'allowLanguageSynchronization' => true,
|
||||
],
|
||||
]
|
||||
],
|
||||
);
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTCAcolumns('tt_content', $tempColumns);
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem'] = '
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:general,
|
||||
--palette--;;general,
|
||||
--palette--;;headers,
|
||||
--palette--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.title;youtubevideoMain,
|
||||
--div--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.settings;,
|
||||
--palette--;LLL:EXT:youtubevideo/Resources/Private/Language/locallang_db.xlf:tx_youtubevideo.layout;youtubevideoLayout,
|
||||
--div--;LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:tabs.appearance,
|
||||
--palette--;;frames,
|
||||
--palette--;;appearanceLinks,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:language,
|
||||
--palette--;;language,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:access,
|
||||
--palette--;;hidden,
|
||||
--palette--;;access,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:categories,
|
||||
categories,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:notes,
|
||||
rowDescription,
|
||||
--div--;LLL:EXT:core/Resources/Private/Language/Form/locallang_tabs.xlf:extended,
|
||||
';
|
||||
|
||||
if ($extensionConfiguration['youtubevideoEnablePagination']) {
|
||||
$GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem'] = str_replace(
|
||||
';youtubevideoLayout,',
|
||||
';youtubevideoLayout,
|
||||
--palette--;LLL:EXT:paginatedprocessors/Resources/Private/Language/locallang_tca.xlf:palettes.pagination;paginatedprocessors,',
|
||||
$GLOBALS['TCA']['tt_content']['types']['youtubevideo_pi1']['showitem']
|
||||
);
|
||||
}
|
||||
|
||||
$GLOBALS['TCA']['tt_content']['palettes']['youtubevideoMain']['showitem'] = 'tx_youtubevideo_assets';
|
||||
$GLOBALS['TCA']['tt_content']['palettes']['youtubevideoLayout']['showitem'] = '
|
||||
tx_youtubevideo_colcount,
|
||||
tx_youtubevideo_titles,
|
||||
tx_youtubevideo_descriptions,
|
||||
';
|
||||
|
||||
// Disable upload button in assets
|
||||
$GLOBALS['TCA']['tt_content']['columns']['tx_youtubevideo_assets']['config']['appearance']['fileUploadAllowed'] = 0;
|
||||
$GLOBALS['TCA']['tt_content']['ctrl']['typeicon_classes']['youtubevideo_pi1'] = 'youtubevideo_icon';
|
||||
Reference in New Issue
Block a user