本文整理汇总了PHP中pavlinter\adm\Adm::widget方法的典型用法代码示例。如果您正苦于以下问题:PHP Adm::widget方法的具体用法?PHP Adm::widget怎么用?PHP Adm::widget使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pavlinter\adm\Adm
的用法示例。
在下文中一共展示了Adm::widget方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
echo $form->field($modelLang, '[' . $id_language . ']description')->textarea(['maxlength' => 200]);
?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php
echo Adm::widget('Redactor', ['form' => $form, 'model' => $modelLang, 'attribute' => '[' . $id_language . ']short_text']);
?>
</div>
<div class="col-xs-12 col-sm-12 col-md-12">
<?php
echo Adm::widget('Redactor', ['form' => $form, 'model' => $modelLang, 'attribute' => '[' . $id_language . ']text']);
?>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</section>
<div class="row">
<div class="col-xs-6 col-sm-4 col-md-4">
<?php
echo $form->field($model, 'weight')->textInput(['maxlength' => 10]);
示例2: isset
<section class="main-box">
<?php
if (isset($this->params['breadcrumbs'])) {
?>
<div class="breadcrumbs-box clearfix">
<?php
echo Breadcrumbs::widget(['homeLink' => ['label' => Yii::t("adm", "Home", ['dot' => false]), 'url' => ['/' . $adm->id]], 'links' => isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : []]);
?>
</div>
<?php
}
?>
<div class="wrapper">
<?php
Adm::widget('Alert', ['options' => ['class' => 'main-alert']]);
?>
<?php
echo $content;
?>
</div>
</section>
<?php
if ($adm->hasEventHandlers(Adm::EVENT_RIGHT_MENU)) {
?>
<aside class="bg-light lter b-l aside-sm">
<div class="wrapper"><?php
$adm->trigger(Adm::EVENT_RIGHT_MENU);
?>
</div>
</aside>
示例3:
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
echo $form->field($model, 'code')->textInput(['maxlength' => 16]);
?>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
echo $form->field($model, 'name')->textInput(['maxlength' => 20]);
?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
echo Adm::widget('FileInput', ['form' => $form, 'model' => $model, 'attribute' => 'image']);
?>
</div>
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
echo $form->field($model, 'weight')->textInput();
?>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-6 col-md-6">
<?php
if ($show) {
?>
<?php
示例4: function
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'columns' => [['attribute' => 'id', 'vAlign' => 'middle', 'hAlign' => 'center', 'width' => '80px'], ['attribute' => 'payment_id', 'width' => '130px', 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'email', 'vAlign' => 'middle', 'hAlign' => 'center', 'format' => 'raw', 'value' => function ($model) {
if ($model->user_id) {
$res = Html::a('', ['/adm/user/update', 'id' => $model->user_id], ['class' => 'glyphicon glyphicon-eye-open']) . ' ';
$res .= Yii::$app->formatter->asEmail($model->email);
return $res;
}
return Yii::$app->formatter->asEmail($model->email);
}], ['attribute' => 'price', 'width' => '130px', 'vAlign' => 'middle', 'hAlign' => 'center', 'pageSummary' => function ($summary, $data, $widget) {
return Adm::t('oplata', 'Count is {summary}', ['summary' => $summary, 'dot' => true]);
}, 'format' => ['decimal', 2], 'value' => function ($model) {
return $model->price + $model->shipping;
}], ['attribute' => 'currency', 'width' => '50px', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => Module::getInstance()->manager->createOplataTransactionQuery('currency_list'), 'value' => function ($model) {
if (!empty($model->currency)) {
return Module::getInstance()->manager->createOplataTransactionQuery('currency_list', $model->currency);
}
}, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => -1]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'response_status', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => Module::getInstance()->manager->createOplataTransactionQuery('status_list'), 'value' => function ($model) {
if (!empty($model->response_status)) {
$text = Module::getInstance()->manager->createOplataTransactionQuery('status_list', $model->response_status);
$class = '';
if ($model->response_status === $model::STATUS_SUCCESS) {
$class = 'text-success';
} else {
if ($model->response_status === $model::STATUS_FAILURE) {
$class = 'text-danger';
}
}
return Html::tag('span', $text, ['class' => $class]);
}
}, 'filterWidgetOptions' => ['pluginOptions' => ['escapeMarkup' => new JsExpression('function (m) { return m; }'), 'allowClear' => true, 'minimumResultsForSearch' => -1]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'method', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::merge(['null' => Yii::t('yii', '(not set)')], Module::getInstance()->manager->createOplataTransactionQuery('method_list')), 'value' => function ($model) {
if (!empty($model->response_status)) {
$text = Module::getInstance()->manager->createOplataTransactionQuery('method_list', $model->method);
return $text;
}
}, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'minimumResultsForSearch' => -1]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'created_at', 'width' => '160px', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']], 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'date_end', 'width' => '160px', 'filterType' => GridView::FILTER_DATE, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'todayHighlight' => true, 'format' => 'yyyy-mm-dd']], 'vAlign' => 'middle', 'hAlign' => 'center'], ['attribute' => 'sent_email', 'width' => '120px', 'vAlign' => 'middle', 'hAlign' => 'center', 'format' => 'raw', 'value' => function ($model) {
$remind = '';
if ($model->remind_note) {
$remind = ' ' . Html::tag('span', '', ['class' => 'fa fa-envelope-o text-success cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Remind note sent')]);
}
if ($model->sent_email || $model->response_status !== $model::STATUS_NOT_PAID) {
return Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok text-success cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Email Sent')]) . $remind;
}
return \pavlinter\buttons\AjaxButton::widget(['label' => Adm::t('oplata', 'Send'), 'options' => ['class' => 'btn btn-primary'], 'ajaxOptions' => ['url' => Url::to('send-email'), 'data' => ['id' => $model->id], 'done' => 'function(data){
if(data.r){
$("#" + abId).next("span").removeClass("hide").end().remove();
}
}']]) . Html::tag('span', '', ['class' => 'glyphicon glyphicon-ok text-success hide cursor-help', 'data-toggle' => 'tooltip', 'title' => Adm::t('admoplata', 'Email Sent')]) . $remind;
}], ['class' => '\\kartik\\grid\\ActionColumn', 'width' => '100px', 'template' => '{pay} {view} {update} {delete}', 'buttons' => ['view' => function ($url, $model) {
if ($model->alias) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['default/invoice', 'alias' => $model->alias], ['title' => Yii::t('yii', 'View'), 'data-pjax' => '0', 'target' => '_blank']);
}
}, 'update' => function ($url, $model) {
if (!Adm::getInstance()->user->can('Adm-OplataUpdate')) {
return null;
}
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}, 'delete' => function ($url, $model) {
if (!Adm::getInstance()->user->can('Adm-OplataDelete')) {
return null;
}
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
}, 'pay' => function ($url, $model) {
if ($model->alias) {
return Html::a(null, 'javascript:void(0);', ['class' => 'fa fa-link', 'data-pjax' => '0', 'data-toggle' => 'popover', 'data-placement' => 'top', 'data-content' => Url::to(['default/invoice', 'alias' => $model->alias], true)]);
}
}]]]]);
示例5: function
/* @var $searchModel pavlinter\adm\models\AuthItemSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
Yii::$app->i18n->disableDot();
$this->title = Adm::t('auth', 'Auth Items');
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->i18n->resetDot();
?>
<div class="auth-item-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('auth', 'Create Auth Item'), ['create'], ['class' => 'btn btn-primary']);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'name', ['attribute' => 'type', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
return $model::typeList($model->type);
}, 'filterOptions' => ['style' => 'padding:8px 1px;'], 'filterType' => GridView::FILTER_SELECT2, 'filter' => $searchModel::typeList(), 'filterWidgetOptions' => ['pluginOptions' => ['width' => '120px', 'allowClear' => true]]], 'description:ntext', 'rule_name', ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'width' => '70px']]]);
?>
</div>
示例6: function
?>
<div class="user-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('user', 'Create User'), ['create'], ['class' => 'btn btn-primary']);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'username', 'email:email', ['attribute' => 'role', 'vAlign' => 'middle', 'value' => function ($model, $key, $index, $widget) {
return $model::roles($model->role);
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $searchModel::roles(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'status', 'vAlign' => 'middle', 'value' => function ($model, $key, $index, $widget) {
return $model::status($model->status);
}, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $searchModel::status(), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => Adm::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{login} {view} {update} {delete}', 'buttons' => ['delete' => function ($url, $model) {
if ($model->id == Adm::getInstance()->user->getId()) {
return null;
}
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0']);
}, 'login' => function ($url, $model) {
return Html::a('<span class="glyphicon glyphicon-sunglasses"></span>', ['/profilelogin/default/login', 'username' => $model->username], ['title' => Yii::t('adm/title', 'Login', ['dot' => false]), 'data-method' => 'post', 'data-pjax' => '0']);
}]]]]);
?>
</div>
示例7:
?>
</ul>
</header>
<div class="panel-body">
<div class="tab-content">
<?php
foreach (Yii::$app->getI18n()->getLanguages() as $id_language => $language) {
?>
<div class="tab-pane" id="lang-<?php
echo $id_language;
?>
">
<div class="row">
<div class="col-xs-12 col-sm-12 col-md-12">
<?php
echo Adm::widget('Redactor', ['form' => $form, 'model' => $model->getOneTranslation($id_language), 'attribute' => '[' . $id_language . ']translation', 'removeFirstTag' => true]);
?>
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</section>
<div class="form-group">
<?php
echo InputButton::widget(['label' => Adm::t('', 'Update', ['dot' => false]), 'options' => ['class' => 'btn btn-primary'], 'input' => 'adm-redirect', 'name' => 'redirect', 'formSelector' => $form]);
?>
示例8: function
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
if ($show) {
?>
<?php
echo Html::a(Adm::t('language', 'Create Language'), ['create'], ['class' => 'btn btn-primary']);
?>
<?php
}
?>
<?php
echo Html::a('!', '#', ['class' => 'btn btn-primary btn-adm-nestable-view']);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'nestable' => ['id' => 'pages-nestable-grid', 'btn' => false, 'nameCol' => 'name', 'parentCol' => false, 'orderBy' => SORT_ASC], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'image', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
if ($model->image) {
return Html::img($model->image, ['style' => 'max-width: 100px;max-height:100px;']);
}
}, 'width' => '100px'], 'name', 'code', ['class' => 'app\\widgets\\BooleanColumn', 'attribute' => 'active', 'update' => ['updated_at' => time()], 'tableName' => $searchModel::tableName(), 'visible' => $show], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'width' => '70px']]]);
?>
</div>
示例9:
}
?>
<div class="user-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('user', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
if (!Adm::getInstance()->user->can('Adm-UpdateOwnUser', $model)) {
?>
<?php
echo Html::a(Adm::t('user', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Adm::t('user', 'Are you sure you want to delete this item?', ['dot' => false]), 'method' => 'post']]);
?>
<?php
}
?>
</p>
<?php
echo Adm::widget('DetailView', ['model' => $model, 'hover' => true, 'mode' => \kartik\detail\DetailView::MODE_VIEW, 'attributes' => ['username', 'email:email', ['attribute' => 'status', 'value' => $model->status_list($model->status)], ['attribute' => 'role', 'label' => Yii::t('modelAdm/user', 'Assignment Role'), 'format' => 'raw', 'value' => $rolesStr], ['attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDate($model->updated_at)], ['attribute' => 'created_at', 'value' => Yii::$app->formatter->asDate($model->created_at)]]]);
?>
</div>
示例10:
use pavlinter\adm\Adm;
/* @var $this yii\web\View */
/* @var $model app\models\ContactMsg */
Yii::$app->i18n->disableDot();
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => Adm::t('app/contact_msg', 'Contact Msgs'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
Yii::$app->i18n->resetDot();
?>
<div class="contact-msg-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('app/contact_msg', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Adm::t('app/contact_msg', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Adm::t('app/contact_msg', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</p>
<?php
echo Adm::widget('DetailView', ['model' => $model, 'hover' => true, 'mode' => \kartik\detail\DetailView::MODE_VIEW, 'attributes' => [['attribute' => 'id', 'format' => 'text'], ['attribute' => 'from_email', 'format' => 'email'], ['attribute' => 'to_email', 'format' => 'email'], ['attribute' => 'subject', 'format' => 'text'], ['attribute' => 'text', 'format' => 'raw'], ['attribute' => 'created_at', 'format' => 'text'], ['attribute' => 'updated_at', 'format' => 'text']]]);
?>
</div>
示例11:
?>
">
<?php
echo Yii::t('adm-mailing', 'Variables', ['dot' => false]);
?>
</a>
<div class="mailing-variables collapse m-b-sm" id="mailing-variables-<?php
echo $id_language;
?>
"></div>
<?php
echo $form->field($model->getTranslation($id_language), '[' . $id_language . ']subject')->textInput(['maxlength' => 100]);
?>
<?php
echo \pavlinter\adm\Adm::widget('Redactor', ['form' => $form, 'model' => $model->getTranslation($id_language), 'attribute' => '[' . $id_language . ']text']);
?>
</div>
<?php
}
?>
</div>
</div>
</section>
<div class="form-group">
<?php
echo InputButton::widget(['label' => $model->isNewRecord ? Adm::t('', 'Create', ['dot' => false]) : Adm::t('', 'Update', ['dot' => false]), 'options' => ['class' => 'btn btn-primary'], 'input' => 'adm-redirect', 'name' => 'redirect', 'formSelector' => $form]);
?>
示例12: translation
<?php
if (Yii::$app->request->get('is-empty')) {
?>
<?php
echo Html::a(Adm::t('source-message', 'Only not translation(disable)'), Url::current(['is-empty' => null]), ['class' => 'btn btn-danger']);
?>
<?php
} else {
?>
<?php
echo Html::a(Adm::t('source-message', 'Only not translation'), Url::current(['is-empty' => 1]), ['class' => 'btn btn-primary']);
?>
<?php
}
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'category', 'message', ['attribute' => 'translation', 'format' => 'raw', 'value' => function ($model, $index, $widget) {
$text = Html::encode(Yii::t($model->category, $model->message, ['dot' => false]));
$dot = Yii::t($model->category, $model->message, ['dot' => '.']);
return $text . $dot;
}], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'width' => '70px']]]);
?>
</div>
示例13:
Yii::$app->i18n->resetDot();
?>
<div class="user-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('user', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
if (!Adm::getInstance()->user->can('Adm-UpdateOwnUser', $model)) {
?>
<?php
echo Html::a(Adm::t('user', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Adm::t('user', 'Are you sure you want to delete this item?', ['dot' => false]), 'method' => 'post']]);
?>
<?php
}
?>
</p>
<?php
echo Adm::widget('DetailView', ['model' => $model, 'hover' => true, 'mode' => \kartik\detail\DetailView::MODE_VIEW, 'attributes' => ['username', 'email:email', ['attribute' => 'role', 'value' => $model->roles($model->role)], ['attribute' => 'status', 'value' => $model->status($model->status)], ['attribute' => 'updated_at', 'value' => Yii::$app->formatter->asDate($model->updated_at)], ['attribute' => 'created_at', 'value' => Yii::$app->formatter->asDate($model->created_at)]]]);
?>
</div>
示例14: function
<div class="params-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Adm::t('admparams', 'Create Params'), ['create'], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Adm::t('admparams', 'Add Default Params'), [''], ['class' => 'btn btn-success pull-right', 'data' => ['method' => 'post', 'params' => ['admparams-load-params' => '1']]]);
?>
</p>
<?php
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'name', 'vAlign' => 'middle'], ['attribute' => 'value', 'vAlign' => 'middle', 'value' => function ($model) {
return \yii\helpers\StringHelper::truncate($model->value, 70);
}], ['attribute' => 'description', 'vAlign' => 'middle', 'format' => 'raw', 'value' => function ($model) {
return Module::t('description', $model->name, ['dot' => true]);
}], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{update} {delete}', 'options' => ['style' => 'width:70px;'], 'buttons' => ['update' => function ($url, $model, $key) {
if ($model->isSerialized()) {
return null;
}
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}]]]]);
?>
</div>
示例15: function
echo Adm::widget('GridView', ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'nestable' => $id_parent === false ? false : ['id' => 'pages-nestable-grid', 'btn' => false, 'orderBy' => SORT_DESC], 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], ['attribute' => 'id_parent', 'vAlign' => 'middle', 'hAlign' => 'center', 'format' => 'html', 'enableSorting' => false, 'visible' => $id_parent === false, 'value' => function ($model) {
if ($model->parent) {
return Html::a($model->parent->name, ['', 'id_parent' => $model->id_parent]);
}
}], ['attribute' => 'name', 'vAlign' => 'middle', 'hAlign' => 'center', 'value' => function ($model) {
return $model->name;
}], ['attribute' => 'title', 'vAlign' => 'middle', 'hAlign' => 'center', 'value' => function ($model) {
return $model->title;
}], ['attribute' => 'alias', 'vAlign' => 'middle', 'hAlign' => 'center', 'value' => function ($model) {
if ($model->url) {
return $model->url;
}
return $model->alias;
}], ['attribute' => 'layout', 'vAlign' => 'middle', 'hAlign' => 'center', 'vAlign' => 'middle', 'filterType' => GridView::FILTER_SELECT2, 'filter' => Module::getInstance()->pageLayouts, 'value' => function ($model) {
if (isset(Module::getInstance()->pageLayouts[$model->layout])) {
return Module::getInstance()->pageLayouts[$model->layout];
}
}, 'filterWidgetOptions' => ['pluginOptions' => ['width' => '100px', 'allowClear' => true]], 'filterInputOptions' => ['placeholder' => Module::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'type', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filter' => Module::getInstance()->pageTypes, 'value' => function ($model) {
if (isset(Module::getInstance()->pageTypes[$model->type])) {
return Module::getInstance()->pageTypes[$model->type];
}
}, 'filterWidgetOptions' => ['pluginOptions' => ['width' => '100px', 'allowClear' => true]], 'filterInputOptions' => ['placeholder' => Module::t('', 'Select ...', ['dot' => false])], 'format' => 'raw'], ['attribute' => 'weight', 'width' => '50px', 'vAlign' => 'middle', 'hAlign' => 'center'], ['class' => 'kartik\\grid\\BooleanColumn', 'attribute' => 'active', 'width' => '50px', 'vAlign' => 'middle', 'hAlign' => 'center', 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['options' => ['placeholder' => Module::t('', 'Select ...', ['dot' => false])], 'pluginOptions' => ['width' => '100px', 'allowClear' => true]]], ['class' => 'kartik\\grid\\ActionColumn', 'width' => '130px', 'template' => '{view} {update} {subpages} {files} {copy} {delete}', 'buttons' => ['update' => function ($url, $model, $key) {
$url = ['update', 'id' => $model->id];
if ($model->id_parent) {
$url['id_parent'] = $model->id_parent;
} else {
$url['id_parent'] = 0;
}
return Html::a('<span class="glyphicon glyphicon-pencil"></span>', $url, ['title' => Yii::t('yii', 'Update'), 'data-pjax' => '0']);
}, 'delete' => function ($url, $model) {
if (in_array($model->id, Module::getInstance()->closeDeletePage)) {
return null;
}
$url = ['delete', 'id' => $model->id];
if ($model->id_parent) {
$url['id_parent'] = $model->id_parent;
} else {
$url['id_parent'] = 0;
}
return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => Module::t('title', 'Delete', ['dot' => false]), 'data-confirm' => Module::t('', 'Are you sure you want to delete this item?', ['dot' => false]), 'data-method' => 'post', 'data-pjax' => '0']);
}, 'view' => function ($url, $model) {
if ($model->alias) {
return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', $model->url(), ['title' => Module::t('title', 'View', ['dot' => false]), 'data-pjax' => '0', 'target' => '_blank']);
}
}, 'copy' => function ($url, $model) {
$url = ['create', 'id' => $model->id];
if ($model->id_parent) {
$url['id_parent'] = $model->id_parent;
} else {
$url['id_parent'] = 0;
}
return Html::a('<span class="fa fa-copy"></span>', $url, ['title' => Module::t('title', 'Copy', ['dot' => false]), 'data-pjax' => '0']);
}, 'subpages' => function ($url, $model) {
return Html::a('<span class="fa fa-plus-circle"></span>', ['', 'id_parent' => $model->id], ['title' => Module::t('title', 'Sub pages', ['dot' => false]), 'data-pjax' => '0']);
}, 'files' => function ($url, $model) {
if (!isset(Module::getInstance()->files[$model->type])) {
return null;
}
return Html::a('<span class="fa fa-cloud-download"></span>', ['files', 'id' => $model->id], ['title' => Module::t('title', 'Files', ['dot' => false]), 'data-pjax' => '0']);
}]]]]);