Flash support

This commit is contained in:
Marcin Kurczewski 2013-10-09 21:58:57 +02:00
parent 35e097d0ce
commit 4737f4a184
2 changed files with 8 additions and 1 deletions

View file

@ -207,6 +207,7 @@ class PostController
PrivilegesHelper::confirmWithException($this->context->user, Privilege::ViewPost);
PrivilegesHelper::confirmWithException($this->context->user, Privilege::ViewPost, PostSafety::toString($post->safety));
$this->context->stylesheets []= 'post-view.css';
$this->context->subTitle = 'showing @' . $post->id;
$this->context->transport->post = $post;
}

View file

@ -1,5 +1,11 @@
<?php if (!empty($this->context->transport->errorMessage)): ?>
<p class="alert alert-error"><?php echo $this->context->transport->errorMessage ?></p>
<?php else: ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
<div class="post-wrapper">
<?php if ($this->context->transport->post->type == PostType::Image): ?>
<img src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>" alt="<?php echo $this->context->transport->post->name ?>"/>
<?php elseif ($this->context->transport->post->type == PostType::Flash): ?>
<embed type="application/x-shockwave-flash" src="<?php echo \Chibi\UrlHelper::route('post', 'retrieve', ['name' => $this->context->transport->post->name]) ?>"/>
<?php endif ?>
</div>
<?php endif ?>