<?php if ($contentModel->root_tree_id) { ?> <?php if ($contentModel->is_allow_change_tree == \skeeks\cms\components\Cms::BOOL_Y) { ?> <?php echo $form->fieldSelect($model, 'tree_id', \yii\helpers\ArrayHelper::map(\skeeks\cms\helpers\TreeOptions::findOne($contentModel->root_tree_id)->getMultiOptions(), 'id', 'name'), ['allowDeselect' => true]); ?> <?php } ?> <?php echo $form->fieldSelectMulti($model, 'treeIds', \yii\helpers\ArrayHelper::map(\skeeks\cms\helpers\TreeOptions::findOne($contentModel->root_tree_id)->getMultiOptions(), 'id', 'name')); ?> <?php } else { ?> <?php $mode = \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_COMBO; if ($contentModel->is_allow_change_tree != \skeeks\cms\components\Cms::BOOL_Y) { $mode = \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_MULTI; } ?> <?php echo $form->field($model, 'treeIds')->label(\Yii::t('app', 'Sections of the site'))->widget(\skeeks\cms\widgets\formInputs\selectTree\SelectTree::className(), ["attributeMulti" => "treeIds", "mode" => $mode])->hint(\Yii::t('app', 'Specify sections of the site, which would like to see this publication')); ?> <?php