/**
  * @inheritdoc
  */
 protected function config()
 {
     return ["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], "params" => [$this->owner, "code"]], "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"]]];
 }
Exemple #2
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ['active' => ['definition' => ['initValue' => false]], 'username' => ['definition' => ['class' => fields\TextField::className(), 'title' => Yii::t('main/app', 'Username'), 'isRequired' => true], 'params' => [$this->owner, 'username']], 'email' => ['definition' => ['class' => fields\EmailField::className(), 'title' => Yii::t('main/app', 'Email'), 'isRequired' => false, 'showInGrid' => false], 'params' => [$this->owner, 'email']], 'rating' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Rating'), 'min' => 0, 'max' => 5, 'isRequired' => true, 'editInGrid' => true, 'inputClass' => ['class' => RatingInput::className(), 'widgetOptions' => ['pluginOptions' => ['min' => 0, 'max' => 5, 'stars' => 5, 'step' => 1, 'size' => 'sm', 'showClear' => false, 'showCaption' => false]]]], 'params' => [$this->owner, 'rating']], 'text' => ['definition' => ['class' => fields\TextAreaField::className(), 'title' => Yii::t('main/app', 'Review'), 'isRequired' => true, 'showInGrid' => true], 'params' => [$this->owner, 'text']], 'model' => ['definition' => ['class' => fields\TextField::className(), 'title' => Yii::t('main/app', 'Model class'), 'isRequired' => true], 'params' => [$this->owner, 'model']], 'item_id' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Item id'), 'isRequired' => true], 'params' => [$this->owner, 'item_id']], 'source_model' => ['definition' => ['class' => fields\TextField::className(), 'title' => Yii::t('main/app', 'Model class'), 'isRequired' => true], 'params' => [$this->owner, 'source_model']], 'source_item_id' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Item id'), 'isRequired' => true], 'params' => [$this->owner, 'source_item_id']], 'count' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Reviews Count'), 'isRequired' => true, 'initValue' => 0, 'showInForm' => false], 'params' => [$this->owner, 'count']], 'rating_total' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Rating Total'), 'isRequired' => true, 'initValue' => 0, 'showInForm' => false], 'params' => [$this->owner, 'rating_total']], 'rating_average' => ['definition' => ['class' => fields\NumberField::className(), 'title' => Yii::t('main/app', 'Rating Average'), 'isRequired' => true, 'initValue' => 0, 'showInForm' => false], 'params' => [$this->owner, 'rating_average']]];
 }
Exemple #3
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"]]];
 }
Exemple #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"]]];
 }
Exemple #5
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"]]];
 }
Exemple #6
0
 /**
  * @inheritdoc
  */
 public function config()
 {
     return ["role" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Role'), "isRequired" => true, "data" => [$this->owner, "getRolesNames"]], "params" => [$this->owner, "role"]], "username" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Username'), "isRequired" => true], "params" => [$this->owner, "username"]], "password" => ["definition" => ["class" => \common\db\fields\PasswordField::className(), "title" => Yii::t('main/app', 'Password'), "isRequired" => false, "showInGrid" => false, "showInView" => false], "params" => [$this->owner, "password"]], "confirm_password" => ["definition" => ["class" => \common\db\fields\PasswordField::className(), "title" => Yii::t('main/app', 'Confirm password'), "isRequired" => false, "showInGrid" => false, "showInView" => false], "params" => [$this->owner, "confirm_password"]], "email" => ["definition" => ["class" => \common\db\fields\EmailField::className(), "title" => Yii::t('main/app', 'Email'), "isRequired" => true], "params" => [$this->owner, "email"]], "name" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Name'), "isRequired" => false], "params" => [$this->owner, "name"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('main/app', 'Image'), "isRequired" => false], "params" => [$this->owner, "image"]], "text" => ["definition" => ["class" => \common\db\fields\TextAreaField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "auth_key" => ["definition" => ["class" => \common\db\fields\Field::className(), "title" => Yii::t('main/app', 'Api key'), "isRequired" => false, "showInForm" => false, "showInGrid" => false, "showInExtendedFilter" => false, "isSafe" => false], "params" => [$this->owner, "auth_key"]]];
 }
Exemple #7
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"]]];
 }
 /**
  * @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"]]];
 }
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["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('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, "generateFrom" => "title"], "params" => [$this->owner, "code"]], "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"]], "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"]]];
 }
 /**
  * @inheritdoc
  */
 protected function view()
 {
     $view = parent::view();
     $view['value'] = Yii::$app->bbParser->parse($this->model->{$this->attr});
     return $view;
 }