Skip to content

Commit 08b0224

Browse files
committed
Code Optimierungen
1 parent 8e548f5 commit 08b0224

File tree

8 files changed

+36
-39
lines changed

8 files changed

+36
-39
lines changed

assets/glightbox.css

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,26 +501,25 @@ iframe.wait-autoplay {
501501
/*Skin */
502502

503503
.glightbox-clean .gslide-description {
504-
background: #fff;
504+
background: #f5f5f5;
505+
margin-top: -2px;
505506
}
506507

507508
.glightbox-clean .gdesc-inner {
508509
padding: 22px 20px;
509510
}
510511

511512
.glightbox-clean .gslide-title {
512-
font-size: 1em;
513+
font-size: 1.25em;
513514
font-weight: normal;
514-
font-family: arial;
515515
color: #000;
516-
margin-bottom: 19px;
516+
margin-bottom: 0.5em;
517517
line-height: 1.4em;
518518
}
519519

520520
.glightbox-clean .gslide-desc {
521-
font-size: 0.86em;
521+
font-size: 1em;
522522
margin-bottom: 0;
523-
font-family: arial;
524523
line-height: 1.4em;
525524
}
526525

callbacks/Videohandbuch.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
*
88
*/
99

10-
class Videohandbuch extends \BackendModule
10+
class Videohandbuch extends BackendModule
1111
{
1212
protected $strTemplate = 'be_contao_academy_default';
1313

1414

1515
public function compile()
1616
{
17-
$intID = \Input::get('id');
17+
$intID = Input::get('id');
1818

1919
// Standardansicht | Listet alle Kategorien auf
2020
if (!$intID) {
@@ -26,14 +26,10 @@ public function compile()
2626

2727
// Kategorie gewählt | Liste alle Videos auf
2828
if ($intID) {
29-
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/contao_academy_client/assets/glightbox.js||static';
30-
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/contao_academy_client/assets/academy_vimeo.js||static';
31-
32-
33-
$this->Template = new \BackendTemplate('be_contao_academy_details');
29+
$this->Template = new BackendTemplate('be_contao_academy_details');
3430
$arrResponse = @AcademyRemote::sendRequest(array('action' => 'details', 'id' => $intID));
3531
$this->Template->Videos = $arrResponse;
36-
$this->Template->Kategoriename = \Input::get('catname');
32+
$this->Template->Kategoriename = Input::get('catname');
3733
}
3834
}
3935
}

classes/AcademyHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ public function HeaderVideohandbuch($strBuffer, $strTemplate)
2525
return $strBuffer;
2626
}
2727

28-
public static function COMParam()
28+
public static function COMParam(): array
2929
{
30-
return array('v' => academy_client, 'contao' => VERSION . '.' . BUILD, 'host' => \Environment::get('httpHost'));
30+
return array('v' => academy_client, 'contao' => VERSION . '.' . BUILD, 'host' => Environment::get('httpHost'));
3131
}
3232

3333
}

classes/AcademyRemote.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*/
99

10-
class AcademyRemote extends \System
10+
class AcademyRemote extends System
1111
{
1212
public function __construct()
1313
{
@@ -37,7 +37,7 @@ public static function sendRequest($arrData = array())
3737
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
3838
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
3939
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
40-
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL/' . $curlversion['version'] . ' ' . $curlversion["host"] . ' Videohandbuch - ' . \Environment::get("httpHost") . ' / Contao ' . VERSION . '.' . BUILD);
40+
curl_setopt($ch, CURLOPT_USERAGENT, 'cURL/' . $curlversion['version'] . ' ' . $curlversion["host"] . ' Videohandbuch - ' . Environment::get("httpHost") . ' / Contao ' . VERSION . '.' . BUILD);
4141
curl_setopt($ch, CURLOPT_TIMEOUT, 45);
4242
$strResponse = curl_exec($ch);
4343

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^7.0 || ^8.0",
22+
"ext-curl": "*",
2223
"contao/core-bundle": "^4.9",
2324
"contao-community-alliance/composer-plugin": "~2.4 || ~3.0"
2425
},

config/config.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@
77
*
88
*/
99

10-
define('academy_client', '1.2.0');
10+
const academy_client = '1.2.0';
1111

1212
if (file_exists(TL_ROOT . '/system/modules/contao_academy_client/classes/AcademyHelper.php')):
1313
$GLOBALS['TL_HOOKS']['outputBackendTemplate'][] = array('AcademyHelper', 'HeaderVideohandbuch');
1414
endif;
1515

1616
// CSS und JS fuer Backendview Academy
1717
if (TL_MODE == 'BE') {
18-
$GLOBALS['TL_CSS'][] = 'system/modules/contao_academy_client/assets/glightbox.css||static';
19-
$GLOBALS['TL_CSS'][] = 'system/modules/contao_academy_client/assets/academy.css||static';
18+
$GLOBALS['TL_CSS'][] = 'system/modules/contao_academy_client/assets/academy.css|static';
2019

21-
if (\Input::get('id') && \Input::get('do') == 'Videohandbuch') // Detailseite
20+
if (Input::get('id') && Input::get('do') == 'Videohandbuch') // Detailseite
2221
{
23-
22+
$GLOBALS['TL_CSS'][] = 'system/modules/contao_academy_client/assets/glightbox.css|static';
23+
$GLOBALS['TL_JAVASCRIPT'][] = 'system/modules/contao_academy_client/assets/glightbox.js|static';
2424
}
2525
}
2626

templates/be_contao_academy_default.html5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<?php if (is_array($this->Kategorien)): ?>
99
<?php foreach ($this->Kategorien as $objKategorie): ?>
1010
<?php //Videoarchiv Contao 4 ?>
11-
<?php if (version_compare(VERSION, '4.3', '>') && (strpos($objKategorie->title, 'Contao 3.5') == false)): ?>
11+
<?php if (version_compare(VERSION, '4.3', '>') && !strpos($objKategorie->title, 'Contao 3.5')): ?>
1212
<li class="ca-item cat_<?= $objKategorie->id ?>">
1313
<a href="<?= Backend::addToUrl('id=' . $objKategorie->id) . '&catname=' . urlencode($objKategorie->title) ?>"><?= $objKategorie->title ?></a>
1414
</li>

templates/be_contao_academy_details.html5

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,32 @@
1515
<?php foreach ($this->Videos as $objVideo): ?>
1616
<li class="ca-item video_<?= $objVideo->videoid ?>">
1717
<a class="glightbox" href="https://player.vimeo.com/video/<?= $objVideo->videoid ?>"
18-
data-glightbox="title: <?= $objVideo->headline ?>;"><?= $objVideo->headline ?>
18+
data-glightbox="title: <?= $objVideo->headline ?>; description: .custom-desc<?= $objVideo->videoid ?>"><?= $objVideo->headline ?>
1919
(<span><?= $objVideo->dauer ?> min</span>)</a>
20-
<?php if ($objVideo->content): ?>
21-
<div class="glightbox-desc custom-desc<?= $objVideo->videoid ?>">
20+
<div class="glightbox-desc custom-desc<?= $objVideo->videoid ?>">
21+
<?php if ($objVideo->content): ?>
2222
<?php foreach ($objVideo->content as $objContent): ?>
2323
<?php $txtOutput = base64_decode($objContent->text) ?>
2424
<?php $internalLink = preg_match('{{news_url::\d*}}', $txtOutput); ?>
2525
<?php if ($internalLink == 1): ?>
2626
<?php $txtOutput = strip_tags($txtOutput, '<p>'); ?>
2727
<?php endif; ?>
28-
<h3><?= $objContent->headline ?></h3>
28+
<strong><?= $objContent->headline ?></strong>
2929
<?= $txtOutput; ?>
3030
<?php endforeach; ?>
31-
</div>
32-
<?php endif; ?>
31+
<?php endif; ?>
32+
</div>
3333
</li>
3434
<?php endforeach; ?>
3535
</ol>
3636
<?php endif; ?>
37-
<script>
38-
const lightbox = GLightbox({
39-
touchNavigation: true,
40-
loop: false,
41-
autoplayVideos: true,
42-
closeOnOutsideClick: false,
43-
videosWidth: '80%'
44-
});
45-
</script>
37+
</div>
38+
<script>
39+
const lightbox = GLightbox({
40+
touchNavigation: true,
41+
loop: false,
42+
autoplayVideos: true,
43+
closeOnOutsideClick: false,
44+
videosWidth: '80%'
45+
});
46+
</script>

0 commit comments

Comments
 (0)