public function init() { parent::init(); $session = \Yii::$app->getSession(); $flashes = $session->getAllFlashes(); $appendCss = isset($this->options['class']) ? ' ' . $this->options['class'] : ''; $alerts = ''; foreach ($flashes as $type => $message) { if (isset($this->alertTypes[$type])) { /* initialize css class for each alert box */ $this->options['class'] = $this->alertTypes[$type] . $appendCss; /* assign unique id to each alert box */ $this->options['id'] = $this->getId() . '-' . $type; $body = Icons::p($this->alertIcons[$type], ['class' => 'icon']) . $message; $alerts .= Alert::widget(['body' => $body, 'closeButton' => $this->closeButton, 'options' => $this->options]); $session->removeFlash($type); } } if ($alerts) { echo strtr($this->template, ['{alerts}' => $alerts]); } }
\yz\admin\assets\LoginAsset::register($this); $this->params['body-extra-class'] = 'login-page'; ?> <div class="container"> <div class="b-login"> <h1><?php echo Yii::t('admin/t', 'Administration panel'); ?> </h1> <?php $form = ActiveForm::begin(['id' => 'login-form', 'fieldConfig' => ['horizontalCssClasses' => ['label' => 'col-sm-3', 'wrapper' => 'col-sm-7']]]); ?> <?php echo $form->field($loginForm, 'login')->textInput(['autofocus' => '']); ?> <?php echo $form->field($loginForm, 'password')->passwordInput(); ?> <?php echo Html::submitButton(Icons::p('unlock-alt') . Yii::t('admin/t', 'Sign in'), ['class' => 'btn btn-success']); ?> <?php ActiveForm::end(); ?> </div> </div>
public function renderSettings() { if ($this->showSettings == false) { return ''; } return Html::a(Icons::p('gears') . Yii::t('admin/gridview', 'Grid Settings'), ['#'], ['class' => 'pull-right btn btn-default btn-xs btn-grid-settings js-btn-admin-grid-settings', 'data' => ['gridUniqueId' => $this->getGridId(), 'currentPageSize' => $this->dataProvider->getPagination()->pageSize, 'pageSizes' => $this->allowedPageSizes]]); }
/** * @return \yii\bootstrap\Button */ public function getImportButton() { if ($this->_importButton === null) { $url = $this->importUrl; if ($this->checkAccess($url) == false) { return null; } if ($this->checkAccess($url) == false) { return null; } $this->_importButton = Button::widget(['tagName' => 'a', 'label' => Icons::p('upload') . \Yii::t('admin/t', 'Импорт'), 'encodeLabel' => false, 'options' => ['href' => Url::to($url), 'class' => 'btn btn-default', 'id' => 'action-button-import']]); } return $this->_importButton; }