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

62 lines
1.5 KiB
PHTML
Raw Normal View History

2014-04-30 00:11:13 +02:00
<?php
Assets::setPageThumb(\Chibi\Router::linkTo(
['PostController', 'thumbAction'],
['name' => $this->context->transport->post->name]));
$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-30 00:11:13 +02:00
<img alt="<?= $post->name ?>"
src="<?= \Chibi\Router::linkTo(
['PostController', 'retrieveAction'],
['name' => $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 ?>"
2014-04-30 00:11:13 +02:00
data="<?= \Chibi\Router::linkTo(
['PostController', 'retrieveAction'],
['name' => $post->name]) ?>">
2014-04-27 15:59:29 +02:00
<param name="wmode" value="opaque"/>
2014-04-30 00:11:13 +02:00
<param name="movie" value="<?= \Chibi\Router::linkTo(
['PostController', 'retrieveAction'],
['name' => $post->name]) ?>"/>
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 ?>"
2014-04-30 00:11:13 +02:00
src="<?= \Chibi\Router::linkTo(
['PostController', 'retrieveAction'],
['name' => $post->name]) ?>">
2014-04-27 15:59:29 +02:00
2014-04-08 16:54:36 +02:00
Your browser doesn't support HTML5 &lt;video&gt; tag.
</video>
<?php endif ?>