Exemplo n.º 1
0
 /**
  * Returns the behaviors used for the model
  *
  * @return array
  * @see YdDressing::modelMap
  */
 public function behaviors()
 {
     if (!empty(Yii::app()->dressing->modelMap[get_class($this)]['behaviors'])) {
         return Yii::app()->dressing->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
Exemplo n.º 2
0
 public function behaviors()
 {
     $viewRoute = '/profile';
     if (!Yii::app()->params->isMobileApp) {
         $viewRoute = '/profile/view';
     }
     return array_merge(parent::behaviors(), array('X2LinkableBehavior' => array('class' => 'X2LinkableBehavior', 'module' => 'users', 'viewRoute' => $viewRoute), 'ERememberFiltersBehavior' => array('class' => 'application.components.ERememberFiltersBehavior', 'defaults' => array(), 'defaultStickOnClear' => false)));
 }
Exemplo n.º 3
0
 public function behaviors()
 {
     return CMap::mergeArray(parent::behaviors(), array('deletable' => array('class' => 'common.extensions.behaviors.DeletableBehavior', 'relations' => array('photos' => DeletableBehavior::CASCADE))));
 }
Exemplo n.º 4
0
 /**
  * Define behaviors
  * @return array
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('i18n-attribute-messages' => array('class' => 'I18nAttributeMessagesBehavior', 'translationAttributes' => array('title', 'slug', 'book_id'), 'languageSuffixes' => array_keys(Yii::app()->params["languages"]))));
 }
Exemplo n.º 5
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('LoggableBehavior' => array('class' => 'LoggableBehavior', 'ignored' => array('password'))));
 }
Exemplo n.º 6
0
 public function behaviors()
 {
     parent::behaviors();
     return array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior'));
 }
Exemplo n.º 7
0
 public function behaviors()
 {
     $behaviors = array();
     if ($this->logUserActivity && Yii::app() instanceof CWebApplication) {
         //audit trail behavior
         $behaviors['AuditTrailBehavior'] = array('class' => 'application.modules.users.components.behaviors.AuditTrailBehavior');
     }
     return array_merge(parent::behaviors(), $behaviors);
 }
Exemplo n.º 8
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('RecordLimitBehavior' => array('class' => 'RecordLimitBehavior', 'limit' => Yii::app()->settings->triggerLogMax, 'timestampField' => 'triggeredAt')));
 }
 /**
  * Returns the behaviors used for the model
  *
  * @return array
  * @see AuditModule::modelMap
  */
 public function behaviors()
 {
     $audit = Yii::app()->getModule('audit');
     if (!empty($audit->modelMap[get_class($this)]['behaviors'])) {
         return $audit->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
Exemplo n.º 10
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('X2LinkableBehavior' => array('class' => 'X2LinkableBehavior', 'module' => 'users', 'viewRoute' => '/profile'), 'ERememberFiltersBehavior' => array('class' => 'application.components.ERememberFiltersBehavior', 'defaults' => array(), 'defaultStickOnClear' => false)));
 }
Exemplo n.º 11
0
 /**
  * Returns the behaviors used for the model
  * @return array
  * @see EmailModule::modelMap
  */
 public function behaviors()
 {
     $email = Yii::app()->getModule('email');
     if (!empty($email->modelMap[get_class($this)]['behaviors'])) {
         return $email->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
Exemplo n.º 12
0
 /**
  * Translates model labels and adds language after labels of fields generated by Multilingual behaviors.
  *
  * @param CActiveRecord $model the model to which the labels belong to.
  * @param array $labels the untranslated labels
  * @param string $messageFile the message file to use to do the translation
  * 
  * @return array the translated labels
  */
 public static function multilangLabels($model, $labels, $messageFile = 'admin')
 {
     $behaviors = $model->behaviors();
     $localizedAttributes = array();
     foreach ($behaviors as $behavior) {
         if ($behavior['class'] == 'application.components.behaviors.MultilingualBehavior') {
             foreach ($behavior['localizedAttributes'] as $attribute) {
                 if (!in_array($attribute, $localizedAttributes)) {
                     $localizedAttributes[] = $attribute;
                 }
             }
         }
         if ($behavior['class'] == 'application.components.behaviors.MultilangVirtualAttributesBehavior') {
             foreach ($behavior['attributes'] as $attribute) {
                 if (!in_array($attribute, $localizedAttributes)) {
                     $localizedAttributes[] = $attribute;
                 }
             }
         }
     }
     foreach ($localizedAttributes as $attribute) {
         foreach (Yii::app()->languageManager->languages as $language => $fullLanguage) {
             $labels[$attribute . '_' . $language] = $labels[$attribute] . ' (' . Yii::t($messageFile, $fullLanguage) . ')';
         }
     }
     return $labels;
 }
Exemplo n.º 13
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'refreshTime', 'updateAttribute' => 'refreshTime')));
 }
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('CSaveRelationsBehavior' => array('class' => 'CSaveRelationsBehavior'), 'TimestampBehavior' => array('class' => 'TimestampBehavior')));
 }
Exemplo n.º 15
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('i18n-columns' => array('class' => 'I18nColumnsBehavior', 'translationAttributes' => array('title', 'slug'))));
 }
Exemplo n.º 16
0
 public function behaviors()
 {
     return array_merge(array('attrsChangeHandler' => array('class' => 'AttrsChangeHandlerBehavior', 'track' => array('album_id')), 'UpdateDateBehavior' => array('class' => 'UpdateDateBehavior', 'fields' => array('create' => array('created'), 'update' => array('update')))), parent::behaviors());
 }
Exemplo n.º 17
0
 /**
  * @return array attached behaviors.
  */
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('audit' => array('class' => 'AuditBehavior')));
 }
Exemplo n.º 18
0
 public function behaviors()
 {
     return CMap::mergeArray(parent::behaviors(), array('deletable' => array('class' => 'common.extensions.behaviors.DeletableBehavior')));
 }
Exemplo n.º 19
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('savedRelated' => array('class' => 'vendor.schmunk42.relation.behaviors.GtcSaveRelationsBehavior')));
 }
 /**
  * Returns the behaviors used for the model
  * @return array
  * @see AccountModule::modelMap
  */
 public function behaviors()
 {
     /** @var AccountModule $account */
     $account = Yii::app()->getModule('account');
     if (!empty($account->modelMap[get_class($this)]['behaviors'])) {
         return $account->modelMap[get_class($this)]['behaviors'];
     }
     return parent::behaviors();
 }
Exemplo n.º 21
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), [JsonBehavior::CLASS => ['class' => JsonBehavior::CLASS, 'jsonAttributes' => ['dataStore' => 'data']]]);
 }
Exemplo n.º 22
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array());
 }
Exemplo n.º 23
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('savedRelated' => array('class' => 'gii-template-collection.components.CSaveRelationsBehavior')));
 }
Exemplo n.º 24
0
 public function behaviors()
 {
     return CMap::mergeArray(parent::behaviors(), array('imageBehavior' => array('class' => 'ImageBehavior', 'image' => 'image', 'field' => 'avatar', 'params' => param('images/user')), 'dateBehavior' => array('class' => 'DateBehavior', 'createAttribute' => 'created', 'updateAttribute' => 'changed'), 'userSearch' => ['class' => 'core.modules.user.behaviors.UserSearchBehavior'], 'withRelated' => array('class' => 'core.behaviors.WithRelatedBehavior'), 'filters' => ['class' => 'core.behaviors.FilterBehavior']));
 }
Exemplo n.º 25
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('JSONFieldsBehavior' => array('class' => 'application.components.JSONFieldsBehavior', 'transformAttributes' => array('layout'))));
 }
Exemplo n.º 26
0
 public function behaviors()
 {
     return \CMap::mergeArray(parent::behaviors(), array('DAO' => '\\app\\components\\behaviors\\DAO', 'validationError' => '\\app\\components\\behaviors\\ValidationError'));
 }
Exemplo n.º 27
0
 public function behaviors()
 {
     parent::behaviors();
     return array('sluggable' => array('class' => 'ext.behaviors.models.SluggableBehavior', 'columns' => array('title'), 'unique' => 'true', 'update' => 'true'), 'CTimestampBehavior' => array('class' => 'zii.behaviors.CTimestampBehavior', 'createAttribute' => 'create_time', 'updateAttribute' => 'update_time', 'setUpdateOnCreate' => true), 'tree' => array('class' => 'ext.yiiext.behaviors.model.trees.NestedSetBehavior', 'rootAttribute' => 'parent_id', 'leftAttribute' => 'lft', 'rightAttribute' => 'rgt', 'levelAttribute' => 'level', 'hasManyRoots' => true));
 }
Exemplo n.º 28
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('X2LinkableBehavior' => array('class' => 'X2LinkableBehavior', 'module' => 'workflow'), 'JSONFieldsDefaultValuesBehavior' => array('class' => 'application.components.JSONFieldsDefaultValuesBehavior', 'transformAttributes' => array('colors' => array('first' => 'c4f455', 'last' => 'f18c1c')), 'maintainCurrentFieldsOrder' => true)));
 }
Exemplo n.º 29
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('savedRelated' => array('class' => '\\GtcSaveRelationsBehavior')));
 }
Exemplo n.º 30
0
 public function behaviors()
 {
     return array_merge(parent::behaviors(), array('CommonFieldsBehavior' => array('class' => 'application.components.behaviors.CommonFieldsBehavior')));
 }