예제 #1
0
<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use sircovsw\blog\Module;
/* @var $this yii\web\View */
/* @var $model sircovsw\blog\models\BlogCatalog */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Module::t('blog', 'Blog Catalogs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="blog-catalog-view">

	<p>
		<?php 
echo Html::a(Module::t('blog', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::a(Module::t('blog', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('blog', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
	</p>

	<?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'parent_id', 'value' => $model->parent_id ? $model->parent->title : Module::t('blog', 'Root Catalog')], 'title', 'surname', 'banner', ['attribute' => 'is_nav', 'value' => $model->isNavLabel], 'sort_order', 'page_size', 'template', 'redirect_url:url', ['attribute' => 'status', 'value' => $model->getStatus()->label], 'created_at:datetime', 'updated_at:datetime']]);
?>

</div>
예제 #2
0
<?php

use yii\helpers\Html;
use sircovsw\blog\Module;
/* @var $this yii\web\View */
/* @var $model sircovsw\blog\models\BlogCatalog */
$this->title = Module::t('blog', 'Create ') . Module::t('blog', 'Blog Catalog');
$this->params['breadcrumbs'][] = ['label' => Module::t('blog', 'Blog Catalogs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="blog-catalog-create">

	<?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
예제 #3
0
	<?php 
$form = ActiveForm::begin(['action' => ['index'], 'method' => 'get']);
?>

	<?php 
echo $form->field($model, 'id');
?>

	<?php 
echo $form->field($model, 'name');
?>

	<?php 
echo $form->field($model, 'frequency');
?>

	<div class="form-group">
		<?php 
echo Html::submitButton(Module::t('blog', 'Search'), ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::resetButton(Module::t('blog', 'Reset'), ['class' => 'btn btn-default']);
?>
	</div>

	<?php 
ActiveForm::end();
?>

</div>
예제 #4
0
 public static function labels()
 {
     return [self::STATUS_ACTIVE => Module::t('blog', 'STATUS_ACTIVE'), self::STATUS_INACTIVE => Module::t('blog', 'STATUS_INACTIVE'), self::STATUS_DELETED => Module::t('blog', 'STATUS_DELETED')];
 }
예제 #5
0
<?php

use yii\helpers\Html;
use sircovsw\blog\Module;
/* @var $this yii\web\View */
/* @var $model backend\modules\blog\models\BlogComment */
$this->title = Module::t('blog', 'Update ') . Module::t('blog', 'Blog Comment') . ' ' . $model->id;
$this->params['breadcrumbs'][] = ['label' => Module::t('blog', 'Blog Comments'), 'url' => ['index']];
$this->params['breadcrumbs'][] = ['label' => $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = Module::t('blog', 'Update');
?>
<div class="blog-comment-update">

	<?php 
echo $this->render('_form', ['model' => $model]);
?>

</div>
예제 #6
0
<?php

use yii\helpers\Html;
use sircovsw\blog\Module;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\blog\models\BlogPost */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Module::t('blog', 'Blog Posts'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="blog-post-view">

	<p>
		<?php 
echo Html::a(Module::t('blog', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
		<?php 
echo Html::a(Module::t('blog', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Module::t('blog', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
	</p>

	<?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'catalog_id', 'value' => $model->catalog->title], 'title', 'brief:ntext', 'content:ntext', 'tags', 'surname', 'banner', 'click', ['attribute' => 'user_id', 'value' => $model->user->username], ['attribute' => 'status', 'value' => $model->getStatus()->label], 'created_at:datetime', 'updated_at:datetime']]);
?>

</div>
예제 #7
0
					</div>-->
					<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
						<div class="panel panel-default arrow left">
							<div class="panel-body">
								<header class="text-left">
									<div class="comment-link">
										<i class="glyphicon glyphicon-link"></i>&nbsp;
										<?php 
    echo Html::a("#{$comment->id}", $comment->getUrl($post, false), ['class' => 'cid', 'title' => \sircovsw\blog\Module::t('blog', 'Permalink to this comment')]);
    ?>
										<?php 
    if (!empty($comment->parent_id)) {
        ?>
											<span>в ответ на</span>
											<?php 
        echo Html::a("#{$comment->parent_id}", $comment->getUrl($post, true), ['class' => 'cid', 'title' => \sircovsw\blog\Module::t('blog', 'Permalink to this comment')]);
        ?>
											<?php 
    }
    ?>
									</div>
									<div class="comment-user">
										<i class="glyphicon glyphicon-user"></i>&nbsp;<?php 
    echo $comment->authorLink;
    ?>
									</div>
									<div class="comment-post">
										<?php 
    echo nl2br(Html::encode($comment->content));
    ?>
									</div>
예제 #8
0
echo $form->field($model, 'content')->textarea(['rows' => 6]);
?>

	<?php 
echo $form->field($model, 'author')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'email')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'url')->textInput(['maxlength' => 128]);
?>

	<?php 
echo $form->field($model, 'status')->dropDownList(\sircovsw\blog\models\Status::labels());
?>

	<div class="form-group">
		<?php 
echo Html::submitButton($model->isNewRecord ? Module::t('blog', 'Create') : Module::t('blog', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']);
?>
	</div>

	<?php 
ActiveForm::end();
?>

</div>
예제 #9
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('blog', 'ID'), 'parent_id' => Module::t('blog', 'Parent ID'), 'post_id' => Module::t('blog', 'Post ID'), 'content' => Module::t('blog', 'Content'), 'author' => Module::t('blog', 'Author'), 'email' => Module::t('blog', 'Email'), 'url' => Module::t('blog', 'Url'), 'status' => Module::t('blog', 'Status'), 'created_at' => Module::t('blog', 'Created At'), 'updated_at' => Module::t('blog', 'Updated At')];
 }
예제 #10
0
<div class="blog-comment-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Module::t('blog', 'Create ') . Module::t('blog', 'Blog Comment'), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn'], 'id', 'parent_id', ['attribute' => 'post_id', 'value' => function ($model) {
    return mb_substr($model->post->title, 0, 15, 'utf-8') . '...';
}], ['attribute' => 'content', 'value' => function ($model) {
    return mb_substr(Yii::$app->formatter->asText($model->content), 0, 30, 'utf-8') . '...';
}], 'author', 'email:email', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === Status::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status === Status::STATUS_INACTIVE) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->getStatus()->label . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', Status::labels(), ['class' => 'form-control', 'prompt' => Module::t('blog', 'PROMPT_STATUS')])], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
예제 #11
0
<?php

use yii\helpers\Html;
use sircovsw\blog\Module;
use yii\grid\GridView;
use yii\helpers\ArrayHelper;
/* @var $this yii\web\View */
/* @var $searchModel backend\modules\blog\models\BlogTagSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Module::t('blog', 'Blog Tags');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="blog-tag-index">

	<?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

	<p>
		<?php 
echo Html::a(Module::t('blog', 'Create ') . Module::t('blog', 'Blog Tag'), ['create'], ['class' => 'btn btn-success']);
?>
	</p>

	<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\CheckboxColumn'], 'id', 'name', 'frequency', ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
예제 #12
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('blog', 'ID'), 'name' => Module::t('blog', 'Name'), 'frequency' => Module::t('blog', 'Frequency')];
 }
예제 #13
0
    ?>
" data-pjax="0"><span
						class="glyphicon glyphicon-eye-open"></span></a>
					<a href="<?php 
    echo \Yii::$app->getUrlManager()->createUrl(['blog/blog-catalog/update', 'id' => $item['id']]);
    ?>
"" title="<?php 
    echo Module::t('blog', 'Update');
    ?>
" data-pjax="0"><span
						class="glyphicon glyphicon-pencil"></span></a>
					<a href="<?php 
    echo \Yii::$app->getUrlManager()->createUrl(['blog/blog-catalog/delete', 'id' => $item['id']]);
    ?>
"" title="<?php 
    echo Module::t('blog', 'Delete');
    ?>
" data-confirm="<?php 
    echo Module::t('blog', 'Are you sure you want to delete this item?');
    ?>
" data-method="post" data-pjax="0"><span class="glyphicon glyphicon-trash"></span></a>
				</td>
			</tr>
		<?php 
}
?>
		</tbody>
	</table>

</div>
예제 #14
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return ['id' => Module::t('blog', 'ID'), 'catalog_id' => Module::t('blog', 'Catalog ID'), 'title' => Module::t('blog', 'Title'), 'brief' => Module::t('blog', 'Brief'), 'content' => Module::t('blog', 'Content'), 'tags' => Module::t('blog', 'Tags'), 'surname' => Module::t('blog', 'Surname'), 'banner' => Module::t('blog', 'Banner'), 'click' => Module::t('blog', 'Click'), 'user_id' => Module::t('blog', 'User ID'), 'status' => Module::t('blog', 'Status'), 'created_at' => Module::t('blog', 'Created At'), 'updated_at' => Module::t('blog', 'Updated At'), 'commentsCount' => Module::t('blog', 'Comments Count'), 'commentsCountActive' => Module::t('blog', 'Comments Count Active')];
 }
예제 #15
0
 /**
  * return all sub catalogs of a parent catalog
  * @param int $parentId
  * @param array $array
  * @return array
  */
 public static function getCatalog($parentId = 0, $array = array())
 {
     $newArray = array();
     foreach ((array) $array as $v) {
         if ($v['parent_id'] == $parentId) {
             $newArray[$v['id']] = array('text' => $v['title'] . ' навигация [' . ($v['is_nav'] ? Module::t('common', 'CONSTANT_YES') : Module::t('common', 'CONSTANT_NO')) . '] сортировка [' . $v['sort_order'] . '] тип [' . ($v['page_type'] == 'list' ? Module::t('common', 'PAGE_TYPE_LIST') : Module::t('common', 'PAGE_TYPE_PAGE')) . '] статус [' . F::getStatus2($v['status']) . '] [<a href="' . Yii::app()->createUrl('/catalog/update', array('id' => $v['id'])) . '">Изменить</a>][<a href="' . Yii::app()->createUrl('/catalog/create', array('id' => $v['id'])) . '">Создать</a>]&nbsp;&nbsp[<a href="' . Yii::app()->createUrl('/catalog/delete', array('id' => $v['id'])) . '">Удалить</a>]');
             $tempArray = self::getCatalog($v['id'], $array);
             if ($tempArray) {
                 $newArray[$v['id']]['children'] = $tempArray;
             }
         }
     }
     return $newArray;
 }