/** * @return string $template * @return mixed */ public function actions($template = '{update} {delete}') { $this->columns = array_merge($this->columns, [['class' => ActionColumn::className(), 'controller' => SELF::CONTROLLER, 'template' => $template, 'buttons' => ['update' => function ($url, $model, $key) { return Html::a('<i class="fa fa-pencil"></i>', false, ['value' => Url::to([SELF::CONTROLLER . '/update', 'id' => $model->id]), 'title' => 'Update', 'class' => 'showModalButton']); }], 'contentOptions' => ['class' => 'text-right']]]); return $this; }
/** * @param string $template * @param mixed $params * @return mixed */ public function actions($template = '{update} {delete}', $params = '') { $this->columns = array_merge($this->columns, [['class' => ActionColumn::className(), 'controller' => SELF::CONTROLLER, 'template' => $template, 'buttons' => ['update-role-to-user' => function ($url, $model, $key) use($params) { return Html::a('<i class="fa fa-check"></i>', [SELF::CONTROLLER . '/update-role', 'userId' => $model['user_id'], 'tenantId' => $params, 'role' => 'user'], ['title' => 'Update to User', 'data-toggle' => 'tooltip']); }, 'update-role-to-admin' => function ($url, $model, $key) use($params) { return Html::a('<i class="fa fa-check-circle"></i>', [SELF::CONTROLLER . '/update-role', 'userId' => $model['user_id'], 'tenantId' => $params, 'role' => 'admin'], ['title' => 'Update to Admin', 'data-toggle' => 'tooltip']); }, 'remove-tenant' => function ($url, $model, $key) { return Html::a('<i class="fa fa-times"></i>', [SELF::CONTROLLER . '/remove-tenant', 'userId' => $model['user_id']], ['title' => 'Remove', 'data-toggle' => 'tooltip']); }], 'contentOptions' => ['class' => 'text-right']]]); return $this; }
/** * List of grid actions * @return array */ public function actions() { $entity = \Yii::$app->getRequest()->getQueryParam('entity', null); $primaryKey = $this->entity->primaryKey(); return [['class' => ActionColumn::className(), 'buttons' => ['view' => function ($url, $model, $key) use($entity, $primaryKey) { return Html::a(Yii::t('admin', 'View'), ['manage/view', 'entity' => $entity, 'id' => $model->{$primaryKey}], ['class' => 'btn btn-primary']); }, 'update' => function ($url, $model, $key) use($entity, $primaryKey) { return Html::a(Yii::t('admin', 'Edit'), ['manage/update', 'entity' => $entity, 'id' => $model->{$primaryKey}], ['class' => 'btn btn-warning']); }, 'delete' => function ($url, $model, $key) use($entity, $primaryKey) { return Html::a(Yii::t('admin', 'Delete'), ['manage/delete', 'entity' => $entity, 'id' => $model->{$primaryKey}], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('admin', 'Are you sure you want to delete this item?'), 'method' => 'post']]); }]]]; }
/** * @return string $template * @return mixed */ public function actions($template = '{update} {delete}') { $this->columns = array_merge($this->columns, [['class' => ActionColumn::className(), 'controller' => $this->controller, 'template' => $template, 'buttons' => ['ajax-update' => function ($url, $model) { return Html::a(Html::tag('i', '', ['class' => 'glyphicon glyphicon-pencil']), false, ['value' => Url::to(["{$this->controller}/ajax-update", 'id' => $model->id, 'pjaxId' => 'list-pjax']), 'data-toggle' => 'tooltip', 'title' => 'Update', 'class' => 'showModalButton', 'name' => "update-{$this->controller}-button"]); }, 'ajax-delete' => function ($url, $model) { AjaxDeleteAsset::register(Yii::$app->controller->view); return Html::a('<span class="glyphicon glyphicon-trash"></span>', false, ['class' => 'ajaxDelete', 'delete-url' => Url::to(["{$this->controller}/ajax-delete", 'id' => $model->id]), 'pjax-container' => 'list-pjax', 'name' => "delete-{$this->controller}-button"]); }, 'ajax-copy' => function ($url, $model) { return Html::a(Html::tag('i', '', ['class' => 'glyphicon glyphicon-copy']), false, ['value' => Url::to(["{$this->controller}/ajax-copy", 'id' => $model->id, 'pjaxId' => 'list-pjax']), 'data-toggle' => 'tooltip', 'title' => 'Copy', 'class' => 'showModalButton', 'name' => "copy-{$this->controller}-button"]); }], 'contentOptions' => ['class' => 'text-right']]]); return $this; }
/** * @return string $template * @return mixed */ public function actions($template = '{update} {delete}') { $this->columns = array_merge($this->columns, [['class' => ActionColumn::className(), 'controller' => SELF::CONTROLLER, 'template' => $template, 'buttons' => ['update-user-role' => function ($url, $model, $key) { if ($model->getUserRole()->exists()) { return Html::a('<i class="fa fa-pencil"></i>', false, ['value' => Url::to([SELF::CONTROLLER . '/update', 'id' => $model->userRole->id]), 'title' => 'Update', 'class' => 'showModalButton']); } return Html::a('<i class="fa fa-plus"></i>', false, ['value' => Url::to([SELF::CONTROLLER . '/create', 'user_id' => $model->id]), 'title' => 'Create', 'class' => 'showModalButton']); }, 'delete-user-role' => function ($url, $model, $key) { if ($model->getUserRole()->exists()) { return Html::a('<i class="fa fa-trash"></i>', Url::to(['user-role/delete', 'id' => $model->userRole->id]), ['data-confirm' => 'Are you sure you want to delete this item?', 'data-method' => 'post', 'data-pjax' => '0']); } return ''; }], 'contentOptions' => ['class' => 'text-right']]]); return $this; }
use yii\widgets\ActiveForm; use yii\widgets\Pjax; use yii\grid\GridView; use yii\grid\ActionColumn; use kartik\file\FileInput; use app\models\search\RaptorImageSearch; /* @var $this yii\web\View */ /* @var $image app\models\File */ /* @var $form yii\widgets\ActiveForm */ $searchModel = new RaptorImageSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $model->id); ?> <?php Pjax::begin(['timeout' => Yii::$app->constants->pjaxTimeout]); echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['class' => 'table-responsive'], 'columns' => [['class' => ActionColumn::className(), 'template' => '{delete}{download}', 'buttons' => ['download' => function ($url) { return Html::a('<span style="padding-left: 10px;" class="glyphicon glyphicon-download-alt"></span>', $url, ['title' => 'Download Photo', 'data-pjax' => 0]); }], 'urlCreator' => function ($action, $model) { if ($action === 'delete') { return ['raptor-image/delete', 'id' => $model->id]; } if ($action === 'download') { return ['raptor-image/download', 'id' => $model->id]; } }, 'headerOptions' => ['style' => 'width: 100px;'], 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle;']], ['label' => 'Raptor Image', 'format' => ['image', ['height' => '100']], 'value' => function ($model) { return isset($model->file) ? '@web/images/' . $model->file->avatar : ''; }]]]); Pjax::end(); ?>
</td> </tr> </table> <?php ActiveForm::end(); ?> <?php echo DataTables::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'clientOptions' => ["bStateSave" => true, "paging" => false, "info" => false, "sDom" => '<"top"i>rt<"bottom"lp><"clear">'], 'columns' => [['class' => 'yii\\grid\\SerialColumn', 'header' => 'ID', 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle']], ['attribute' => 'name', 'label' => 'Название', 'contentOptions' => ['style' => 'vertical-align: middle']], ['attribute' => 'preview', 'label' => 'Превью', 'format' => ['raw'], 'value' => function ($data) { return Html::img(Yii::getAlias('@web') . $data->preview, ['class' => 'data-id-img', 'width' => '60', 'height' => '75']); }], ['attribute' => 'author_id', 'label' => 'Автор', 'value' => 'fullName', 'contentOptions' => ['style' => 'vertical-align: middle']], ['attribute' => 'date', 'label' => 'Дата выхода книги', 'format' => ['date', 'php:d F Y'], 'contentOptions' => ['style' => 'vertical-align: middle']], ['attribute' => 'date_crate', 'label' => 'Дата добавления', 'format' => ['date', 'php:d F Y'], 'contentOptions' => ['style' => 'vertical-align: middle']], ['class' => ActionColumn::className(), 'header' => 'Кнопки действия', 'template' => '{update} {view} {delete}', 'contentOptions' => ['style' => 'vertical-align: middle'], 'buttons' => ['update' => function ($url, $model, $key) { return Html::a('<span> [ред] </span>', $url, ['title' => 'Редактировать', 'data-method' => 'post', 'data-pjax' => '0', 'target' => '_blank']); }, 'delete' => function ($url, $model, $key) { return Html::a('<span >[удл]</span>', $url, ['title' => Yii::t('yii', 'Удалить'), 'data-confirm' => 'Вы уверены, что хотите удалить?', 'data-method' => 'post', 'data-pjax' => 'o']); }, 'view' => function ($url, $model, $key) { return Html::a('<span>[просм]</span>', Yii::getAlias('@web') . $url, ['title' => Yii::t('yii', 'Просмотреть'), 'data-toggle' => 'modal', 'data-target' => '#activity-modal', 'data-pjax' => '0', 'value' => Yii::getAlias('@web') . $url, 'target' => 'modal', 'class' => 'my-modal-link']); }]]]]); ?> <?php Modal::begin(['id' => 'activity-modal', 'header' => '<h4 class="modal-title">Просмотр</h4>', 'footer' => '<a href="#" class="btn btn-primary" data-dismiss="modal">Закрыть</a>']); ?> <div id="modal-content">
echo $filesSize; ?> </span> <span>/</span> <span class="limit"> <?php echo Yii::$app->params['userWorkSpace']; ?> </span> <div class="panel-footer">Mbytes used</div> </div> <?php ActiveForm::end(); ?> </div> </div> <!-- Upload form end --> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'path:ntext', 'size:ntext', ['class' => ActionColumn::className(), 'buttons' => ['share' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['files/share', 'id' => $model['id']]); return Html::a('<span class="glyphicon glyphicon-share"></span>', $customurl, ['title' => Yii::t('yii', 'Share')]); }, 'download' => function ($url, $model) { $customurl = Yii::$app->getUrlManager()->createUrl(['files/download_his_file', 'id_file' => $model['id']]); return Html::a('<span class="glyphicon glyphicon-download"></span>', $customurl, ['title' => Yii::t('yii', 'Download')]); }], 'template' => '{share} {download} {delete}']]]); ?> </div>
$boxButtons = $actions = []; $showActions = false; if (Yii::$app->user->can('BCreateRoles')) { $boxButtons[] = '{create}'; } if (Yii::$app->user->can('BUpdateRoles')) { $actions[] = '{update}'; $showActions = $showActions || true; } if (Yii::$app->user->can('BDeleteRoles')) { $boxButtons[] = '{batch-delete}'; $actions[] = '{delete}'; $showActions = $showActions || true; } if ($showActions === true) { $gridConfig['columns'][] = ['class' => ActionColumn::className(), 'template' => implode(' ', $actions)]; } $boxButtons = !empty($boxButtons) ? implode(' ', $boxButtons) : null; ?> <div class="row"> <div class="col-xs-12"> <?php Box::begin(['title' => $this->params['subtitle'], 'bodyOptions' => ['class' => 'table-responsive'], 'batchParam' => 'names', 'buttonsTemplate' => $boxButtons, 'grid' => $gridId]); ?> <?php echo GridView::widget($gridConfig); ?> <?php Box::end(); ?>
/* @var $this yii\web\View */ /* @var $searchModel app\models\search\RaptorSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = 'Raptors'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="raptor-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a('Create Raptor', ['create'], ['class' => 'btn btn-success']); ?> </p> <?php Pjax::begin(['timeout' => Yii::$app->constants->pjaxTimeout]); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'options' => ['class' => 'table-responsive'], 'columns' => [['class' => ActionColumn::className(), 'template' => '{update}{view}', 'headerOptions' => ['style' => 'width: 100px;'], 'buttonOptions' => ['style' => 'padding: 5px;'], 'contentOptions' => ['style' => 'text-align: center;']], 'species_short', 'species_long']]); ?> <?php Pjax::end(); ?> </div>
<?php echo $form->field($model, '[' . $k . ']metaKeywords')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, '[' . $k . ']metaDescription')->textarea(['rows' => 5]); ?> <?php echo $form->field($model, '[' . $k . ']content')->widget(\app\modules\core\components\Redactor::className()); ?> <?php echo $form->field($model, '[' . $k . ']fullContent')->widget(\app\modules\core\components\Redactor::className()); ?> <?php if (!$model->isNewRecord) { ?> <h2>Детали</h2> <?php echo \yii\grid\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getDetails()->position(), 'pagination' => false]), 'columns' => ['title', 'content', ['class' => \yii\grid\ActionColumn::className(), 'controller' => 'details', 'header' => \yii\helpers\Html::a('<i class="glyphicon glyphicon-plus"></i> Добавить', ['details/create', 'productId' => $model->id, 'lang' => $model->lang]), 'template' => '{update}{delete}']]]); ?> <?php } ?> </div> </div>
<?php /** * @var yii\web\View $this * @var \yii\data\ActiveDataProvider $dataProvider * @var \ws\rbac\Module $module */ use yii\grid\ActionColumn; use yii\grid\GridView; use yii\helpers\Html; use yii\widgets\Pjax; $this->title = Yii::$app->request->isPjax ? null : Yii::t('app', 'Assign'); $this->params['breadcrumbs'][] = $this->title; $module = Yii::$app->controller->module; ?> <div class="user-index"> <?php Pjax::begin(['options' => ['id' => 'pjax']]); ?> <?php echo GridView::widget(['layout' => "{items}\n{summary}\n{pager}", 'dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', $module->usernameField, ['class' => ActionColumn::className(), 'template' => '{assign}', 'buttons' => ['assign' => function ($url, $model, $key) { $options = ['title' => Yii::t('yii', 'Assign'), 'aria-label' => Yii::t('yii', 'Assign'), 'data-pjax' => '0']; return Html::a('<span class="glyphicon glyphicon-user"></span>', ['assign', 'uid' => $model->id], $options); }]]]]); ?> <?php Pjax::end(); ?> </div>
$this->title = Yii::t('storecube', 'PAGE_PRODUCTS'); $this->params['breadcrumbs'][] = $this->title; ?> <?php $gridId = 'products-grid'; $panelButtons = $actions = []; if (Yii::$app->user->can('ACPProductsCreate')) { $panelButtons[] = '{create}'; } if (Yii::$app->user->can('ACPProductsUpdate')) { $actions[] = '{update}'; } if (Yii::$app->user->can('ACPProductsDelete')) { $panelButtons[] = '{mass-delete}'; $actions[] = '{delete}'; } if (Yii::$app->user->can('ACPProductsView')) { $actions[] = '{view}'; } $gridActionsColumn = ['class' => ActionColumn::className(), 'template' => implode(' ', $actions)]; $panelButtons = !empty($panelButtons) ? implode(' ', $panelButtons) : null; ?> <?php Panel::begin(['title' => $this->title, 'buttonsTemplate' => $panelButtons, 'grid' => $gridId]); ?> <?php echo GridView::widget(['id' => $gridId, 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => CheckboxColumn::classname()], 'article', 'name', 'short_desc:ntext', $gridActionsColumn], 'pager' => ['firstPageLabel' => 'First', 'lastPageLabel' => 'Last']]); Panel::end();
</ul> <br> <?php Pjax::begin(); echo PageSizer::widget(); echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => 'select#per-page', 'tableOptions' => ['class' => 'table table-striped table-hover'], 'columns' => [['attribute' => 'username', 'label' => Yii::t('podium/view', 'Username') . Helper::sortOrder('username'), 'encodeLabel' => false, 'format' => 'raw', 'value' => function ($model) { return Html::a($model->podiumName, ['members/view', 'id' => $model->id, 'slug' => $model->podiumSlug], ['data-pjax' => '0']); }], ['attribute' => 'role', 'label' => Yii::t('podium/view', 'Role') . Helper::sortOrder('role'), 'encodeLabel' => false, 'format' => 'raw', 'filter' => User::getRoles(), 'value' => function ($model) { return Helper::roleLabel($model->role); }], ['attribute' => 'created_at', 'label' => Yii::t('podium/view', 'Joined') . Helper::sortOrder('created_at'), 'encodeLabel' => false, 'value' => function ($model) { return Yii::$app->formatter->asDatetime($model->created_at); }], ['attribute' => 'threads_count', 'label' => Yii::t('podium/view', 'Threads'), 'encodeLabel' => false, 'value' => function ($model) { return $model->threadsCount; }], ['attribute' => 'posts_count', 'label' => Yii::t('podium/view', 'Posts'), 'encodeLabel' => false, 'value' => function ($model) { return $model->postsCount; }], ['class' => ActionColumn::className(), 'header' => Yii::t('podium/view', 'Actions'), 'contentOptions' => ['class' => 'text-right'], 'headerOptions' => ['class' => 'text-right'], 'template' => '{view}' . (!Yii::$app->user->isGuest ? ' {pm}' : ''), 'buttons' => ['view' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-eye-open"></span>', ['members/view', 'id' => $model->id, 'slug' => $model->podiumSlug], ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'View Member')]); }, 'pm' => function ($url, $model) { if ($model->id !== User::loggedId()) { return Html::a('<span class="glyphicon glyphicon-envelope"></span>', ['messages/new', 'user' => $model->id], ['class' => 'btn btn-default btn-xs', 'data-pjax' => '0', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Send Message')]); } else { return Html::a('<span class="glyphicon glyphicon-envelope"></span>', '#', ['class' => 'btn btn-xs disabled text-muted']); } }]]]]); Pjax::end(); ?> <div class="panel panel-default"> <div class="panel-body small"> <ul class="list-inline pull-right"> <li><a href="<?php echo Url::to(['default/index']);
?> <div class="row"> <div class="col-md-8"> <?php echo $form->field($model, 'searchKey')->textInput(['placeholder' => 'Введите текст заявки'])->label(false); ?> </div> <div class="col-md-4" style="vertical-align: bottom"> <?php echo Html::submitButton('<span class="glyphicon glyphicon-search"></span> Найти', ['class' => 'btn btn-primary']); ?> </div> </div> <?php ActiveForm::end(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table'], 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'topic', 'content' => function ($model) { return Html::a($model->topic, ['vks-request/view', 'id' => (string) $model->primaryKey]); }, 'contentOptions' => ['style' => 'width: 62%']], ['attribute' => 'status', 'value' => function ($model) { return Request::statusName($model->status); }, 'contentOptions' => ['style' => 'width: 13%']], ['attribute' => 'date', 'content' => function ($model) { return Yii::$app->formatter->asDate($model->date->sec) . " c {$model->beginTimeString} по {$model->endTimeString}"; }, 'contentOptions' => ['style' => 'width: 20%']], ['class' => \yii\grid\ActionColumn::className(), 'controller' => 'vks-request', 'template' => '{delete}', 'visible' => Yii::$app->user->can(SystemPermission::DELETE_REQUEST)]]]); ?> </div>
<?php use yii\grid\GridView; use yii\grid\ActionColumn; use yii\widgets\Pjax; use yii\helpers\Html; echo $this->render('_nav', ['cur' => 'users']); Pjax::begin(['timeout' => 5000]); echo GridView::widget(['dataProvider' => $userProvider, 'filterModel' => $userSearch, 'columns' => ['id', ['attribute' => 'name', 'value' => function ($model, $key, $index, $column) { return mb_strimwidth($model->name, 0, 20, '...', 'UTF-8'); }], ['attribute' => 'email', 'value' => function ($model, $key, $index, $column) { return mb_strimwidth($model->email, 0, 20, '...', 'UTF-8'); }], 'role.item_name', ['attribute' => 'created_at', 'format' => ['date', 'php:d-m-Y']], ['class' => ActionColumn::className(), 'template' => '{update} {delete}', 'buttons' => ['update' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-pencil"></span>', ['user/update', 'id' => $model->id]); }, 'delete' => function ($url, $model, $key) { return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['user/delete', 'id' => $model->id], ['data-method' => 'post']); }]]]]); Pjax::end();
/** * @return array */ public function getActionColumn() { $template = ''; if (!in_array('update', $this->disabledActions)) { $template .= '{update}'; } if (!in_array('delete', $this->disabledActions)) { $template .= '{delete}'; } return ['class' => ActionColumn::className(), 'template' => $template, 'contentOptions' => ['class' => 'action-column']]; }
<?php echo Html::beginForm(); ?> <?php Pjax::begin(); ?> <?php echo PageSizer::widget(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'filterSelector' => 'select#per-page', 'tableOptions' => ['class' => 'table table-striped table-hover'], 'columns' => [['class' => CheckboxColumn::className(), 'headerOptions' => ['class' => 'col-sm-1 text-center'], 'contentOptions' => ['class' => 'col-sm-1 text-center'], 'checkboxOptions' => function ($model) use($mod) { return ['value' => $model->id, 'checked' => $model->isMod($mod->id)]; }], ['attribute' => 'id', 'label' => Yii::t('podium/view', 'ID') . Helper::sortOrder('id'), 'encodeLabel' => false, 'contentOptions' => ['class' => 'col-sm-1 text-center'], 'headerOptions' => ['class' => 'col-sm-1 text-center']], ['attribute' => 'name', 'label' => Yii::t('podium/view', 'Name') . Helper::sortOrder('name'), 'encodeLabel' => false, 'format' => 'raw', 'value' => function ($model) use($mod) { return Html::encode($model->name) . ($model->isMod($mod->id) ? Html::hiddenInput('pre[]', $model->id) : ''); }], ['class' => ActionColumn::className(), 'header' => Yii::t('podium/view', 'Actions'), 'contentOptions' => ['class' => 'text-right'], 'headerOptions' => ['class' => 'text-right'], 'template' => '{mod}', 'urlCreator' => function ($action, $model) use($mod) { return Url::toRoute([$action, 'fid' => $model->id, 'uid' => $mod->id]); }, 'buttons' => ['mod' => function ($url, $model) use($mod) { if ($model->isMod($mod->id)) { return Html::a('<span class="glyphicon glyphicon-remove"></span> ' . Yii::t('podium/view', 'Remove'), $url, ['class' => 'btn btn-danger btn-xs', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Remove from moderation list')]); } else { return Html::a('<span class="glyphicon glyphicon-plus"></span> ' . Yii::t('podium/view', 'Add'), $url, ['class' => 'btn btn-success btn-xs', 'data-toggle' => 'tooltip', 'data-placement' => 'top', 'title' => Yii::t('podium/view', 'Add to moderation list')]); } }]]]]); ?> <?php Pjax::end(); ?> <?php echo Html::hiddenInput('mod_id', $mod->id);
public function run() { $elementType = !empty($_GET['cet']) ? $_GET['cet'] : 'page'; $modelProvider = new CrelishJsonDataProvider($elementType, [], null); $filterModel = new CrelishDynamicJsonModel(['ctype' => $elementType]); $label = $this->field->label; $out = <<<EOT <div class="form-group field-crelishdynamicmodel-body required"> <label class="control-label" for="crelishdynamicmodel-body">{$label}</label> <div class=""> <matrix></matrix> <div class="help-block help-block-error "></div> </div> </div> <div class="modal fade matrix-modal-{$this->formKey}" tabindex="-1" role="dialog" aria-labelledby="matrix-modal-{$this->formKey}" id="matrix-modal-{$this->formKey}"> <div class="modal-dialog modal-lg"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button> <h4 class="modal-title" id="myModalLabel">Content selection</h4> </div> <div class="modal-body"> EOT; $out .= $this->render('matrix.twig', ['dataProvider' => $modelProvider->raw(), 'filterModel ' => $filterModel, 'columns' => ['systitle', ['class' => ActionColumn::className(), 'template' => '{update}', 'buttons' => ['update' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-plus"></span>', $url, ['title' => \Yii::t('app', 'Add'), 'data-pjax' => '0', 'data-content' => Json::encode(['uuid' => $model['uuid'], 'ctype' => $model['ctype']])]); }]]], 'ctype' => $elementType, 'formKey' => $this->formKey]); $out .= <<<EOT </div> </div> </div> </div> <script type="riot/tag"> <matrix> <div class="o-grid"> <div class="o-grid__cell" each={ item, i in data }> <span class="c-badge">{ item }</span> <div id="sortable"> <div class="c-card" each={ i }> <div class="c-card__item c-card__item--divider"> <span class="glyphicon glyphicon-move" aria-hidden="true"></span> { ctype } <span class="c-input-group pull-right"> <button class="c-button gc-bc--palette-wetasphalt u-xsmall"><i class="glyphicon glyphicon-pencil"></i></button> <button class="c-button gc-bc--palette-pomgranate u-xsmall"><i class="glyphicon glyphicon-trash"></i></button> </span> </div> <div class="c-card__content"> <dl> <span each={ info }> <dt>{ label }</dt> <dd>{ value }</dd> </span> </dl> </div> </div> </div> <button type="button" class="c-button c-button--ghost-primary c-button--block gc-mt--1" data-target=".matrix-modal-{$this->formKey}" onclick="openMatrixModal('{ item }')">Add content</button> </div> </div> <input type="hidden" name="CrelishDynamicJsonModel[{$this->formKey}]" id="CrelishDynamicJsonModel_{$this->formKey}" value="{ JSON.stringify(data) }" /> // Logic goes here. var app = this this.data = opts.data edit(e) { this.text = e.target.value } add(e) { if (this.text) { this.items.push({ title: this.text }) this.text = this.input.value = '' } } removeAllDone(e) { this.items = this.items.filter(function(item) { return !item.done }) } // an two example how to filter items on the list whatShow(item) { return !item.hidden } onlyDone(item) { return item.done } toggle(e) { var item = e.item item.done = !item.done return true } this.on("mount", function() { var that = this; var matrixData = this.data; var el = document.getElementById('sortable'); if(el) { var sortable = Sortable.create(el, { handle: '.glyphicon-move', animation: 150, onSort: function (evt) { // same properties as onUpdate matrixData.main.move(evt.oldIndex, evt.newIndex) app.data = matrixData; app.update(); } }); } }); </matrix> </script> <script> var targetArea = 'main'; var openMatrixModal = function( area ) { targetArea = area; \$('.matrix-modal-{$this->formKey}').modal('show'); }; var activateContentMatrix = function() { \$("#matrix-modal-{$this->formKey} a").each(function() { \$(this).on('click', function(e) { e.preventDefault(); var content = \$(this).data("content"); var origData = JSON.parse(\$("#CrelishDynamicJsonModel_{$this->formKey}").val()); console.log(\$("#CrelishDynamicJsonModel_{$this->formKey}").val(), origData, targetArea); origData[targetArea].push( content ); \$("#CrelishDynamicJsonModel_{$this->formKey}").val(JSON.stringify(origData)); \$("#content-form").submit(); }); }); }; Array.prototype.move = function (old_index, new_index) { if (new_index >= this.length) { var k = new_index - this.length; while ((k--) + 1) { this.push(undefined); } } this.splice(new_index, 0, this.splice(old_index, 1)[0]); return this; // for testing purposes }; \$("#matrix-modal-{$this->formKey}").on("pjax:end", function() { activateContentMatrix(); }); \$('#asset-modal').on('shown.bs.modal', function (e) { activateContentMatrix(); }); var tags = riot.mount('*', { data: {$this->data} }); </script> EOT; return $out; }
<div class="help-block"></div> </div> <?php $form->end(); ?> </div> <?php echo \yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'options' => ['class' => 'p20'], 'columns' => [['class' => 'yii\\grid\\Serialcolumn'], ['class' => 'yii\\grid\\DataColumn', 'value' => function ($data) { return $data->name; }, 'attribute' => 'name'], ['class' => \yii\grid\DataColumn::className(), 'attribute' => 'description'], ['class' => \yii\grid\ActionColumn::className(), 'buttons' => ['view' => function () { return ''; }, 'update' => function ($url, $model, $key) { $name = $model->name; $url = Url::to(['rbac/permission_update', 'name' => $name]); return Html::a(' ', $url, ['class' => 'glyphicon glyphicon-pencil']); }, 'delete' => function ($url, $model, $key) { $name = $model->name; $url = Url::to(['rbac/permission_delete', 'name' => $name]); return Html::a(' ', $url, ['class' => 'glyphicon glyphicon-trash event-delete-confirm']); }]]]]); ?> <?php \Yii::$app->getView()->on(\yii\web\View::EVENT_END_PAGE, function () {
echo \yii\bootstrap\Html::a('View ' . $actother . ' <i class="fa fa-forward"></i>', ['/booking/' . $actother, 'id' => $model->airport_id]); ?> </div> <div class='row'> <?php echo \yii\grid\GridView::widget(['dataProvider' => $dataProvider, 'tableOptions' => ['class' => 'table table-condensed'], 'layout' => '{items}', 'columns' => [['attribute' => 'airline', 'format' => 'html', 'header' => false, 'value' => function ($data) { return \yii\bootstrap\Html::img('https://ivaoru.org/images/airlines/' . $data->airline . '.gif'); }], ['attribute' => 'flightnumber', 'format' => 'raw', 'value' => function ($data) { $lnk = $data->turnaround_id ? "<i onclick='showturnaround({$data->id})' style='cursor: pointer;' class='fa fa-spin fa-refresh' title='This flight have turnaround'></i>" : ""; return $lnk . " " . $data->airline . $data->flightnumber; }], 'gate', 'aircraft', 'icaofrom', 'icaoto', 'timefrom', 'timeto', ['header' => 'info', 'format' => 'html', 'value' => function ($data) { if (!$data->vid) { return \yii\helpers\Html::a('Book', \yii\helpers\Url::to(['/booking/book', 'id' => $data->id]), ['class' => 'btn btn-xs btn-success']); } return \yii\helpers\Html::a('Booked: ' . $data->vid, \yii\helpers\Url::to(['/booking/show', 'id' => $data->id]), ['class' => 'btn btn-xs btn-warning']); }], ['visible' => !Yii::$app->user->isGuest && Yii::$app->user->identity->isadmin, 'class' => \yii\grid\ActionColumn::className(), 'header' => 'Admin', 'template' => '{turnaround} {delete}', 'buttons' => ['turnaround' => function ($url, $model, $key) { if (!$model->turnaround_id) { return "<i style='cursor: pointer' onclick='linkturnaround({$model->id})' title='link turnaround flights' class='fa fa-refresh'></i>"; } else { return "<i style='cursor: pointer' onclick='unlinkturnaround({$model->id})' title='unlink turnaround flights' class='fa fa-unlink'></i>"; } }]]]]); ?> </div> <?php if (!Yii::$app->user->isGuest && Yii::$app->user->identity->isadmin) { ?> <div class="row"> <?php $form = \kartik\form\ActiveForm::begin(['type' => 'inline']); echo $form->field($model, 'airline')->textInput(['style' => 'width: 100px;']);
<?php /** * @author Ivo Kund <*****@*****.**> * @date 24.01.14 * @var \yii\web\View $this * @var \yii\data\ActiveDataProvider $dataProvider */ ?> <h1>Payment log</h1> <?php echo \opus\ecom\widgets\GridView::widget(['dataProvider' => $dataProvider, 'columns' => ['id:text:#', 'user_id:text:User', 'bank_code', 'status', 'amount:price', 'created:datetime', ['class' => \yii\grid\ActionColumn::className(), 'template' => '{view}', 'buttons' => ['view' => function ($url, $model) { return \yii\helpers\Html::a('Details', ['payment/view', 'paymentId' => $model->id]); }]]]]);
/* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ /** * @var $dataProvider array * @var $filterModel dektrium\rbac\models\Search * @var $this yii\web\View */ use yii\grid\ActionColumn; use kartik\grid\GridView; use yii\helpers\Url; $this->title = Yii::t('rbac', 'Roles'); $this->params['breadcrumbs'][] = $this->title; $this->params['title'] = $this->title; $this->params['menu']['auth'] = true; $this->params['sub-menu']['list-role'] = true; ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $filterModel, 'layout' => "{items}\n{pager}", 'columns' => [['attribute' => 'name', 'header' => Yii::t('rbac', 'Name'), 'options' => ['style' => 'width: 20%']], ['attribute' => 'description', 'header' => Yii::t('rbac', 'Description'), 'options' => ['style' => 'width: 55%']], ['attribute' => 'rule_name', 'header' => Yii::t('rbac', 'Rule name'), 'options' => ['style' => 'width: 20%']], ['class' => ActionColumn::className(), 'template' => '{update} {delete}', 'urlCreator' => function ($action, $model) { return Url::to(['/auth/auth/' . $action, 'name' => $model['name']]); }, 'options' => ['style' => 'width: 5%']]], 'export' => false, 'responsive' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-globe"></i> ' . Yii::t('rbac', 'Roles') . '</h3>', 'type' => 'success', 'before' => false, 'footer' => false, 'after' => false]]); ?>
]); ?> <?= $form->field($searchModel, 'email') ?> <?= $form->field($searchModel, 'name') ?> <?= $form->field($searchModel, 'role')->dropDownList(['' => ''] + UserRole::getLabels()) ?> <div class="form-group"> <div class="col-lg-offset-3 col-lg-9"> <?= Html::submitButton('Найти', ['class' => 'btn btn-primary']) ?> <?= Html::resetButton('Сбросить', ['class' => 'btn btn-default']) ?> </div> </div> <?php AppActiveForm::end();*/ ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'name', 'email', ['class' => ActionColumn::className(), 'template' => '{view} {update}', 'urlCreator' => function ($action, $model, $key, $index) { /** @type User $model */ switch ($action) { case 'view': return ['/profile/profile/view', 'userUid' => $model->uid]; case 'update': return ['/profile/profile-edit/index', 'userUid' => $model->uid]; } return '#'; }]]]); ?> <?php
<?php use yii\helpers\Html; use yii\grid\GridView; use yii\grid\ActionColumn; use dmstr\widgets\Alert; $this->title = Yii::t('app', 'Blog Categories'); $this->params['breadcrumbs'][] = $this->title; ?> <?php echo $this->render('_content-header'); ?> <?php echo Alert::widget(); ?> <p class="pull-left"> <?php echo Html::a('<i class="glyphicon glyphicon-plus"></i> ' . Yii::t('app', 'Add New Blog Category'), 'create', ['class' => 'btn btn-primary']); ?> </p> <div class="clearfix"></div> <?php echo GridView::widget(['dataProvider' => $blogCategoryProvider, 'filterModel' => $blogCategorySearch, 'id' => 'content-grid', 'tableOptions' => ['class' => 'table table-striped table-bordered box box-primary'], 'columns' => [['attribute' => 'name', 'format' => 'raw', 'value' => function ($blogCategory) { return Html::a($blogCategory->name, ['update', 'id' => $blogCategory->id]); }], 'created_at:datetime', 'updated_at:datetime', ['class' => ActionColumn::className(), 'template' => '{update}']]]);
<div class="col-sm-9"> <h4><?php echo Yii::t('podium/view', 'Subscriptions'); ?> </h4> <?php echo Html::beginForm(); Pjax::begin(); echo PageSizer::widget(); echo GridView::widget(['dataProvider' => $dataProvider, 'filterSelector' => 'select#per-page', 'tableOptions' => ['class' => 'table table-striped table-hover'], 'columns' => [['class' => CheckboxColumn::className(), 'headerOptions' => ['class' => 'col-sm-1 text-center'], 'contentOptions' => ['class' => 'col-sm-1 text-center'], 'checkboxOptions' => function ($model) { return ['value' => $model->id]; }], ['attribute' => 'thread.name', 'label' => Yii::t('podium/view', "Thread's Name"), 'format' => 'raw', 'value' => function ($model) { return Html::a($model->thread->name, ['default/show', 'id' => $model->thread->latest->id], ['class' => 'center-block']); }], ['attribute' => 'post_seen', 'headerOptions' => ['class' => 'text-center'], 'contentOptions' => ['class' => 'text-center'], 'label' => Yii::t('podium/view', 'New Posts'), 'format' => 'raw', 'value' => function ($model) { return $model->post_seen ? '' : '<span class="glyphicon glyphicon-ok-sign"></span>'; }], ['class' => ActionColumn::className(), 'header' => Yii::t('podium/view', 'Actions'), 'contentOptions' => ['class' => 'text-right'], 'headerOptions' => ['class' => 'text-right'], 'template' => '{mark} {delete}', 'buttons' => ['mark' => function ($url, $model) { if ($model->post_seen) { return Html::a('<span class="glyphicon glyphicon-eye-close"></span> ' . Yii::t('podium/view', 'Mark unseen'), $url, ['class' => 'btn btn-warning btn-xs']); } else { return Html::a('<span class="glyphicon glyphicon-eye-open"></span> ' . Yii::t('podium/view', 'Mark seen'), $url, ['class' => 'btn btn-success btn-xs']); } }, 'delete' => function ($url, $model) { return Html::a('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('podium/view', 'Unsubscribe'), $url, ['class' => 'btn btn-danger btn-xs']); }]]]]); Pjax::end(); ?> <div class="row"> <div class="col-sm-12"> <?php echo Html::submitButton('<span class="glyphicon glyphicon-trash"></span> ' . Yii::t('podium/view', 'Unsubscribe Selected Threads'), ['class' => 'btn btn-danger btn-sm', 'name' => 'delete-button']); ?>
echo Alert::widget(); ?> <div class="accounts-index"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a('Новый счет', ['new'], ['class' => 'btn btn-success']); ?> <?php echo Html::a('Новый перевод', Yii::$app->urlManager->createUrl(['transaction/transfer']), ['class' => 'btn btn-info']); ?> </p> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'showOnEmpty' => false, 'layout' => "{items}\n{pager}", 'filterModel' => $searchModel, 'columns' => ['name', 'amount', ['attribute' => 'currencyId', 'headerOptions' => ['width' => '100'], 'filter' => false, 'content' => function ($data) { /** @var $data \frontend\models\Accounts */ if ($data->currency) { return $data->currency->title; } return false; }], ['class' => ActionColumn::className(), 'template' => '{update}']]]); ?> </div>
} ?> <?php echo $form->field($model, '[' . $k . ']position')->textInput(); ?> <?php echo \yii\bootstrap\Collapse::widget(['items' => [['label' => $model->getAttributeLabel('task'), 'content' => $form->field($model, '[' . $k . ']task')->textarea(['rows' => 3])], ['label' => $model->getAttributeLabel('idea'), 'content' => $form->field($model, '[' . $k . ']idea')->textarea(['rows' => 3])], ['label' => $model->getAttributeLabel('results'), 'content' => $form->field($model, '[' . $k . ']results')->textarea(['rows' => 3])], ['label' => $model->getAttributeLabel('vimeo'), 'content' => $form->field($model, '[' . $k . ']vimeo')->textarea(['rows' => 3])]]]); ?> </div> </div> <?php if (!$model->isNewRecord) { ?> <h2>Исполнители</h2> <?php echo \yii\grid\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getPerformers(), 'pagination' => false]), 'columns' => ['fullName', 'role', ['class' => \yii\grid\ActionColumn::className(), 'controller' => 'performers', 'header' => Html::a('<i class="glyphicon glyphicon-plus"></i> Добавить', ['performers/create', 'portfolioId' => $model->id, 'lang' => $model->lang]), 'template' => '{update}{delete}']]]); ?> <h2>Инфографика</h2> <?php echo \yii\grid\GridView::widget(['dataProvider' => new \yii\data\ActiveDataProvider(['query' => $model->getInfographics(), 'pagination' => false]), 'columns' => ['title', 'value', ['class' => \yii\grid\ActionColumn::className(), 'controller' => 'infographics', 'header' => Html::a('<i class="glyphicon glyphicon-plus"></i> Добавить', ['infographics/create', 'portfolioId' => $model->id, 'lang' => $model->lang]), 'template' => '{update}{delete}']]]); ?> <?php } ?> </div> </div>
<!-- Table row --> <div class="row"> <div class="col-xs-12 table-responsive"> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'columns' => [['attribute' => 'no', 'label' => '#', 'value' => function ($model) { static $no; return ++$no; }, 'headerOptions' => ['width' => '4%', 'style' => 'text-align: center'], 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle;']], ['attribute' => 'name', 'format' => 'raw', 'label' => ' ' . Yii::t('cart', 'Description'), 'contentOptions' => ['style' => 'vertical-align: middle'], 'value' => function ($model) { return $model->icon . ' ' . $model->name . ' ' . Html::tag('span', $model->description, ['class' => 'text-muted']); }], ['attribute' => 'quantity', 'value' => function ($model, $key, $index, $column) { return QuantityCell::widget(['model' => $model]); //, 'type' => 'number' }, 'format' => 'raw'], ['attribute' => 'price', 'contentOptions' => ['style' => 'vertical-align: middle;white-space: nowrap;'], 'value' => function ($model) use($cart) { return $cart->formatCurrency($model->cost); }], 'actions' => ['class' => ActionColumn::className(), 'template' => '{remove}', 'headerOptions' => ['width' => '4%'], 'contentOptions' => ['style' => 'text-align: center; vertical-align: middle;'], 'buttons' => ['remove' => function ($url, $model, $key) { return Html::a('<i class="fa fa-times text-danger"></i>', ['remove', 'id' => $model->id]); }]]]]); ?> </div> <!-- /.col --> </div> <!-- /.row --> <div class="row"> <!-- accepted payments column --> <div class="col-xs-6"> <p class="lead">Payment Methods:</p> <img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/visa.png" alt="Visa"> <img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/mastercard.png" alt="Mastercard"> <img src="https://almsaeedstudio.com/themes/AdminLTE/dist/img/credit/american-express.png"
<?php /* * This file is part of the Dektrium project. * * (c) Dektrium project <http://github.com/dektrium> * * For the full copyright and license information, please view the LICENSE.md * file that was distributed with this source code. */ /** * @var $dataProvider array * @var $this yii\web\View * @var $filterModel jarrus90\User\models\Search */ use yii\helpers\Html; use yii\grid\ActionColumn; use kartik\grid\GridView; use yii\helpers\Url; $this->title = Yii::t('rbac', 'Permissions'); $this->params['breadcrumbs'][] = $this->title; echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $filterModel, 'pjax' => true, 'hover' => true, 'export' => false, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-plus"></i>', Url::toRoute(['create']), ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => \Yii::t('content', 'New block')]) . ' ' . Html::a('<i class="glyphicon glyphicon-repeat"></i>', Url::toRoute(['index']), ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => Yii::t('content', 'Reset filter')])]], 'panel' => ['type' => \kartik\grid\GridView::TYPE_DEFAULT], 'layout' => "{toolbar}{items}{pager}", 'columns' => [['attribute' => 'name', 'header' => Yii::t('rbac', 'Name'), 'options' => ['style' => 'width: 20%']], ['attribute' => 'description', 'header' => Yii::t('rbac', 'Description'), 'options' => ['style' => 'width: 55%']], ['attribute' => 'rule_name', 'header' => Yii::t('rbac', 'Rule name'), 'options' => ['style' => 'width: 20%']], ['class' => ActionColumn::className(), 'template' => '{update} {delete}', 'urlCreator' => function ($action, $model) { return Url::to(['/user/permission/' . $action, 'name' => $model['name']]); }, 'options' => ['style' => 'width: 5%']]]]);