示例#1
0
 /**
  * Returns the Field Rules, to validate users input
  *
  * @param type $rules
  * @return type
  */
 public function getFieldRules($rules = array())
 {
     $rules[] = [$this->profileField->internal_name . "_hide_year", 'in', 'range' => [0, 1]];
     $rules[] = [$this->profileField->internal_name, \humhub\libs\DbDateValidator::className(), 'format' => Yii::$app->formatter->dateInputFormat, 'convertToFormat' => null, 'max' => time(), 'tooBig' => Yii::t('base', 'The date has to be in the past.')];
     return parent::getFieldRules($rules);
 }
示例#2
0
 /**
  * Returns the Field Rules, to validate users input
  *
  * @param type $rules
  * @return type
  */
 public function getFieldRules($rules = array())
 {
     $rules[] = [$this->profileField->internal_name . "_hide_year", 'in', 'range' => [0, 1]];
     $rules[] = [$this->profileField->internal_name, \humhub\components\validators\PastDateValidator::className()];
     return parent::getFieldRules($rules);
 }
示例#3
0
 /**
  * Returns a list of all available field type classes.
  *
  * @return Array
  */
 public function getFieldTypes()
 {
     $fieldTypes = array_merge(array(Number::className() => Yii::t('UserModule.models_ProfileFieldType', 'Number'), Text::className() => Yii::t('UserModule.models_ProfileFieldType', 'Text'), TextArea::className() => Yii::t('UserModule.models_ProfileFieldType', 'Text Area'), Select::className() => Yii::t('UserModule.models_ProfileFieldType', 'Select List'), Date::className() => Yii::t('UserModule.models_ProfileFieldType', 'Date'), DateTime::className() => Yii::t('UserModule.models_ProfileFieldType', 'Datetime'), Birthday::className() => Yii::t('UserModule.models_ProfileFieldType', 'Birthday'), CountrySelect::className() => Yii::t('UserModule.models_ProfileFieldType', 'Country')), $this->fieldTypes);
     return $fieldTypes;
 }
 /**
  * Returns the Field Rules, to validate users input
  *
  * @param type $rules
  * @return type
  */
 public function getFieldRules($rules = array())
 {
     $rules[] = array($this->profileField->internal_name . "_hide_year", 'in', 'range' => array(0, 1));
     return parent::getFieldRules($rules);
 }