Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function rules()
 {
     $rules = parent::rules();
     if (empty($this->generateFrom) && $this->uniqueValidatorClassName) {
         $rules[] = array_merge([$this->attr, $this->uniqueValidatorClassName, 'except' => ActiveRecord::SCENARIO_SEARCH], $this->uniqueParams);
     }
     $rules[] = [$this->attr, 'match', 'pattern' => '/^[A-z0-9_-]+$/i'];
     return $rules;
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["username" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Username'), "isRequired" => true], "params" => [$this->owner, "username"]], "email" => ["definition" => ["class" => \common\db\fields\EmailField::className(), "title" => Yii::t('main/app', 'Email'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "email"]], "text" => ["definition" => ["class" => \common\db\fields\MarkItUpField::className(), "title" => Yii::t('main/app', 'Comment'), "isRequired" => true, "showInGrid" => true], "params" => [$this->owner, "text"]], "model" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Model class'), "isRequired" => true, "gridFilter" => $this->owner->getClasses(), "gridOptions" => ["value" => function ($model) {
         $cls = $model->model;
         if (class_exists($cls)) {
             return $cls::getEntityName();
         } else {
             return $cls;
         }
     }]], "params" => [$this->owner, "model"]], "item_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('main/app', 'Item id'), "isRequired" => true], "params" => [$this->owner, "item_id"]]];
 }
Exemplo n.º 3
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']]];
 }
Exemplo n.º 4
0
 /**
  * @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('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, "generateFrom" => "title"], "params" => [$this->owner, "code"]], "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"]]];
 }
Exemplo n.º 5
0
 /**
  * @inheritdoc
  */
 public 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('main/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "code"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Link'), "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "link"]], "class" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Css class'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "class"]], "target" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Target'), "isRequired" => false, "showInGrid" => false, "data" => function () {
         return $this->owner->targetsList();
     }], "params" => [$this->owner, "target"]]];
 }
Exemplo n.º 6
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => false], "params" => [$this->owner, "title"]], "key" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Key'), "isRequired" => false], "params" => [$this->owner, "key"]], "value" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Value'), "isRequired" => false], "params" => [$this->owner, "value"]]];
 }
Exemplo n.º 7
0
 /**
  * @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"]]];
 }
Exemplo n.º 8
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["region_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('geo/app', 'Region id')], "params" => [$this->owner, "region_id"]], "rajon_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('geo/app', 'Rajon id')], "params" => [$this->owner, "rajon_id"]], "clean_title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('geo/app', 'Clean title'), "isRequired" => false], "params" => [$this->owner, "clean_title"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('geo/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "title2" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('geo/app', 'Title 2'), "isRequired" => false], "params" => [$this->owner, "title2"]], "type" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('geo/app', 'Type'), "isRequired" => false], "params" => [$this->owner, "type"]], "type_ext" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('geo/app', 'Type ext'), "isRequired" => false], "params" => [$this->owner, "type_ext"]], "code" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('geo/app', 'Code'), "isRequired" => false], "params" => [$this->owner, "code"]]];
 }
Exemplo n.º 9
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["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], "params" => [$this->owner, "code"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "file" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'File path'), "isRequired" => false], "params" => [$this->owner, "file"]]];
 }
Exemplo n.º 10
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["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\TextField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => true], "params" => [$this->owner, "code"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/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('main/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('main/app', 'Sort'), "defaultValue" => ActiveRecord::DEFAULT_SORT, "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "sort"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('main/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]]];
 }
Exemplo n.º 11
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"]]];
 }
Exemplo n.º 12
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"]]];
 }
Exemplo n.º 13
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"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('banners/app', 'Code'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "code"]]];
 }
Exemplo n.º 14
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"]]];
 }
Exemplo n.º 15
0
 /**
  * @inheritdoc
  */
 protected function view()
 {
     $view = parent::view();
     $view['format'] = 'html';
     return $view;
 }
Exemplo n.º 16
0
 /**
  * Правила валидации
  * @return array
  */
 public function rules()
 {
     $rules = parent::rules();
     $rules[] = [$this->attr, 'string', 'min' => $this->passwordLength];
     return $rules;
 }
Exemplo n.º 17
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Code'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "code"]], "cond_type" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('main/app', 'Condition type'), "isRequired" => true, "showInGrid" => false, "data" => ["\\app\\modules\\main\\models\\Template", "getConds"]], "params" => [$this->owner, "cond_type"]], "cond" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Condition'), "isRequired" => false, "showInGrid" => false], "params" => [$this->owner, "cond"]], "sort" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('main/app', 'Sort'), "defaultValue" => ActiveRecord::DEFAULT_SORT, "isRequired" => false, "editInGrid" => true], "params" => [$this->owner, "sort"]], "includesIdsStr" => ["definition" => ["class" => \common\db\fields\ManyManySortField::className(), "title" => Yii::t('main/app', 'Includes'), "data" => [$this, "getIncludesList"]], "params" => [$this->owner, "includesIdsStr", "includes"]]];
 }
Exemplo n.º 18
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('photogallery/app', 'Title'), "isRequired" => true, "editInGrid" => true], "params" => [$this->owner, "title"]], "code" => ["definition" => ["class" => \common\db\fields\CodeField::className(), "title" => Yii::t('photogallery/app', 'Code'), "isRequired" => true, "showInGrid" => false], "params" => [$this->owner, "code"]], "image" => ["definition" => ["class" => \common\db\fields\Html5ImageField::className(), "title" => Yii::t('photogallery/app', 'Image'), "isRequired" => false], "params" => [$this->owner, "image"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('photogallery/app', 'Text'), "isRequired" => false], "params" => [$this->owner, "text"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('photogallery/app', 'Sort'), "isRequired" => false, "editInGrid" => true, "defaultValue" => 500], "params" => [$this->owner, "sort"]]];
 }
Exemplo n.º 19
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"]]];
 }
Exemplo n.º 20
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"]]];
 }
Exemplo n.º 21
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"]]];
 }
Exemplo n.º 22
0
 /**
  * @inheritdoc
  */
 protected function config()
 {
     return ["order_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Order ID'), "isRequired" => true], "params" => [$this->owner, "order_id"]], "title" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Title')], "params" => [$this->owner, "title"]], "price" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Price'), "isRequired" => true], "params" => [$this->owner, "price"]], "discount" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Discount')], "params" => [$this->owner, "discount"]], "qty" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Quantity'), "isRequired" => true], "params" => [$this->owner, "qty"]], "item_id" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Item ID'), "isRequired" => true], "params" => [$this->owner, "item_id"]], "item_class" => ["definition" => ["class" => \common\db\fields\ListField::className(), "title" => Yii::t('shop/app', 'Item class'), "isRequired" => true, 'data' => [Yii::$app->getModule('shop'), 'getModelNames']], "params" => [$this->owner, "item_class"]], "link" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Link'), "showInGrid" => false], "params" => [$this->owner, "link"]], "attrs" => ["definition" => ["class" => \app\modules\shop\db\fields\GoodAttrsField::className(), "title" => Yii::t('shop/app', 'Attributes')], "params" => [$this->owner, "attrs"]], "client_attrs" => ["definition" => ["class" => \app\modules\shop\db\fields\GoodAttrsField::className(), "title" => Yii::t('shop/app', 'Client Attributes')], "params" => [$this->owner, "client_attrs"]]];
 }
Exemplo n.º 23
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"]], "text" => ["definition" => ["class" => \common\db\fields\HtmlField::className(), "title" => Yii::t('shop/app', 'Text')], "params" => [$this->owner, "text"]], "price" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Price')], "params" => [$this->owner, "price"]], "free_limit" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Free limit')], "params" => [$this->owner, "free_limit"]], "class" => ["definition" => ["class" => \common\db\fields\TextField::className(), "title" => Yii::t('shop/app', 'Class'), "showInGrid" => false], "params" => [$this->owner, "class"]], "sort" => ["definition" => ["class" => \common\db\fields\NumberField::className(), "title" => Yii::t('shop/app', 'Sort'), "showInGrid" => true, "editInGrid" => true], "params" => [$this->owner, "sort"]]];
 }
Exemplo n.º 24
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"]]];
 }