Skip to content

Commit

Permalink
standart formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkejN committed Jan 3, 2019
1 parent b55ce5a commit 5493411
Show file tree
Hide file tree
Showing 14 changed files with 330 additions and 283 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ manifest/tmp/
symphony/
workspace/uploads/
install-log.txt
.vscode/
13 changes: 6 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@
],
"type": "contao-bundle",
"license": "LGPL-3.0-or-later",
"authors": [
{
"authors": [{
"name": "Markus Nestmann",
"role": "Developer"
},
{
"name":"postyou",
"homepage":"http://postyou.de"
"name": "postyou",
"homepage": "http://postyou.de"
}
],
"support": {
Expand All @@ -26,9 +25,9 @@
"php": "~7.0",
"contao/core-bundle": "~4.3"
},
"autoload" : {
"autoload": {
"psr-4": {
"Postyou\\ContaoABRStreamingBundle\\" : "src/"
"Postyou\\ContaoABRStreamingBundle\\": "src/"
},
"classmap": [
"src/Resources/contao/"
Expand All @@ -43,4 +42,4 @@
"extra": {
"contao-manager-plugin": "Postyou\\ContaoABRStreamingBundle\\ContaoManager\\Plugin"
}
}
}
18 changes: 11 additions & 7 deletions src/ContaoManager/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,32 @@
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2018 POSTYOU
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/

namespace Postyou\ContaoABRStreamingBundle\ContaoManager;

use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;

class Plugin implements BundlePluginInterface
{
/**
* Plugin for the Contao Manager.
*
* @author Markus Nestmann
*/
/**
* Plugin for the Contao Manager.
*
* @author Markus Nestmann
*/
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create('Postyou\ContaoABRStreamingBundle\PostyouContaoABRStreamingBundle')
->setLoadAfter(['Contao\CoreBundle\ContaoCoreBundle'])
];
}
}
}
5 changes: 3 additions & 2 deletions src/PostyouContaoABRStreamingBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2018 POSTYOU
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
namespace Postyou\ContaoABRStreamingBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class PostyouContaoABRStreamingBundle extends Bundle
{
}
}
17 changes: 13 additions & 4 deletions src/Resources/classes/dashPlayerPlugin.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
<?php

/**
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
namespace Postyou\ContaoABRStreamingBundle;

class dashPlayerPlugin
{
public function myParseFrontendTemplate($objTemplate)
{
if ($objTemplate->getName() == 'js_mediaelement')
{
if ($objTemplate->getName() == 'js_mediaelement') {
$objTemplate->setName('js_mediaelement_dash');
}
}
}
}
44 changes: 27 additions & 17 deletions src/Resources/classes/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<?php

/**
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
namespace Postyou\ContaoABRStreamingBundle;

use Contao\Input;
Expand All @@ -9,24 +19,24 @@
class tl_content
{
/**
* Show a hint if a JavaScript library needs to be included in the page layout
*
* @param object
*/
public function showJsLibraryHint($dc)
{
if ($_POST || Input::get('act') != 'edit')
{
return;
}
* Show a hint if a JavaScript library needs to be included in the page layout
*
* @param object
*/
public function showJsLibraryHint($dc)
{
if ($_POST || Input::get('act') != 'edit') {
return;
}

$objCte = ContentModel::findByPk($dc->id);
$objCte = ContentModel::findByPk($dc->id);

if ($objCte === null)
{
return;
if ($objCte === null) {
return;
}

if ($objCte->type == 'abrstreaming') Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplate'], 'js_mediaelement'));
if ($objCte->type == 'abrstreaming') {
Message::addInfo(sprintf($GLOBALS['TL_LANG']['tl_content']['includeTemplate'], 'js_mediaelement'));
}
}
}
}
5 changes: 3 additions & 2 deletions src/Resources/contao/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2018 POSTYOU
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/

$GLOBALS['TL_CTE']['media']['abrstreaming'] = 'Postyou\ContaoABRStreamingBundle\ContentAbrstreaming';
$GLOBALS['TL_MIME']['mpd'] = array('application/dash+xml', 'iconMPEG.svg');
$GLOBALS['TL_MIME']['m3u8'] = array('application/x-mpegURL', 'iconMPEG.svg');

$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('Postyou\ContaoABRStreamingBundle\dashPlayerPlugin', 'myParseFrontendTemplate');
$GLOBALS['TL_HOOKS']['parseTemplate'][] = array('Postyou\ContaoABRStreamingBundle\dashPlayerPlugin', 'myParseFrontendTemplate');
53 changes: 30 additions & 23 deletions src/Resources/contao/dca/tl_content.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,39 @@
<?php

/**
*
* Extension for Contao Open Source CMS (contao.org)
*
* Copyright (c) 2018-2019 POSTYOU
*
* @package
* @author Markus Nestmann
* @link http://www.postyou.de
* @license http://www.apache.org/licenses/LICENSE-2.0
*/
array_push($GLOBALS['TL_DCA']['tl_content']['config']['onload_callback'], array('Postyou\ContaoABRStreamingBundle\tl_content', 'showJsLibraryHint'));

// Add palette to tl_content
$GLOBALS['TL_DCA']['tl_content']['palettes']['abrstreaming'] = '{type_legend},type,headline;{sources},abrs_playerSRC;{poster_legend:hide},posterSRC;{player_legend},abrs_playerSize,abrs_autoplay;{template_legend:hide},customTpl;{protected_legend:hide},protected;{expert_legend:hide},guests,cssID;{invisible_legend:hide},invisible,start,stop';

// Add fields to tl_content
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_playerSRC'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['abrs_playerSRC'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'multiple'=>true, 'fieldType'=>'checkbox', 'extensions' =>'mpd, m3u8, mp4, m4v, mov, wmv, webm, ogv', 'mandatory'=>true, 'tl_class'=>'clr autoheight'),
'sql' => "blob NULL"
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_playerSRC'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['abrs_playerSRC'],
'exclude' => true,
'inputType' => 'fileTree',
'eval' => array('filesOnly'=>true, 'multiple'=>true, 'fieldType'=>'checkbox', 'extensions' =>'mpd, m3u8, mp4, m4v, mov, wmv, webm, ogv', 'mandatory'=>true, 'tl_class'=>'clr autoheight'),
'sql' => "blob NULL"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_playerSize'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['playerSize'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('multiple'=>true, 'size'=>2, 'rgxp'=>'natural', 'nospace'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_playerSize'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['playerSize'],
'exclude' => true,
'inputType' => 'text',
'eval' => array('multiple'=>true, 'size'=>2, 'rgxp'=>'natural', 'nospace'=>true, 'tl_class'=>'w50'),
'sql' => "varchar(64) NOT NULL default ''"
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_autoplay'] = array(
'label' => &$GLOBALS['TL_LANG']['tl_content']['autoplay'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
);
$GLOBALS['TL_DCA']['tl_content']['fields']['abrs_autoplay'] = array
(
'label' => &$GLOBALS['TL_LANG']['tl_content']['autoplay'],
'exclude' => true,
'inputType' => 'checkbox',
'eval' => array('tl_class'=>'w50 m12'),
'sql' => "char(1) NOT NULL default ''"
);
Loading

0 comments on commit 5493411

Please sign in to comment.