Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e8bd618
modernize folder structure, remove list bundle support
koertho Jan 7, 2025
1d1079a
remove deprecations, rename folder
koertho Jan 7, 2025
629ead7
fix routing
koertho Jan 7, 2025
a434e49
remove twig support bundle integration, rename fullsize and privacy t…
koertho Jan 7, 2025
7f95d83
rewrote image handling to contao figure handling, worked on allowing …
koertho Jan 7, 2025
9136916
remove usage of modelinstancechoice
koertho Jan 7, 2025
ee13367
allow utils v3
koertho Jan 7, 2025
91379a4
add and run rector
koertho Jan 7, 2025
980b4b0
another rector run
koertho Jan 7, 2025
f18a88d
more rector
koertho Jan 7, 2025
18e62f8
raise rector rules
koertho Jan 7, 2025
a35f89e
raise rector rules
koertho Jan 7, 2025
4875de1
add and run phpstan, raise rector coverage
koertho Jan 7, 2025
d263482
add and run ecs
koertho Jan 7, 2025
42110d3
remove deprecations
koertho Jan 7, 2025
18319c1
raise deps
koertho Jan 7, 2025
40a4590
contao 5 adjustments, update assets
koertho Jan 7, 2025
0946862
fix asset path
koertho Jan 7, 2025
33cb1e7
Fix dump (#23)
zonky2 Jan 14, 2025
f142b7f
port changes from 7526632
koertho Feb 27, 2025
1d7052d
Issue fixfor legacyPrivacyCheck()
LongDuc89 Mar 6, 2025
b30fbd8
Update video.js
LongDuc89 Mar 6, 2025
ec68cd5
Merge pull request #26 from heimrichhannot/feature/issuefixed
LongDuc89 Mar 12, 2025
f0535ab
Escape `dataAttributes` values with `html_entities` in video templates.
ericges Aug 12, 2025
7504d5a
Merge branch 'master' into feature/contao_5
ericges Aug 12, 2025
e6444b6
Remove unused `VideoFieldContainer` import from `DcaFieldGenerator`.
ericges Aug 12, 2025
a0e5cd4
Remove `VideoFieldContainer` class.
ericges Aug 12, 2025
812e17d
html_entities does not exist, use twig escape filter for attrs
vvohh Sep 12, 2025
a813516
fix issue with contao 5 permissions
koertho Oct 17, 2025
3bf443f
some adjustments to rector and dependencies
koertho Oct 17, 2025
622e55e
run ecs
koertho Oct 17, 2025
0085ee6
refactor video provider data attributes to HtmlAttributes class, upda…
koertho Oct 30, 2025
7a6ee34
fix two small issues
koertho Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .php_cs

This file was deleted.

21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,27 @@

All notable changes to this project will be documented in this file.

## [2.0.0-DEV] - 2025-01-07
- Changed: allow contao 5
- Changed: migrated fullsize and privacy templates to new contao template system (NEED MANUAL ADJUSTMENT!)
- Changed: use new contao image handling
- Changed: dropped list bundle support (for the moment as not available for contao 5)
- Changed: modernized bundle structure
- Changed: dropped twig support bundle integration
- Changed: allow utils bundle v3
- Changed: dropped support for php lower than 8.1
- Removed: support for deprecated config key videoProvider
- Removed: support for deprecated config option names
- Removed: support for deprecated privacy mode attribute
- Removed: support for deprecated huh.video.event.alertify.onshow and huh.video.event.alertify.onfocus events
- Removed: deprecated VideoFieldContainer class

### Upgrade steps
- If you have custom fullsize or privacy templates, move and rename them according to the new contao template system
e.g. `templates/videofullsize_default.html.twig` -> `contao/templates/[.twig-root]/huh_video/fullsize.html.twig`
`templates/videofullsize_custom.html.twig` -> `contao/templates/[.twig-root]/huh_video/fullsize/custom.html.twig`
- If you worked with preview images in your templates, adjust them as `previewImage` is now a `Figure` object

## [1.8.0] - 2025-02-27
- Changed: refactored media query options callback listener
- Fixed: exception with non public service
Expand Down
29 changes: 0 additions & 29 deletions UPGRADE.md

This file was deleted.

File renamed without changes
42 changes: 1 addition & 41 deletions src/Resources/assets/js/video.js → assets/js/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export default class Video {

this.previewImageElement = this.wrapperElement.querySelector('.video-wrapper .video-thumbnail');
this.videoContainerElement = this.wrapperElement.querySelector('.video-wrapper .video-container');
this.legacyPrivacyCheck();

this.applyPrivacySettingsToVideo();
if ('toggleVideo' in this.configuration) {
Expand Down Expand Up @@ -71,15 +70,6 @@ export default class Video {
}

applyPrivacySettingsToLink() {
// legacy support
// @todo Deprecated, remove in next major version
if (!this.privacyMode) {
if ('privacy' in this.configuration) {
this.privacyMode = true;
console.warn("You're using an outdated video fullsize template. Please adjust your template according to the docs. Since version 1.2.0");
}
}

this.wrapperElement.addEventListener('click', (event) => {
event.preventDefault();
if (this.privacyMode) {
Expand All @@ -103,14 +93,6 @@ export default class Video {
elements: dialog.elements
}
}));
// @todo deprecated, remove in next major version
document.dispatchEvent(new CustomEvent('huh.video.event.alertify.onshow', {
bubbles: true,
cancelable: true,
detail: {
elements: dialog.elements
}
}));
},
defaultFocusOff: true,
onfocus: function() {
Expand All @@ -121,14 +103,6 @@ export default class Video {
elements: dialog.elements
}
}));
// @todo deprecated, remove in next major version
document.dispatchEvent(new CustomEvent('huh.video.event.alertify.onfocus', {
bubbles: true,
cancelable: true,
detail: {
elements: dialog.elements
}
}));
}
});

Expand Down Expand Up @@ -318,18 +292,4 @@ export default class Video {
toggleVideo(1);
}
}

/**
* @todo Remove in next major version
*/
legacyPrivacyCheck() {
if (!this.privacyMode && this.previewImageElement) {
if ('privacy' in this.previewImageElement.dataset) {
this.privacyMode = true;
console.warn("You're using an outdated video templates. Please adjust your template according to the docs. Since version 1.2.0");
}
}
}


}
}
26 changes: 13 additions & 13 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
],
"license": "LGPL-3.0-or-later",
"require": {
"php": "^7.4 || ^8.0",
"contao/core-bundle": "^4.9",
"heimrichhannot/contao-config-element-type-bundle": "^0.2",
"php": "^8.1",
"contao/core-bundle": "^5.3",
"heimrichhannot/contao-encore-contracts": "^1.0",
"heimrichhannot/contao-multi-column-editor-bundle": "^2.13",
"heimrichhannot/contao-twig-support-bundle": "^1.5",
"heimrichhannot/contao-utils-bundle": "^2.224",
"heimrichhannot/contao-utils-bundle": "^3.0",
"symfony/deprecation-contracts": "^2.0 || ^3.0",
"symfony/http-kernel": "^4.4 || ^5.4",
"symfony/http-kernel": "^6.4 || ^7.0",
"symfony/service-contracts": "^1.0 || ^2.0 || ^3.0",
"symfony/translation-contracts": "^1.0 || ^2.0 || ^3.0"
},
"conflict": {
"heimrichhannot/contao-privacy-center-bundle": "<2.8"
},
"autoload": {
"psr-4": {
"HeimrichHannot\\VideoBundle\\": "src/"
}
},
"extra": {
"contao-manager-plugin": "HeimrichHannot\\VideoBundle\\ContaoManager\\Plugin",
"foxy": true
"contao-manager-plugin": "HeimrichHannot\\VideoBundle\\ContaoManager\\Plugin"
},
"suggest": {
"heimrichhannot/contao-encore-bundle": "Manage dependencies with Symfony Webpack Encore."
"require-dev": {
"contao/manager-plugin": "^2.13",
"contao/core-bundle": "^4.13",
"rector/rector": "^2.2",
"contao/contao-rector": "dev-main",
"symplify/easy-coding-standard": "^12.6",
"phpstan/phpstan": "^2.1",
"phpstan/phpstan-symfony": "^2.0"
}
}
3 changes: 3 additions & 0 deletions config/routing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
huh_video:
resource: "../src/Controller/"
type: annotation
11 changes: 7 additions & 4 deletions src/Resources/config/services.yml → config/services.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ services:
autowire: true
bind:
$bundleConfig: '%huh_video%'
Contao\CoreBundle\Twig\Finder\FinderFactory: '@contao.twig.finder_factory'


HeimrichHannot\VideoBundle\:
resource: '../../{Asset,Command,Controller,DataContainer,EventListener}/*'
resource: '../src/{Asset,Controller,DataContainer,EventListener}/*'
autoconfigure: true

HeimrichHannot\VideoBundle\Asset\FrontendAsset:
Expand All @@ -20,8 +22,9 @@ services:
public: true

HeimrichHannot\VideoBundle\EventListener\Dca\:
resource: ../../EventListener/Dca/*
resource: ../src/EventListener/Dca/*
public: true

HeimrichHannot\VideoBundle\ConfigElementType\VideoConfigElementType:
tags: ['huh.list.config_element_type', 'huh.reader.config_element_type']
HeimrichHannot\VideoBundle\EventListener\PrivacyCenterListener:
public: true
autoconfigure: true
File renamed without changes.
37 changes: 20 additions & 17 deletions src/Resources/contao/dca/tl_page.php → contao/dca/tl_page.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
*/

use Contao\CoreBundle\DataContainer\PaletteManipulator;
use Contao\DataContainer;
use Contao\System;
use HeimrichHannot\TwigSupportBundle\Filesystem\TwigTemplateLocator;

$arrDca = &$GLOBALS['TL_DCA']['tl_page'];

Expand Down Expand Up @@ -43,52 +40,58 @@
'label' => &$GLOBALS['TL_LANG']['tl_page']['overrideNoCookieVideoUrlSettings'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'eval' => [
'tl_class' => 'w50',
'submitOnChange' => true,
],
'sql' => "char(1) NOT NULL default ''",
],
'enableNoCookieVideoUrl' => [
'label' => &$GLOBALS['TL_LANG']['tl_page']['enableNoCookieVideoUrl'],
'exclude' => true,
'default' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'clr'],
'eval' => [
'tl_class' => 'clr',
],
'sql' => "char(1) NOT NULL default ''",
],
'overrideEnablePrivacyNotice' => [
'label' => &$GLOBALS['TL_LANG']['tl_page']['overrideEnablePrivacyNotice'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'w50', 'submitOnChange' => true],
'eval' => [
'tl_class' => 'w50',
'submitOnChange' => true,
],
'sql' => "char(1) NOT NULL default ''",
],
'enablePrivacyNotice' => [
'label' => &$GLOBALS['TL_LANG']['tl_page']['enablePrivacyNotice'],
'exclude' => true,
'default' => true,
'inputType' => 'checkbox',
'eval' => ['tl_class' => 'clr'],
'eval' => [
'tl_class' => 'clr',
],
'sql' => "char(1) NOT NULL default ''",
],
'videofullsizeTemplate' => [
'label' => &$GLOBALS['TL_LANG']['tl_page']['videofullsizeTemplate'],
'default' => 'videofullsize_default',
'exclude' => true,
'inputType' => 'select',
'options_callback' => function (DataContainer $dc) {
return System::getContainer()->get(TwigTemplateLocator::class)->getTemplateGroup('videofullsize_');
},
'eval' => ['tl_class' => 'w50 clr'],
'eval' => [
'tl_class' => 'w50 clr',
],
'sql' => "varchar(64) NOT NULL default ''",
],
'videoprivacyTemplate' => [
'label' => &$GLOBALS['TL_LANG']['tl_page']['videoprivacyTemplate'],
'exclude' => true,
'inputType' => 'select',
'default' => 'videoprivacy_default.twig',
'options_callback' => function (DataContainer $dc) {
return System::getContainer()->get(TwigTemplateLocator::class)->getTemplateGroup('videoprivacy_');
},
'eval' => ['tl_class' => 'w50', 'mandatory' => true],
'eval' => [
'tl_class' => 'w50',
],
'sql' => "varchar(64) NOT NULL default ''",
],
];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Contao Open Source CMS
* Contao Open Source CMS.
*
* Copyright (c) 2020 Heimrich & Hannot GmbH
*
Expand All @@ -13,4 +14,4 @@
$GLOBALS['TL_LANG']['CTE'][ExtendedVideoElementController::TYPE] = [
'Erweiterter Videoplayer',
'Ein Inhaltselement, welches die Einbindung von Videos verschiedener Anbieter erlaubt.',
];
];
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
$GLOBALS['TL_LANG']['tl_content']['ytModestBranding'] = ['YouTube-Branding ausblenden', 'Wählen Sie diese Option, wenn YouTube-Branding-Infos ausgeblendet werden sollen.'];
$GLOBALS['TL_LANG']['tl_content']['ytShowInfo'] = ['Video-Infos anzeigen', 'Wählen Sie diese Option, wenn Infos zum Video angezeit werden sollen.'];
$GLOBALS['TL_LANG']['tl_content']['videoLinkText'] = ['Link-Text', 'Der angezeigte Text des Links, der die Lightbox bzw. das neue Browserfenster öffnet.'];
//$GLOBALS['TL_LANG']['tl_content']['youtube_template'] = ['Individuelles Youtube-Template', 'Überschreiben Sie das Standard Youtube-Template mit einer eigenen Vorlage.'];
// $GLOBALS['TL_LANG']['tl_content']['youtube_template'] = ['Individuelles Youtube-Template', 'Überschreiben Sie das Standard Youtube-Template mit einer eigenen Vorlage.'];
$GLOBALS['TL_LANG']['tl_content']['videofullsizeTemplate'] = ['Individuelles Template für Großansicht/Neues Fenster', 'Überschreiben Sie das Standard Template mit einer eigenen Vorlage zur Anzeige eines Videos in der Großansicht/Neues Fenster.'];
$GLOBALS['TL_LANG']['tl_content']['videoFullSize'] = ['Großansicht/Neues Fenster', 'Großansicht des Videos in einer Lightbox bzw. den Link in einem neuem Browserfenster öffnen.'];
$GLOBALS['TL_LANG']['tl_content']['videoAutoplay'] = ['Autoplay', 'Das Video automatisch beim Laden der Seite abspielen.'];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
<?php

/**
* Contao Open Source CMS
* Contao Open Source CMS.
*
* Copyright (c) 2020 Heimrich & Hannot GmbH
*
* @author Thomas Körner <[email protected]>
* @license http://www.gnu.org/licences/lgpl-3.0.html LGPL
*/

$lang = &$GLOBALS['TL_LANG']['tl_list_config_element'];

$lang['reference'][\HeimrichHannot\VideoBundle\ConfigElementType\VideoConfigElementType::getType()] = 'Video (Erweiterter Videoplayer)';
$lang['imageSelectorField']['videoSelector'] = 'Wählen Sie hier das Feld aus, das den boolschen Selektor für das Video enthält.';

$lang['video_legend'] = 'Video-Einstellungen';
$lang['video_legend'] = 'Video-Einstellungen';
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

/**
* Fields
* Fields.
*/
$GLOBALS['TL_LANG']['tl_news']['addWideImage'][0] = 'Breites Bild für die Detailseite hinzufügen';
$GLOBALS['TL_LANG']['tl_news']['addWideImage'][1] = 'Ein breites Bild nur für die Detailseite hinzufügen.';
$GLOBALS['TL_LANG']['tl_news']['addWideImage'][1] = 'Ein breites Bild nur für die Detailseite hinzufügen.';
Loading