From 8ef94dd5a7cff05d23722917bf9f4dd8019897ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Burnichon?= Date: Wed, 13 Jan 2016 13:23:14 +0100 Subject: [PATCH] Fixup datafile embed --- lib/Alchemy/Phrasea/Application.php | 3 ++- .../Phrasea/Http/StaticFile/StaticMode.php | 5 ++--- templates/mobile/common/thumbnail.html.twig | 16 ++++++++-------- templates/web/common/thumbnail.html.twig | 8 ++++---- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index e5ba94f2d6..40afdb6799 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -74,6 +74,7 @@ use Alchemy\Phrasea\Core\Provider\UnicodeServiceProvider; use Alchemy\Phrasea\Core\Provider\ZippyServiceProvider; use Alchemy\Phrasea\Exception\InvalidArgumentException; use Alchemy\Phrasea\Form\Extension\HelpTypeExtension; +use Alchemy\Phrasea\Media\DatafilesResolver; use Alchemy\Phrasea\Media\MediaAccessorResolver; use Alchemy\Phrasea\Media\PermalinkMediaResolver; use Alchemy\Phrasea\Model\Entities\User; @@ -376,7 +377,7 @@ class Application extends SilexApplication } $resolvers = $this['alchemy_embed.resource_resolvers']; - $resolvers['datafiles'] = $resolvers->share(function () { + $resolvers['datafile'] = $resolvers->share(function () { return new DatafilesResolver($this->getApplicationBox(), $this['url_generator']); }); $resolvers['permalinks_permalink'] = $resolvers->share(function () { diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/StaticMode.php b/lib/Alchemy/Phrasea/Http/StaticFile/StaticMode.php index de5a1b4b7d..ca357da0a5 100644 --- a/lib/Alchemy/Phrasea/Http/StaticFile/StaticMode.php +++ b/lib/Alchemy/Phrasea/Http/StaticFile/StaticMode.php @@ -11,7 +11,6 @@ namespace Alchemy\Phrasea\Http\StaticFile; -use Alchemy\Phrasea\Http\AbstractServerMode; use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker; use Guzzle\Http\Url; @@ -26,10 +25,10 @@ class StaticMode /** * @param $pathFile - * @param null $etag + * @param null|string $etag * @return Url */ - public function getUrl($pathFile, $etag=null) + public function getUrl($pathFile, $etag = null) { $this->ensureSymlink($pathFile); diff --git a/templates/mobile/common/thumbnail.html.twig b/templates/mobile/common/thumbnail.html.twig index 9a486a6fee..8a220c40e5 100644 --- a/templates/mobile/common/thumbnail.html.twig +++ b/templates/mobile/common/thumbnail.html.twig @@ -33,20 +33,20 @@ {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'AUDIO_MP3' %} {% else %} + src="{{thumbnail.get_url()|trim}}" ondragstart="return false;"> {% endif %} @@ -58,18 +58,18 @@ {% set record_type = thumbnail.get_type() %} {% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %} {% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'AUDIO_MP3' %} {% else %} + src="{{thumbnail.get_url()|trim}}" ondragstart="return false;" /> {% endif %} {% endmacro %} diff --git a/templates/web/common/thumbnail.html.twig b/templates/web/common/thumbnail.html.twig index 99dfa2bce9..c662e37955 100644 --- a/templates/web/common/thumbnail.html.twig +++ b/templates/web/common/thumbnail.html.twig @@ -13,16 +13,16 @@
{% elseif record_type == 'FLEXPAPER' %} {% elseif record_type == 'AUDIO_MP3' %} {% else %} {% set fit_size = fitIn( @@ -32,7 +32,7 @@ + src="{% if lazyload %}/assets/common/images/grey.gif{% else %}{{ url|trim }}{% endif %}" data-original="{{ url|trim }}" ondragstart="return false;">