Ejemplo n.º 1
0
$this->params['breadcrumbs'][] = ['label' => Yii::t('gromver.platform', $model->menuType->title), 'url' => ['index', 'MenuItemSearch' => ['menu_type_id' => $model->menu_type_id]]];
/*if (($parent = $model->parent) && !$parent->isRoot()) {
    $this->params['breadcrumbs'][] = ['label' => $parent->title, 'url' => ['index', 'MenuItemSearch' => ['parent_id' => $parent->id]]];
}*/
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="menu-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('gromver.platform', 'Add'), ['create', 'menuTypeId' => $model->menu_type_id, 'parentId' => $model->parent_id, 'language' => $model->language], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-pencil"></i> ' . Yii::t('gromver.platform', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-trash"></i> ' . Yii::t('gromver.platform', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger pull-right', 'data' => ['confirm' => Yii::t('gromver.platform', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'translation_id', 'menu_type_id', 'parent_id', 'status', ['attribute' => 'language', 'value' => \gromver\platform\basic\modules\main\widgets\TranslationsBackend::widget(['model' => $model]), 'format' => 'raw'], 'title', 'alias', 'path', 'note', 'link', 'link_type', 'link_params:ntext', 'layout_path', 'access_rule', 'metakey', 'metadesc', 'robots', 'secure', 'created_at:datetime', 'updated_at:datetime', 'created_by', 'updated_by', 'lft', 'rgt', 'level', 'ordering', 'hits', 'lock']]);
?>

</div>
Ejemplo n.º 2
0
<div class="category-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('gromver.platform', 'Add'), ['create', 'parentId' => $model->parent_id, 'language' => $model->language], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-pencil"></i> ' . Yii::t('gromver.platform', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-trash"></i> ' . Yii::t('gromver.platform', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger pull-right', 'data' => ['confirm' => Yii::t('gromver.platform', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-th-list"></i> ' . Yii::t('gromver.platform', 'Posts'), ['/grom/news/backend/post/index', 'PostSearch' => ['category_id' => $model->id]], ['class' => 'btn btn-default']);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'translation_id', 'parent_id', ['attribute' => 'language', 'value' => \gromver\platform\basic\modules\main\widgets\TranslationsBackend::widget(['model' => $model]), 'format' => 'raw'], 'title', 'alias', 'path', 'preview_text:ntext', 'preview_image', 'detail_text:ntext', 'detail_image', 'metakey', 'metadesc', 'created_at:datetime', 'updated_at:datetime', 'published_at:datetime', 'status', 'created_by', 'updated_by', 'lft', 'rgt', 'level', 'ordering', 'hits', 'lock', ['attribute' => 'tags', 'value' => implode(', ', \yii\helpers\ArrayHelper::map($model->tags, 'id', function ($tag) {
    /** @var $tag \gromver\platform\basic\modules\tag\models\Tag */
    return Html::a($tag->title, $tag->getBackendViewLink());
})), 'format' => 'raw']]]);
?>

</div>
Ejemplo n.º 3
0
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
/*<p>
        <?= Html::a(Yii::t('gromver.platform', 'Create {modelClass}', [
    'modelClass' => 'Category',
]), ['create'], ['class' => 'btn btn-success']) ?>
    </p>*/
?>

    <?php 
echo GridView::widget(['id' => 'table-grid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'pjax' => true, 'pjaxSettings' => ['neverTimeout' => true], 'columns' => [['class' => '\\kartik\\grid\\CheckboxColumn'], ['attribute' => 'id', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'width' => '60px'], ['attribute' => 'language', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'width' => '80px', 'value' => function ($model) {
    /** @var \gromver\platform\basic\modules\news\models\Category $model */
    return \gromver\platform\basic\modules\main\widgets\TranslationsBackend::widget(['model' => $model]);
}, 'format' => 'raw', 'filter' => Yii::$app->getAcceptedLanguagesList()], ['attribute' => 'title', 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
    /** @var \gromver\platform\basic\modules\news\models\Category $model */
    return str_repeat(" • ", max($model->level - 2, 0)) . $model->title . '<br/>' . Html::tag('small', ' — ' . $model->path, ['class' => 'text-muted']);
}, 'format' => 'html'], ['attribute' => 'tags', 'width' => '120px', 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
    /** @var $model \gromver\platform\basic\modules\news\models\Category */
    return implode(', ', \yii\helpers\ArrayHelper::map($model->tags, 'id', 'title'));
}, 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['data' => \yii\helpers\ArrayHelper::map(\gromver\platform\basic\modules\tag\models\Tag::find()->where(['id' => $searchModel->tags])->all(), 'id', 'title'), 'theme' => \kartik\select2\Select2::THEME_BOOTSTRAP, 'pluginOptions' => ['allowClear' => true, 'placeholder' => Yii::t('gromver.platform', 'Select ...'), 'ajax' => ['url' => \yii\helpers\Url::to(['/grom/tag/backend/default/tag-list'])]]]], ['attribute' => 'published_at', 'vAlign' => GridView::ALIGN_MIDDLE, 'format' => ['date', 'd MMM Y H:mm'], 'width' => '160px', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['format' => 'dd.mm.yyyy'], 'type' => \kartik\date\DatePicker::TYPE_RANGE, 'attribute2' => 'published_at_to']], ['attribute' => 'status', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model, $index, $widget) {
    /** @var $model \gromver\platform\basic\modules\news\models\Category */
    return $model->status === \gromver\platform\basic\modules\news\models\Category::STATUS_PUBLISHED ? Html::a('<i class="glyphicon glyphicon-ok-circle"></i>', \yii\helpers\Url::to(['unpublish', 'id' => $model->id]), ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-method' => 'post']) : Html::a('<i class="glyphicon glyphicon-remove-circle"></i>', \yii\helpers\Url::to(['publish', 'id' => $model->id]), ['class' => 'btn btn-danger btn-xs', 'data-pjax' => '0', 'data-method' => 'post']);
}, 'filter' => \gromver\platform\basic\modules\news\models\Category::statusLabels(), 'format' => 'raw', 'width' => '100px'], ['attribute' => 'ordering', 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model, $index) {
    /** @var \gromver\platform\basic\modules\news\models\Category $model */
    return Html::input('text', 'order', $model->ordering, ['class' => 'form-control']);
}, 'format' => 'raw', 'width' => '100px'], ['header' => Yii::t('gromver.platform', 'Posts'), 'hAlign' => GridView::ALIGN_CENTER, 'vAlign' => GridView::ALIGN_MIDDLE, 'value' => function ($model) {
    /** @var \gromver\platform\basic\modules\news\models\Category $model */
    return Html::a('(' . $model->getPosts()->count() . ')', ['/grom/news/backend/post/index', 'PostSearch[category_id]' => $model->id], ['data-pjax' => 0]);
Ejemplo n.º 4
0
/* @var $this yii\web\View */
/* @var $model gromver\platform\basic\modules\tag\models\Tag */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => Yii::t('gromver.platform', 'Tags'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="tag-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('gromver.platform', 'Add'), ['create', 'language' => $model->language], ['class' => 'btn btn-success']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-pencil"></i> ' . Yii::t('gromver.platform', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('<i class="glyphicon glyphicon-trash"></i> ' . Yii::t('gromver.platform', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger pull-right', 'data' => ['confirm' => Yii::t('gromver.platform', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'translation_id', ['attribute' => 'language', 'value' => \gromver\platform\basic\modules\main\widgets\TranslationsBackend::widget(['model' => $model]), 'format' => 'raw'], 'title', 'alias', 'status', 'group', 'metakey', 'metadesc', 'created_at:datetime', 'updated_at:datetime', 'created_by', 'updated_by', 'hits', 'lock']]);
?>

</div>