View file vkclone-0.0.1/protected/modules/groups/views/topic/index.php

File size: 1.57Kb
<?php
$this->pageHeader = $this->pageTitle = CHtml::encode($topic->name);
?>

<div class="blue_block">
	<strong>← <?= CHtml::link(Yii::t('Forums', 'Back to group {group}', array('{group}' => CHtml::encode($topic->group->name))), array('group/index', 'id' => $topic->group_id)) ?></strong>
</div>

<div class="blue_block">
	<strong>
	<?php if (Yii::app()->user->checkAccess('groups.topic.updateTopic') || $topic->group->checkAccess('moderator')): ?>
		<?= CHtml::image(Yii::app()->baseUrl.'/images/edit.png', 'edit', array('class' => 'favicon_image')) ?> <?= CHtml::link(Yii::t('Forums', 'Update topic'), array('update', 'id' => $topic->id)) ?><br />
	<?php endif; ?>
	<?php if (Yii::app()->user->checkAccess('groups.topic.deleteTopic') || $topic->group->checkAccess('moderator')): ?>
		<?= CHtml::image(Yii::app()->baseUrl.'/images/delete.png', 'delete', array('class' => 'favicon_image')) ?> <?= CHtml::link(Yii::t('Forums', 'Delete topic'), array('confirm', 'id' => $topic->id)) ?><br />
	<?php endif; ?>
	<?php if ($topic->group->checkAccess('member')): ?>
		<?= CHtml::image(Yii::app()->baseUrl.'/images/add.png', 'create', array('class' => 'favicon_image')) ?> <?= CHtml::link(Yii::t('Forums', 'Create new post'), array('createPost', 'id' => $topic->id)) ?><br />
	<?php endif; ?>
	</strong>
</div>

<?php $this->widget('zii.widgets.CListView', array(
	'dataProvider' => $posts,
	'itemView' => '../post/_post',
	'template' => '{items}'.PHP_EOL.'{pager}',
	'pager' => array('class' => 'CPager'),
	'emptyText' => CHtml::tag('div', array('class' => 'text'), Yii::t('Forums', 'No posts found')),
)) ?>