Размер файла: 2.43Kb
<?php
$this->pageHeader = $this->pageTitle = CHtml::encode($model->name);
$isAuthor = Yii::app()->user->checkAccess('author', array('author' => $model->user->id));
?>
<?php if ($model->user->id != Yii::app()->user->record->id): ?>
<div class="blue_block">
<?= Theme::icon(Theme::ICON_USER) ?> <strong><?= Theme::username($model->user) ?></strong>
</div>
<div class="blue_block">
<strong>← <?= CHtml::link(Yii::t('Gallery', 'Back to all photos'), array('default/userPhotos', 'user' => $model->user->id)) ?></strong>
</div>
<?php else: ?>
<div class="blue_block">
<strong>← <?= CHtml::link(Yii::t('Gallery', 'Back to all photos'), array('default/myPhotos')) ?></strong>
</div>
<?php endif; ?>
<div class="text center-aligned">
<?= CHtml::link(CHtml::image($model->getWebPath(360), CHtml::encode($model->name)), $model->webPath) ?>
</div>
<div class="blue_block">
<?php if ($isAuthor || $this->checkAccess(array(
'gallery.photo.updatePhoto',
'gallery.photo.deletePhoto',
))): ?>
<!-- owner's menu -->
<div class="inline_actions">
<?php if ($isAuthor || $this->checkAccess(array('gallery.photo.updatePhoto'))): ?>
<?= Theme::icon(Theme::ICON_EDIT) ?> <strong><?= CHtml::link(Yii::t('Gallery', 'Change description'), array('update', 'id' => $model->id)) ?></strong>
<?php endif; ?>
<?php if ($isAuthor && $this->webUser->profile->avatar_id != $model->id): ?>
<?= Theme::icon(Theme::ICON_AVATAR) ?> <strong><?= CHtml::link(Yii::t('Gallery', 'Set avatar'), array('avatar', 'id' => $model->id)) ?></strong>
<?php endif; ?>
<?php if ($isAuthor || $this->checkAccess(array('gallery.photo.deletePhoto'))): ?>
<?= Theme::icon(Theme::ICON_DELETE) ?> <strong><?= CHtml::link(Yii::t('Gallery', 'Delete photo'), array('confirm', 'id' => $model->id)) ?></strong>
<?php endif; ?>
</div>
<!-- owner's menu -->
<?php endif; ?>
<?= CHtml::tag('span', array('style' => 'background-color: #FFE97F'), Theme::username($model->user)) ?>
<?= CHtml::tag('span', array('class' => 'datetime'), Yii::app()->dateFormatter->formatDateTimeReadable($model->uploaded_at)) ?>
</div>
<?php if (!empty($model->album)): ?>
<div class="blue_block">
<?= Theme::icon(Theme::ICON_FOLDER) ?> <strong><?= CHtml::link(CHtml::encode($model->album->name), array('album/index', 'id' => $model->album->id)) ?></strong>
</div>
<?php endif; ?>
<?php if (!empty($model->description)): ?>
<div class="text"><?= CHtml::encode($model->description) ?></div>
<?php endif; ?>