mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-24 18:33:13 +00:00
Fixup datafile embed
This commit is contained in:
@@ -74,6 +74,7 @@ use Alchemy\Phrasea\Core\Provider\UnicodeServiceProvider;
|
|||||||
use Alchemy\Phrasea\Core\Provider\ZippyServiceProvider;
|
use Alchemy\Phrasea\Core\Provider\ZippyServiceProvider;
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Alchemy\Phrasea\Form\Extension\HelpTypeExtension;
|
use Alchemy\Phrasea\Form\Extension\HelpTypeExtension;
|
||||||
|
use Alchemy\Phrasea\Media\DatafilesResolver;
|
||||||
use Alchemy\Phrasea\Media\MediaAccessorResolver;
|
use Alchemy\Phrasea\Media\MediaAccessorResolver;
|
||||||
use Alchemy\Phrasea\Media\PermalinkMediaResolver;
|
use Alchemy\Phrasea\Media\PermalinkMediaResolver;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
@@ -376,7 +377,7 @@ class Application extends SilexApplication
|
|||||||
}
|
}
|
||||||
|
|
||||||
$resolvers = $this['alchemy_embed.resource_resolvers'];
|
$resolvers = $this['alchemy_embed.resource_resolvers'];
|
||||||
$resolvers['datafiles'] = $resolvers->share(function () {
|
$resolvers['datafile'] = $resolvers->share(function () {
|
||||||
return new DatafilesResolver($this->getApplicationBox(), $this['url_generator']);
|
return new DatafilesResolver($this->getApplicationBox(), $this['url_generator']);
|
||||||
});
|
});
|
||||||
$resolvers['permalinks_permalink'] = $resolvers->share(function () {
|
$resolvers['permalinks_permalink'] = $resolvers->share(function () {
|
||||||
|
|||||||
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Http\StaticFile;
|
namespace Alchemy\Phrasea\Http\StaticFile;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Http\AbstractServerMode;
|
|
||||||
use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker;
|
use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker;
|
||||||
use Guzzle\Http\Url;
|
use Guzzle\Http\Url;
|
||||||
|
|
||||||
@@ -26,10 +25,10 @@ class StaticMode
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $pathFile
|
* @param $pathFile
|
||||||
* @param null $etag
|
* @param null|string $etag
|
||||||
* @return Url
|
* @return Url
|
||||||
*/
|
*/
|
||||||
public function getUrl($pathFile, $etag=null)
|
public function getUrl($pathFile, $etag = null)
|
||||||
{
|
{
|
||||||
$this->ensureSymlink($pathFile);
|
$this->ensureSymlink($pathFile);
|
||||||
|
|
||||||
|
|||||||
@@ -33,20 +33,20 @@
|
|||||||
|
|
||||||
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
|
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% elseif record_type == 'FLEXPAPER' %}
|
{% elseif record_type == 'FLEXPAPER' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% elseif record_type == 'AUDIO_MP3' %}
|
{% elseif record_type == 'AUDIO_MP3' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
<img class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
||||||
style="width:{{d_width|round}}px;height:{{d_height|round}}px;top:{{top|round}}px;"
|
style="width:{{d_width|round}}px;height:{{d_height|round}}px;top:{{top|round}}px;"
|
||||||
src="{{thumbnail.get_url()}}" ondragstart="return false;">
|
src="{{thumbnail.get_url()|trim}}" ondragstart="return false;">
|
||||||
<input type="hidden" name="width" value="{{thumbnail_width}}"/>
|
<input type="hidden" name="width" value="{{thumbnail_width}}"/>
|
||||||
<input type="hidden" name="height" value="{{thumbnail_height}}"/>
|
<input type="hidden" name="height" value="{{thumbnail_height}}"/>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -58,18 +58,18 @@
|
|||||||
{% set record_type = thumbnail.get_type() %}
|
{% set record_type = thumbnail.get_type() %}
|
||||||
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
|
{% if record_type == 'VIDEO_MP4' or record_type == 'VIDEO_FLV' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% elseif record_type == 'FLEXPAPER' %}
|
{% elseif record_type == 'FLEXPAPER' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% elseif record_type == 'AUDIO_MP3' %}
|
{% elseif record_type == 'AUDIO_MP3' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% else %}
|
{% else %}
|
||||||
<img style="max-height: 100%;max-width:100%" class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
<img style="max-height: 100%;max-width:100%" class="record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
||||||
src="{{thumbnail.get_url()}}" ondragstart="return false;" />
|
src="{{thumbnail.get_url()|trim}}" ondragstart="return false;" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|||||||
@@ -13,16 +13,16 @@
|
|||||||
<div style="width:{{original_w}}px;height: {{ original_h }}px" class="videoTips">
|
<div style="width:{{original_w}}px;height: {{ original_h }}px" class="videoTips">
|
||||||
|
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
</div>
|
</div>
|
||||||
{% elseif record_type == 'FLEXPAPER' %}
|
{% elseif record_type == 'FLEXPAPER' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% elseif record_type == 'AUDIO_MP3' %}
|
{% elseif record_type == 'AUDIO_MP3' %}
|
||||||
<iframe width="100%" height="100%"
|
<iframe width="100%" height="100%"
|
||||||
src="{{ url('alchemy_embed_view', {url: url, autoplay: autoplay|default('false') }) }}"
|
src="{{ url('alchemy_embed_view', {url: url|trim, autoplay: autoplay|default('false') }) }}"
|
||||||
frameborder="0" allowfullscreen></iframe>
|
frameborder="0" allowfullscreen></iframe>
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set fit_size = fitIn(
|
{% set fit_size = fitIn(
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
|
|
||||||
<img class="{% if lazyload %}lazyload{% endif %} record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
<img class="{% if lazyload %}lazyload{% endif %} record record_image imgTips zoomable thumb" oncontextMenu="return(false);"
|
||||||
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
|
style="width:{{fit_size.width}}px;height:{{fit_size.height}}px;top:{{fit_size.top}}px;"
|
||||||
src="{% if lazyload %}/assets/common/images/grey.gif{% else %}{{ url }}{% endif %}" data-original="{{ url }}" ondragstart="return false;">
|
src="{% if lazyload %}/assets/common/images/grey.gif{% else %}{{ url|trim }}{% endif %}" data-original="{{ url|trim }}" ondragstart="return false;">
|
||||||
<input type="hidden" name="width" value="{{original_w}}"/>
|
<input type="hidden" name="width" value="{{original_w}}"/>
|
||||||
<input type="hidden" name="height" value="{{original_h}}"/>
|
<input type="hidden" name="height" value="{{original_h}}"/>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user