/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $find = CmsContentElement::find()->active(); if ($this->content_id) { $find->andWhere(['content_id' => $this->content_id]); } if ($this->fieldElement == self::FIELD_ELEMENT_SELECT) { $field = $this->activeForm->fieldSelect($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []); } else { if ($this->fieldElement == self::FIELD_ELEMENT_SELECT_MULTI) { $field = $this->activeForm->fieldSelectMulti($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []); } else { if ($this->fieldElement == self::FIELD_ELEMENT_RADIO_LIST) { $field = parent::renderForActiveForm(); $field->radioList(ArrayHelper::map($find->all(), 'id', 'name')); } else { if ($this->fieldElement == self::FIELD_ELEMENT_CHECKBOX_LIST) { $field = parent::renderForActiveForm(); $field->checkboxList(ArrayHelper::map($find->all(), 'id', 'name')); } } } } if (!$field) { return ''; } return $field; }
public function init() { parent::init(); if (!$this->name) { $this->name = \Yii::t('app', 'Number'); } }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $pluginOptions = ['showAlpha' => (bool) ($this->showAlpha === Cms::BOOL_Y), 'showInput' => (bool) ($this->showInput === Cms::BOOL_Y), 'showPalette' => (bool) ($this->showPalette === Cms::BOOL_Y)]; $field->widget(ColorInput::className(), ['showDefaultPalette' => (bool) ($this->showDefaultPalette === Cms::BOOL_Y), 'useNative' => (bool) ($this->useNative === Cms::BOOL_Y), 'saveValueAs' => (string) $this->saveValueAs, 'pluginOptions' => $pluginOptions]); return $field; }
public function init() { parent::init(); if (!$this->name) { $this->name = \Yii::t('skeeks/cms', 'File'); } }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); if (in_array($this->fieldElement, array_keys(self::fieldElements()))) { $fieldElement = $this->fieldElement; $field->{$fieldElement}(['rows' => $this->rows]); } else { $field->textInput([]); } return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $find = CmsContentElement::find()->active(); if ($this->content_id) { $find->andWhere(['content_id' => $this->content_id]); } if ($this->multiple == Cms::BOOL_N) { $field = $this->activeForm->fieldSelect($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []); } else { if ($this->multiple == Cms::BOOL_Y) { $field = $this->activeForm->fieldSelectMulti($this->model->relatedPropertiesModel, $this->property->code, ArrayHelper::map($find->all(), 'id', 'name'), []); } } return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $field->widget(\skeeks\cms\widgets\formInputs\comboText\ComboTextInputWidget::className(), ['ckeditorOptions' => ['relatedModel' => $this->model]]); return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $field->widget(\skeeks\cms\widgets\formInputs\selectTree\SelectTree::className(), ["mode" => $this->isMultiple ? \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_MULTI : \skeeks\cms\widgets\formInputs\selectTree\SelectTree::MOD_SINGLE, "attributeSingle" => $this->property->code, "attributeMulti" => $this->property->code]); return $field; }
/** * @return $this */ public function initInstance() { parent::initInstance(); if (in_array($this->fieldElement, [self::FIELD_ELEMENT_SELECT_MULTI, self::FIELD_ELEMENT_CHECKBOX_LIST])) { $this->multiple = Cms::BOOL_Y; } return $this; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $field->textInput(); return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $field->widget(\kartik\datecontrol\DateControl::classname(), ['type' => $this->type]); return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { $field = parent::renderForActiveForm(); $field->widget(\skeeks\cms\modules\admin\widgets\formInputs\OneImage::className(), ['filesModel' => $this->model]); return $field; }
/** * @return \yii\widgets\ActiveField */ public function renderForActiveForm() { if ($this->fieldElement == self::FIELD_ELEMENT_SELECT) { $field = $this->activeForm->fieldSelect($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($this->property->enums, 'id', 'value'), []); } else { if ($this->fieldElement == self::FIELD_ELEMENT_SELECT_MULTI) { $field = $this->activeForm->fieldSelectMulti($this->property->relatedPropertiesModel, $this->property->code, ArrayHelper::map($this->property->enums, 'id', 'value'), []); } else { if ($this->fieldElement == self::FIELD_ELEMENT_RADIO_LIST) { $field = parent::renderForActiveForm(); $field->radioList(ArrayHelper::map($this->property->enums, 'id', 'value')); } else { if ($this->fieldElement == self::FIELD_ELEMENT_CHECKBOX_LIST) { $field = parent::renderForActiveForm(); $field->checkboxList(ArrayHelper::map($this->property->enums, 'id', 'value')); } else { if ($this->fieldElement == self::FIELD_ELEMENT_LISTBOX_MULTI) { $field = parent::renderForActiveForm(); $field->listBox(ArrayHelper::map($this->property->enums, 'id', 'value'), ['size' => 5, 'multiple' => 'multiple']); } else { if ($this->fieldElement == self::FIELD_ELEMENT_LISTBOX) { $field = parent::renderForActiveForm(); $field->listBox(ArrayHelper::map($this->property->enums, 'id', 'value'), ['size' => 1]); } } } } } } if (!$field) { return ''; } return $field; }