return $model->getImageUrl() ? $model->getImageUrl() : ''; }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true]; break; case Content::ATTR_TYPE_DATE: $columns[] = ['attribute' => $attr, 'format' => ['raw', ['width' => '100']], 'value' => function ($data) use($attr) { return Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->dateFormat) . ' <small style="color:gray;">' . Yii::$app->formatter->asDateTime($data->{$attr}, Yii::$app->formatter->timeFormat) . '</small>'; }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true]; break; case Content::ATTR_TYPE_BOOLEAN: $columns[] = ['attribute' => $attr, 'format' => 'raw', 'value' => function ($data) use($attr) { return Html::checkbox($attr, $data->{$attr}); }, 'filter' => false, 'visible' => isset($value['visible']) ? $value['visible'] : true]; break; case Content::ATTR_TYPE_DROPDOWN: $columns[] = ['attribute' => $attr, 'value' => function ($data) use($attr, $value) { return isset($value['items'][$data->{$attr}]) ? $value['items'][$data->{$attr}] : ''; }, 'filterType' => GridView::FILTER_SELECT2, 'filter' => $value['items'], 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => '---'], 'visible' => isset($value['visible']) ? $value['visible'] : true]; break; default: $columns[] = ['attribute' => $attr, 'visible' => isset($value['visible']) ? $value['visible'] : true]; break; } } } if (class_exists('\\stepancher\\adminlteTheme\\config\\AnminLteThemeConfig')) { DynaGrid::begin(\yii\helpers\ArrayHelper::merge(\stepancher\adminlteTheme\config\AnminLteThemeConfig::getDefaultConfigDynagrid(), ['columns' => $columns, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'panel' => ['after' => Html::a('<i class="icon glyphicon fa fa-reply"></i>   Восстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i>   Удалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]])); } else { DynaGrid::begin(['columns' => $columns, 'toggleButtonGrid' => ['label' => '<i class="glyphicon glyphicon-wrench"></i>   Настройки'], 'toggleButtonFilter' => ['label' => '<i class="glyphicon glyphicon-filter"></i>    Фильтры'], 'toggleButtonSort' => ['label' => '<i class="glyphicon glyphicon-sort"></i>    Сортировка'], 'storage' => DynaGrid::TYPE_DB, 'gridOptions' => ['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'toolbar' => [['content' => Html::a('<i class="glyphicon glyphicon-repeat"></i> Сбросить', [''], ['data-pjax' => 0, 'class' => 'btn btn-default', 'title' => 'Обновить'])], ['content' => '{dynagridFilter}{dynagridSort}{dynagrid}{toggleData}'], '{export}'], 'export' => ['label' => 'Экспорт'], 'panel' => ['footer' => false, 'after' => Html::a('<i class="icon glyphicon fa fa-reply"></i>   Восстановить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_UNARCHIVE, 'class' => 'btn btn-primary btn-multiple', 'title' => 'Восстановить выбранные записи']) . Html::a('<i class="icon glyphicon fa fa-trash"></i>   Удалить', '#', ['data-classname' => $module::className(), 'data-action' => \stepancher\content\controllers\AdminController::ACTION_DELETE, 'class' => 'btn btn-danger btn-multiple', 'title' => 'Удалить выбранные записи']) . '<div class="pull-right">{pager}</div>'], 'options' => ['id' => 'grid', 'data-url' => '/admin/' . $this->context->module->id . '/group-action']], 'options' => ['id' => 'dynagrid-archive-' . $this->context->module->id]]); } DynaGrid::end();