public static function find($id = null) { if (!empty($id)) { $domains = \yii\easyii\helpers\Multisite::getDomains(); $key = array_search($id, array_column($domains, 'crc')); if (isset($domains[$key]) && !empty($domains[$key])) { $model = new static(); $model->setAttributes($domains[$key]); return $model; } return null; } return \yii\easyii\helpers\Multisite::getDomains(); }
echo $asset->baseUrl; ?> /img/logo_20.png"> EasyiiCMS </div> <div class="nav"> <a href="<?php echo Url::to(['/']); ?> " class="pull-left"><i class="glyphicon glyphicon-home"></i> <?php echo Yii::t('easyii', 'Open site'); ?> </a> <div class="pull-left nav-multisite"> <?php echo Html::dropDownList('', \yii\easyii\helpers\Multisite::getDomainFromCookie(), ArrayHelper::map(\yii\easyii\helpers\Multisite::getDomains(), 'domain', 'domain'), ['class' => 'form-control', 'prompt' => Yii::t('easyii', 'Select site'), 'onChange' => 'location.href = "/admin/default/change-site?domain=" + this.value']); ?> </div> <a href="<?php echo Url::to(['/admin/sign/out']); ?> " class="pull-right"><i class="glyphicon glyphicon-log-out"></i> <?php echo Yii::t('easyii', 'Logout'); ?> </a> </div> </div> <div class="main"> <div class="box sidebar">
<?php use yii\easyii\widgets\DateTimePicker; use yii\easyii\helpers\Image; use yii\easyii\widgets\TagsInput; use yii\helpers\ArrayHelper; use yii\helpers\Html; use yii\helpers\Url; use yii\widgets\ActiveForm; use yii\easyii\widgets\Redactor; use yii\easyii\widgets\SeoForm; $module = $this->context->module->id; $form = ActiveForm::begin(['enableAjaxValidation' => true, 'options' => ['enctype' => 'multipart/form-data', 'class' => 'model-form']]); ?> <?php echo $form->field($model, 'domain')->dropDownList(ArrayHelper::map(\yii\easyii\helpers\Multisite::getDomains(), 'domain', 'domain'), ['prompt' => Yii::t('easyii/multisite', 'Select site')]); ?> <?php echo $form->field($model, 'domainCopy')->dropDownList(ArrayHelper::map(\yii\easyii\helpers\Multisite::getDomains(), 'domain', 'domain'), ['prompt' => Yii::t('easyii/multisite', 'Select site')]); ?> <?php echo Html::submitButton(Yii::t('easyii', 'Save'), ['class' => 'btn btn-primary']); ?> <?php ActiveForm::end();