/** * @return string */ public function renderConfigForm(ActiveForm $activeForm) { echo $activeForm->fieldSelect($this, 'fieldElement', \skeeks\cms\relatedProperties\propertyTypes\PropertyTypeList::fieldElements()); echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('skeeks/cms', "Values for list"), 'hint' => \Yii::t('skeeks/cms', "You can snap to the element number of properties, and set the value to them"), 'parentModel' => $this->property, 'relation' => ['property_id' => 'id'], 'controllerRoute' => $this->enumRoute, 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'id', 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'value', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'def', 'enableSorting' => false]]]]); }
?> <?php echo $form->fieldSet(\Yii::t('app', 'General information')); ?> <?php echo $form->field($model, 'name')->textInput(); ?> <?php echo $form->field($model, 'code')->textInput(); ?> <?php echo $form->fieldInputInt($model, 'priority')->textInput(); echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('app', 'Content')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('app', "Content"), 'hint' => "", 'parentModel' => $model, 'relation' => ['content_type' => 'code'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'controllerRoute' => 'cms/admin-cms-content', 'gridViewOptions' => ['sortable' => true, 'columns' => ['name', 'code', ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'attribute' => 'active']]]]); ?> <?php echo $form->fieldSetEnd(); ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
?> <?php echo $form->field($passwordChange, 'new_password_confirm')->passwordInput(); ?> <?php echo $form->fieldSetEnd(); ?> <?/*= $form->fieldSet(\Yii::t('skeeks/cms','Additionally'))*/?><!-- <?/*= $form->field($model, 'city')->textInput(); */?> <?/*= $form->field($model, 'address')->textInput(); */?> <?/*= $form->field($model, 'info')->textarea(); */?> <?/*= $form->field($model, 'status_of_life')->textarea(); */?> --><?/*= $form->fieldSetEnd(); */?> <? if (!$model->isNewRecord && class_exists('\skeeks\cms\authclient\models\UserAuthClient')) : ?> <?php echo $form->fieldSet(\Yii::t('skeeks/authclient', 'Social profiles')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('skeeks/authclient', "Social profiles"), 'hint' => "", 'parentModel' => $model, 'relation' => ['user_id' => 'id'], 'controllerRoute' => 'authclient/admin-user-auth-client', 'gridViewOptions' => ['columns' => ['displayName']]]); ?> <?php echo $form->fieldSetEnd(); ?> <? endif; ?> <?php echo $form->buttonsStandart($model); \skeeks\cms\modules\admin\widgets\form\ActiveFormUseTab::end();
?> <?php echo $form->field($model, 'server_name')->textInput(['maxlength' => 255]); ?> <?php echo $form->fieldInputInt($model, 'priority'); ?> <?php echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { ?> <?php echo $form->fieldSet(\Yii::t('app', "Domains")); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => "", 'hint' => "", 'parentModel' => $model, 'relation' => ['site_code' => 'code'], 'controllerRoute' => 'cms/admin-cms-site-domain', 'gridViewOptions' => ['columns' => ['domain']]]); ?> <?php echo $form->fieldSetEnd(); } echo $form->buttonsStandart($model); ?> <?php ActiveForm::end();
echo $form->fieldRadioListBoolean($model, 'smart_filtrable'); ?> <?php echo $form->fieldRadioListBoolean($model, 'with_description'); echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { echo $form->fieldSet(\skeeks\cms\shop\Module::t('app', 'Values for the list')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \skeeks\cms\shop\Module::t('app', 'Values for the list'), 'hint' => \skeeks\cms\shop\Module::t('app', 'You can snap to the element number of properties, and set the value to them'), 'parentModel' => $model, 'relation' => ['property_id' => 'id'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'dataProviderCallback' => function ($dataProvider) { /** * @var \yii\data\BaseDataProvider $dataProvider */ $dataProvider->getPagination()->defaultPageSize = 5000; }, 'controllerRoute' => 'shop/admin-person-type-property-enum', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'id', 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'value', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'def', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); } ?> <?php echo $form->fieldSet('Связь с пользователем'); ?> <?php echo $form->fieldRadioListBoolean($model, 'is_user_email');
<?php echo $form->fieldSet(\Yii::t('app', 'Captions')); ?> <?php echo $form->field($model, 'name_one')->textInput(); ?> <?php echo $form->field($model, 'name_meny')->textInput(); echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { ?> <?php echo $form->fieldSet(\Yii::t('app', 'Element properties')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('app', 'Element properties'), 'hint' => \Yii::t('app', 'Every content on the site has its own set of properties, its sets here'), 'parentModel' => $model, 'relation' => ['tree_type_id' => 'id'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'dataProviderCallback' => function ($dataProvider) { /** * @var \yii\data\BaseDataProvider $dataProvider */ $dataProvider->getPagination()->defaultPageSize = 5000; }, 'controllerRoute' => 'cms/admin-cms-tree-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); } echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
?> <?php echo $form->fieldSetEnd(); ?> <?php echo $form->fieldSet(\Yii::t('skeeks/cms', 'Captions')); ?> <?php echo $form->field($model, 'name_one')->textInput(); ?> <?php echo $form->field($model, 'name_meny')->textInput(); echo $form->fieldSetEnd(); ?> <? if (!$model->isNewRecord) : ?> <?php echo $form->fieldSet(\Yii::t('skeeks/cms', 'Element properties')); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \Yii::t('skeeks/cms', 'Element properties'), 'hint' => \Yii::t('skeeks/cms', 'Every content on the site has its own set of properties, its sets here'), 'parentModel' => $model, 'relation' => ['tree_type_id' => 'id'], 'controllerRoute' => 'cms/admin-cms-tree-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); ?> <? endif; ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
<? $childContents = $model->cmsContent->getChildrenContents()->andWhere(['!=', 'id', $shopContent->childrenContent->id])->all(); ?> <? foreach($childContents as $childContent) : ?> <?php echo $form->fieldSet($childContent->name); ?> <? if ($model->isNewRecord) : ?> <?php echo \yii\bootstrap\Alert::widget(['options' => ['class' => 'alert-warning'], 'body' => \Yii::t('skeeks/shop/app', 'Management will be available after saving')]); ?> <? else: ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => $childContent->name, 'namespace' => md5($model->className() . $childContent->id), 'parentModel' => $model, 'relation' => ['content_id' => $childContent->id, 'parent_content_element_id' => $model->id], 'sort' => ['defaultOrder' => ['priority' => 'published_at']], 'controllerRoute' => 'shop/admin-cms-content-element', 'gridViewOptions' => ['columns' => (array) \skeeks\cms\controllers\AdminCmsContentElementController::getColumns($childContent)]]); ?> <? endif; ?> <?php echo $form->fieldSetEnd(); ?> <? endforeach; ?> <? endif; ?>
$columnsFile = \Yii::getAlias('@skeeks/cms/views/admin-cms-content-element/_columns.php'); /** * @var $content \skeeks\cms\models\CmsContent */ if ($contents = \skeeks\cms\models\CmsContent::find()->active()->all()) { ?> <?php foreach ($contents as $content) { ?> <?php echo $form->fieldSet($content->name); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => $content->name, 'hint' => \Yii::t('app', "Showing all elements of type '{name}' associated with this section. Taken into account only the main binding.", ['name' => $content->name]), 'parentModel' => $model, 'relation' => ['tree_id' => 'id', 'content_id' => $content->id], 'sort' => ['defaultOrder' => ['priority' => 'published_at']], 'controllerRoute' => 'cms/admin-cms-content-element', 'gridViewOptions' => ['columns' => (array) (include $columnsFile)]]); ?> <?php echo $form->fieldSetEnd(); ?> <?php } } ?> <?php echo $form->buttonsCreateOrUpdate($model); ?> <?php
echo $form->fieldInputInt($model, 'priority'); ?> <?php echo $form->fieldSetEnd(); ?> <?php if (!$model->isNewRecord) { ?> <?php echo $form->fieldSet('Свойства'); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \skeeks\cms\shop\Module::t('app', 'Properties payer'), 'hint' => \skeeks\cms\shop\Module::t('app', 'Each payer may have its own set of properties that it will ask when ordering.'), 'parentModel' => $model, 'relation' => ['shop_person_type_id' => 'id'], 'sort' => ['defaultOrder' => ['priority' => SORT_ASC]], 'dataProviderCallback' => function ($dataProvider) { /** * @var \yii\data\BaseDataProvider $dataProvider */ $dataProvider->getPagination()->defaultPageSize = 5000; }, 'controllerRoute' => 'shop/admin-person-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); } ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();
]) ->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_EMPTY_LAYOUT, 'true') ->setSystemParam(\skeeks\cms\modules\admin\Module::SYSTEM_QUERY_NO_ACTIONS_MODEL, 'true') ->enableAdmin()->toString() ]); $onclick = new \yii\web\JsExpression(<<<JS new sx.classes.AddPosition({$json}).open(); return true; JS ); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => "", 'parentModel' => $model, 'relation' => ['order_id' => 'id'], 'sort' => ['defaultOrder' => ['updated_at' => SORT_DESC]], 'controllerRoute' => 'shop/admin-basket', 'gridViewOptions' => ['enabledPjax' => false, 'beforeTableLeft' => <<<HTML <a class="btn btn-default btn-sm" onclick="new sx.classes.SelectProduct().open(); return true;"><i class="glyphicon glyphicon-plus"></i><?=\\Yii::t('skeeks/shop/app','Add this item')?></a> <a class="btn btn-default btn-sm" onclick='{$onclick}'><i class="glyphicon glyphicon-plus"></i><?=\\Yii::t('skeeks/shop/app','Add position')?></a> HTML , 'columns' => [['class' => \skeeks\cms\shop\grid\BasketImageGridColumn::className()], ['class' => \skeeks\cms\shop\grid\BasketNameGridColumn::className()], ['class' => \skeeks\cms\shop\grid\BasketQuantityGridColumn::className()], ['class' => \skeeks\cms\shop\grid\BasketPriceGridColumn::className()], ['class' => \skeeks\cms\shop\grid\BasketSumGridColumn::className()]]]]); ?> <div class="row"> <div class="col-md-8"></div> <div class="col-md-4"> <div class="sx-result"> <? $this->registerCss(<<<CSS .sx-result { background-color: #ecf2d3; }
<?php echo $form->fieldRadioListBoolean($model, 'active'); ?> <?php echo $form->field($model, 'siteCodes')->checkboxList(\yii\helpers\ArrayHelper::map(\skeeks\cms\models\CmsSite::find()->all(), 'code', 'name')); ?> <?php echo $form->fieldInputInt($model, 'priority'); ?> <?php echo $form->fieldSetEnd(); ?> <? if (!$model->isNewRecord) : ?> <?php echo $form->fieldSet('Свойства'); ?> <?php echo \skeeks\cms\modules\admin\widgets\RelatedModelsGrid::widget(['label' => \skeeks\cms\shop\Module::t('app', 'Properties payer'), 'hint' => \skeeks\cms\shop\Module::t('app', 'Each payer may have its own set of properties that it will ask when ordering.'), 'parentModel' => $model, 'relation' => ['shop_person_type_id' => 'id'], 'controllerRoute' => 'shop/admin-person-type-property', 'gridViewOptions' => ['sortable' => true, 'columns' => [['attribute' => 'name', 'enableSorting' => false], ['class' => \skeeks\cms\grid\BooleanColumn::className(), 'attribute' => 'active', 'falseValue' => \skeeks\cms\components\Cms::BOOL_N, 'trueValue' => \skeeks\cms\components\Cms::BOOL_Y, 'enableSorting' => false], ['attribute' => 'code', 'enableSorting' => false], ['attribute' => 'priority', 'enableSorting' => false]]]]); ?> <?php echo $form->fieldSetEnd(); ?> <? endif; ?> <?php echo $form->buttonsCreateOrUpdate($model); ActiveForm::end();