Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
197 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace Pumukit\BasePlayerBundle\Services; | ||
|
||
use Pumukit\SchemaBundle\Document\MultimediaObject; | ||
use Symfony\Bundle\FrameworkBundle\Routing\Router; | ||
|
||
class PlayerService | ||
{ | ||
/** | ||
* @var Router | ||
*/ | ||
private $router; | ||
|
||
/** | ||
* PlayerService constructor. | ||
* | ||
* @param Router $router | ||
*/ | ||
public function __construct(Router $router) | ||
{ | ||
$this->router = $router; | ||
} | ||
|
||
/** | ||
* @param MultimediaObject $multimediaObject | ||
* | ||
* @return mixed | ||
*/ | ||
public function getPublicControllerPlayer(MultimediaObject $multimediaObject) | ||
{ | ||
$url = $this->router->generate('pumukit_videoplayer_index', ['id' => $multimediaObject->getId()]); | ||
$url = $this->cleanUrl($url); | ||
$endpoint = $this->router->match($url); | ||
|
||
return $endpoint['_controller']; | ||
} | ||
|
||
/** | ||
* @param MultimediaObject $multimediaObject | ||
* | ||
* @return mixed | ||
*/ | ||
public function getMagicControllerPlayer(MultimediaObject $multimediaObject) | ||
{ | ||
$url = $this->router->generate('pumukit_videoplayer_magicindex', ['secret' => $multimediaObject->getSecret()]); | ||
$url = $this->cleanUrl($url); | ||
$endpoint = $this->router->match($url); | ||
|
||
return $endpoint['_controller']; | ||
} | ||
|
||
/** | ||
* @param $url | ||
* | ||
* @return mixed | ||
*/ | ||
private function cleanUrl($url) | ||
{ | ||
return str_replace('app_dev.php/', '', $url); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Pumukit\CoreBundle\Filter; | ||
|
||
use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; | ||
use Doctrine\ODM\MongoDB\Query\Filter\BsonFilter; | ||
use Pumukit\SchemaBundle\Document\MultimediaObject; | ||
|
||
class MicrositeFilter extends BsonFilter | ||
{ | ||
public function addFilterCriteria(ClassMetadata $targetDocument) | ||
{ | ||
if (MultimediaObject::class === $targetDocument->reflClass->name) { | ||
return ['tags.cod' => $this->getParameter('microsite_tag')]; | ||
} | ||
|
||
return []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 23 additions & 19 deletions
42
src/Pumukit/OpencastBundle/Resources/views/MediaPackage/filters.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,27 @@ | ||
<!-- Filter --> | ||
{% set criteria = app.session.get('admin/opencast/criteria') %} | ||
<div class="well"> | ||
<form class="form-horizontal" id="filter_mediapackages" action="{{ path('pumukitopencast') }}" method="get"> | ||
<form class="form-horizontal" id="filter_mediapackages" action="{{ path('pumukitopencast') }}" method="get"> | ||
<div class="panel panel-default" style="margin-bottom:10px"> | ||
<div class="panel-heading" role="tab" id="headingSearch"> | ||
<h2 class="panel-title"> | ||
{% trans %}Search{% endtrans %} | ||
</h2> | ||
</div> | ||
|
||
<fieldset> | ||
<legend hidden>{% trans %}Search{% endtrans %}</legend> | ||
<h2>{% trans %}Search{% endtrans %}</h2> | ||
<div class="form-group"> | ||
<label for="filters_name" class="col-md-2 control-label">{% trans %}Name{% endtrans %}:</label> | ||
{% set criteria = app.session.get('admin/opencast/criteria') %} | ||
<div class="col-md-10"> | ||
<input type="text" class="reset form-control" name="criteria[name]" id="filters_name" value="{{ criteria['name']|default("") }}"> | ||
</div> | ||
</div> | ||
</fieldset> | ||
<div class="panel-body"> | ||
<label for="filters_name" class="control-label">{% trans %}Name{% endtrans %}:</label> | ||
<input type="text" class="reset form-control" name="criteria[name]" id="filters_name" value="{{ criteria['name']|default("") }}"> | ||
</div> | ||
|
||
<div class="text-right"> | ||
<input class="btn btn-default btn-raised" onclick="window.location.href='?criteria[reset]=true'" type="button" value="{% trans %}reset{% endtrans %}"> | ||
<input class="btn btn-pumukit btn-raised" type="submit" name="filter" value="{% trans %}filter{% endtrans %}"> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<input class="btn btn-default btn-raised" onclick="window.location.href='?criteria[reset]=true'" type="button" value="{% trans %}reset{% endtrans %}"> | ||
</div> | ||
<div class="col-md-6"> | ||
<input class="btn btn-pumukit btn-raised" type="submit" name="filter" value="{% trans %}filter{% endtrans %}"> | ||
</div> | ||
</div> | ||
</form> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.