Example #1
0
 /**
  * @inheritdoc
  */
 public function config()
 {
     return ["comments" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Comments'), "isRequired" => false], "params" => [$this->owner, "comments"]], "parent_id" => ["definition" => ["class" => \common\db\fields\ParentListField::className(), "title" => Yii::t('main/app', 'Parent'), "data" => [$this->owner, "getListTreeData"]], "params" => [$this->owner, "parent_id"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => true, "generateFrom" => "title", "uniqueValidatorClassName" => TreeUniqueValidator::className()], "params" => [$this->owner, "code"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "metatitle" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Meta title'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "metatitle"]], "keywords" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Keywords'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "keywords"]], "description" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Description'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "description"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('main/app', 'Image'), "isRequired" => false, "tab" => self::IMAGE_TAB], "params" => [$this->owner, "image"]]];
 }
Example #2
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["sections" => ["definition" => ["class" => \common\db\fields\ManyManyField::className(), "title" => Yii::t('news/app', 'News sections'), "isRequired" => true, "data" => [$this, "getSectionsList"]], "params" => [$this->owner, "sectionsIds", "sections"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('news/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('news/app', 'Code'), "isRequired" => true, "showInGrid" => false, "generateFrom" => "title"], "params" => [$this->owner, "code"]], "comments" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('news/app', 'Comments'), "isRequired" => false], "params" => [$this->owner, "comments"]], "date" => ["definition" => ["class" => \common\db\fields\DateField::className(), "title" => Yii::t('news/app', 'Date'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "date"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('news/app', 'Image'), "isRequired" => false], "params" => [$this->owner, "image"]], "annotation" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('news/app', 'Annotation'), "isRequired" => false], "params" => [$this->owner, "annotation"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('news/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "metatitle" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('news/app', 'Meta title'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "metatitle"]], "keywords" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('news/app', 'Keywords'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "keywords"]], "description" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('news/app', 'Description'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "description"]]];
 }
Example #3
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "default" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('shop/app', 'Default')], "params" => [$this->owner, "default"]], "text" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('shop/app', 'Text')], "params" => [$this->owner, "text"]], "tpl" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Tpl name')], "params" => [$this->owner, "tpl"]], "tplHtml" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('shop/app', 'Letter tpl'), "inputClassOptions" => ["options" => ["rows" => 20]]], "params" => [$this->owner, "tplHtml"]]];
 }
Example #4
0
 /**
  * Конфигурация полей по умолчанию
  * @return array
  */
 protected function defaultConfig()
 {
     return ["id" => ['definition' => ["class" => fields\PkField::className(), "title" => "ID"], "params" => [$this->owner, "id"]], "created_at" => ['definition' => ["class" => fields\TimestampField::className(), "title" => Yii::t('core', 'Created'), "showInGrid" => true, "showInFilter" => false, "filterInputClass" => ["class" => \common\inputs\DateRangeInput::className(), "fromAttr" => "createdAtFrom", "toAttr" => "createdAtTo"], "queryModifier" => [$this, "createdAtQueryModifier"]], "params" => [$this->owner, "created_at"]], "updated_at" => ['definition' => ["class" => fields\TimestampField::className(), "title" => Yii::t('core', 'Updated'), "showInExtendedFilter" => false], "params" => [$this->owner, "updated_at"]], "active" => ["definition" => ["class" => fields\CheckBoxField::className(), "title" => Yii::t('core', 'Active'), "editInGrid" => true, "initValue" => true], "params" => [$this->owner, "active"]], "author_id" => ['definition' => ["class" => fields\HasOneField::className(), "title" => Yii::t('core', 'Author'), "showInForm" => true, "data" => [$this, "getAuthorsList"], "gridAttr" => "username", "eagerLoading" => true], "params" => [$this->owner, "author_id", "author"]]];
 }
Example #5
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["model" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Model class'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "model"]], "role" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Role'), "isRequired" => true, "data" => function () {
         return \app\modules\main\models\User::getRolesNames();
     }, "editInGrid" => true], "params" => [$this->owner, "role"]], "create" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Create'), "editInGrid" => true], "params" => [$this->owner, "create"]], "read" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Read'), "editInGrid" => true], "params" => [$this->owner, "read"]], "update" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Update'), "editInGrid" => true], "params" => [$this->owner, "update"]], "delete" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('main/app', 'Delete'), "editInGrid" => true], "params" => [$this->owner, "delete"]], "constraint" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Constraint class'), "editInGrid" => true], "params" => [$this->owner, "constraint"]], "forbidden_attrs" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('main/app', 'Forbidden attributes'), "editInGrid" => true], "params" => [$this->owner, "forbidden_attrs"]]];
 }