Esempio n. 1
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"]]];
 }
Esempio n. 2
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ['created_at' => ['definition' => ["showInGrid" => true]], "status_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('shop/app', 'Status'), "isRequired" => true, "showInGrid" => true, "editInGrid" => true, "data" => [$this, "getStatusList"]], "params" => [$this->owner, "status_id", "status"]], "name" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Name'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "name"]], "email" => ["definition" => ["class" => \common\db\fields\EmailField::className(), "title" => Yii::t('shop/app', 'Email'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "email"]], "phone" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Phone'), "editInGrid" => true], "params" => [$this->owner, "phone"]], "city" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'City'), "isRequired" => true, "showInGrid" => false], "params" => [$this->owner, "city"]], "index" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Index'), "showInGrid" => false], "params" => [$this->owner, "index"]], "address" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Address'), "isRequired" => true, "showInGrid" => false], "params" => [$this->owner, "address"]], "comment" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('shop/app', 'Comment'), "showInGrid" => false], "params" => [$this->owner, "comment"]], "delivery_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('shop/app', 'Delivery'), "isRequired" => true, "showInGrid" => false, "data" => [$this, "getDeliveryList"]], "params" => [$this->owner, "delivery_id", "delivery"]], "payment_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('shop/app', 'Payment'), "isRequired" => true, "showInGrid" => false, "data" => [$this, "getPaymentList"]], "params" => [$this->owner, "payment_id", "payment"]], "delivery_price" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Delivery price'), "showInGrid" => false, "showInForm" => false], "params" => [$this->owner, "delivery_price"]], "totalPrice" => ["definition" => ["class" => \common\db\fields\Field::className(), "title" => Yii::t('shop/app', 'Total price'), "showInGrid" => true, "showInForm" => false, "isSafe" => false, "search" => false, "gridOptions" => ['format' => 'currency']], "params" => [$this->owner, "totalPrice"]]];
 }
Esempio n. 3
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["sections" => ["definition" => ["class" => \common\db\fields\ManyManyField::className(), "title" => Yii::t('catalog/app', 'Catalog Sections'), "isRequired" => true, "data" => [$this, "getSectionsList"]], "params" => [$this->owner, "sectionsIds", "sections"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('catalog/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('catalog/app', 'Code'), "isRequired" => true, "showInGrid" => false, "generateFrom" => "title"], "params" => [$this->owner, "code"]], "comments" => ["definition" => ["class" => \common\db\fields\CheckBoxField::className(), "title" => Yii::t('catalog/app', 'Comments'), "isRequired" => false], "params" => [$this->owner, "comments"]], "price" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('catalog/app', 'Price'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "price"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('catalog/app', 'Image'), "isRequired" => false], "params" => [$this->owner, "image"]], "annotation" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('catalog/app', 'Annotation'), "isRequired" => false], "params" => [$this->owner, "annotation"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('catalog/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "producer_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('catalog/app', 'Producer'), "isRequired" => false, "showInGrid" => false, "data" => [$this, "getProducersList"]], "params" => [$this->owner, "producer_id", "producer"]], "metatitle" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('catalog/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('catalog/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('catalog/app', 'Description'), "isRequired" => false, "showInGrid" => false, "tab" => self::SEO_TAB], "params" => [$this->owner, "description"]]];
 }
Esempio n. 4
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "place_id" => ["definition" => ["class" => \common\db\fields\HasOneField::className(), "title" => Yii::t('banners/app', 'Place'), "data" => [$this, "getPlaces"], "isRequired" => true], "params" => [$this->owner, "place_id", "place"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('banners/app', 'Condition type'), "isRequired" => true, "showInGrid" => false, "data" => [$this->owner, "getConds"]], "params" => [$this->owner, "cond_type"]], "cond" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "image" => ["definition" => ["class" => \common\db\fields\Html5FileField::className(), "title" => Yii::t('banners/app', 'File')], "params" => [$this->owner, "image"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('banners/app', 'Link'), "showInGrid" => false], "params" => [$this->owner, "link"]], "target" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('banners/app', 'Target'), "showInGrid" => false, "data" => ["\\app\\modules\\banners\\models\\Banner", "getTargets"]], "params" => [$this->owner, "target"]], "text" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('banners/app', 'Text')], "params" => [$this->owner, "text"]], "width" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Width'), "showInGrid" => false], "params" => [$this->owner, "width"]], "height" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Height'), "showInGrid" => false], "params" => [$this->owner, "height"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('banners/app', 'Sort'), "showInGrid" => true, "editInGrid" => true], "params" => [$this->owner, "sort"]]];
 }