szurubooru/src/Views/post-file-render.phtml

49 lines
1.4 KiB
PHTML
Raw Normal View History

2014-02-27 15:04:36 +01:00
<?php CustomAssetViewDecorator::setPageThumb(\Chibi\UrlHelper::route('post', 'thumb', ['name' => $this->context->transport->post->name])) ?>
<?php $post = $this->context->transport->post ?>
<?php if ($post->type == PostType::Image): ?>
<?php if (!empty($this->context->imageLink)): ?>
2014-04-27 14:44:06 +02:00
<a href="<?= $this->context->imageLink ?>">
<?php endif ?>
2014-04-27 14:44:06 +02:00
<img src="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>" alt="<?= $post->name ?>"/>
<?php if (!empty($this->context->imageLink)): ?>
</a>
<?php endif ?>
<?php elseif ($post->type == PostType::Flash): ?>
2014-04-27 15:59:29 +02:00
<object
type="<?= $post->mimeType ?>"
width="<?= $post->imageWidth ?>"
height="<?= $post->imageHeight ?>"
data="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
2014-04-27 14:44:06 +02:00
<param name="movie" value="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>"/>
<param name="wmode" value="opaque"/>
2014-04-27 15:59:29 +02:00
</object>
<?php elseif ($post->type == PostType::Youtube): ?>
2014-04-27 15:59:29 +02:00
<iframe
style="width: 800px; height: 600px; border: 0;"
src="//www.youtube.com/embed/<?= $post->fileHash ?>?wmode=opaque"
allowfullscreen>
</iframe>
2014-04-08 16:54:36 +02:00
<?php elseif ($post->type == PostType::Video): ?>
2014-04-08 17:09:13 +02:00
<video style="max-width: 100%" controls>
2014-04-27 15:59:29 +02:00
<source
type="<?= $post->mimeType ?>"
src="<?= \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $post->name]) ?>">
2014-04-08 16:54:36 +02:00
Your browser doesn't support HTML5 &lt;video&gt; tag.
</video>
<?php endif ?>