/**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     //        return [
     //            'id' => Yii::t('reportmanager', 'ID'),
     //        ];
     return ArrayHelper::map(self::$report->columns, 'alias', 'label') + parent::attributeLabels();
 }
Exemple #2
0
 /**
  * Get labels from behavior relations
  * @return array
  */
 public function attributeLabels()
 {
     if ($this->_labels === null) {
         $this->_labels = [];
         foreach ($this->behaviors as $behavior) {
             if ($behavior instanceof HasRelation) {
                 $this->_labels[$behavior->getAttributeName()] = $behavior->getAttributeLabel();
             }
         }
     }
     return array_merge(parent::attributeLabels(), $this->_labels);
 }
Exemple #3
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     $labels = parent::attributeLabels();
     $labels['id'] = 'ID';
     $labels['lft'] = 'Левый край диапазона';
     $labels['rgt'] = 'Правый край диапазона';
     $labels['depth'] = 'Уровень';
     $labels['name'] = 'Название';
     $labels['title'] = 'Заголовок';
     $labels['alias'] = 'Алиас';
     $labels['template_id'] = 'Шаблон';
     $labels['annotation'] = 'Аннотация';
     $labels['meta_description'] = 'Мета-описание';
     $labels['meta_keywords'] = 'Мета-ключи';
     $labels['content'] = 'Содержание';
     $labels['img'] = 'Изображение';
     $labels['status'] = 'Статус';
     $labels['created_at'] = 'Создан';
     $labels['updated_at'] = 'Обновлен';
     $labels['created_user_id'] = 'Создал';
     $labels['updated_user_id'] = 'Обновил';
     $labels['created_user_name'] = 'Создал';
     $labels['updated_user_name'] = 'Обновил';
     $labels['is_folder'] = 'Папка?';
     $labels['parent_id'] = 'Родительский документ';
     $labels['parent_name'] = 'Родительский документ';
     $labels['root_id'] = 'Корневой документ';
     $labels['root_name'] = 'Корневой документ';
     if ($this->template_id) {
         $template = Template::findOne($this->template_id);
     }
     for ($i = 1; $i <= Template::OPTIONS_COUNT; $i++) {
         $option_name = 'option_' . $i . '_name';
         $labels['option_' . $i] = isset($template->{$option_name}) && $template->{$option_name} ? $template->{$option_name} : 'Опция ' . $i;
         $labels['option_' . $i . '_file'] = isset($template->{$option_name}) && $template->{$option_name} ? $template->{$option_name} : 'Опция ' . $i;
     }
     return $labels;
 }
 /**
  * @param ActiveRecord $model
  * @param array $except
  * @return \im\search\components\searchable\AttributeDescriptor[]
  */
 protected function getSearchableModelAttributes($model, $except = [])
 {
     $searchableAttributes = [];
     $attributes = $model->attributes();
     $labels = $model->attributeLabels();
     foreach ($attributes as $attribute) {
         if (!in_array($attribute, $except)) {
             $searchableAttributes[] = new AttributeDescriptor(['name' => $attribute, 'label' => isset($labels[$attribute]) ? $labels[$attribute] : $model->generateAttributeLabel($attribute)]);
         }
     }
     return $searchableAttributes;
 }
Exemple #5
0
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     $labels = parent::attributeLabels();
     $labels['id'] = 'ID';
     $labels['name'] = 'Название';
     $labels['path'] = 'Путь к файлу';
     for ($i = 1; $i <= self::OPTIONS_COUNT; $i++) {
         $labels['option_' . $i . '_name'] = 'Название поля ' . $i;
         $labels['option_' . $i . '_type'] = 'Тип поля ' . $i;
         $labels['option_' . $i . '_require'] = 'Обязательность поля ' . $i;
         $labels['option_' . $i . '_param'] = 'Параметр поля ' . $i;
     }
     return $labels;
 }
 /**
  * @inheritdoc
  */
 public function attributeLabels()
 {
     return array_merge(parent::attributeLabels(), ['id' => \Yii::t('skeeks/money', 'ID'), 'code' => \Yii::t('skeeks/money', "Currency"), 'active' => \Yii::t('skeeks/money', 'Active'), 'course' => \Yii::t('skeeks/money', "Rate"), 'name' => \Yii::t('skeeks/money', "Name"), 'name_full' => \Yii::t('skeeks/money', "Full name"), 'priority' => \Yii::t('skeeks/money', 'Priority')]);
 }