public function Init() { parent::Init(); $this->aValidateRules[] = array('category_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_categories_create_title_title'), 'on' => array('receptiondesk_category')); $this->aValidateRules[] = array('category_description', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_categories_create_description_title'), 'on' => array('receptiondesk_category')); $this->aValidateRules[] = array('category_title', 'category_title_exists', 'on' => array('receptiondesk_category')); $this->aValidateRules[] = array('category_url', 'category_url_exists', 'on' => array('receptiondesk_category')); }
/** * Инициализация */ public function Init() { parent::Init(); $this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.user.complaint_text_max'), 'min' => 1, 'allowEmpty' => !Config::Get('module.user.complaint_text_required'), 'label' => $this->Lang_Get('user_complaint_text_title')); if (Config::Get('module.user.complaint_captcha')) { $sCaptchaValidateType = func_camelize('captcha_' . Config::Get('sys.captcha.type')); $this->aValidateRules[] = array('captcha', $sCaptchaValidateType, 'name' => 'complaint_user'); } }
public function Init() { parent::Init(); $this->aValidateRules[] = array('question_category_id', 'question_category_id', 'on' => array('receptiondesk_question', 'receptiondesk_question_edit')); $this->aValidateRules[] = array('question_text', 'string', 'max' => Config::Get('plugin.receptiondesk.receptiondesk_question_text_max_length'), 'min' => 2, 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_text_title'), 'on' => array('receptiondesk_question', 'receptiondesk_question_edit')); $this->aValidateRules[] = array('question_text_hash', 'question_text_hash', 'on' => array('receptiondesk_question')); $this->aValidateRules[] = array('question_author_mail', 'email', 'allowEmpty' => Config::Get('plugin.receptiondesk.receptiondesk_create_mail_empty'), 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_author_mail_title'), 'on' => array('receptiondesk_question')); $this->aValidateRules[] = array('question_captcha', 'captcha', 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_question_create_author_captcha_title'), 'on' => array('receptiondesk_question')); $this->aValidateRules[] = array('answer_text', 'string', 'min' => 2, 'allowEmpty' => true, 'label' => $this->Lang_Get('plugin.receptiondesk.receptiondesk_admin_answer_create_text_title'), 'on' => array('receptiondesk_question')); }
public function Init() { parent::Init(); if (!$this->GetSourceType()) { $this->SetSourceType(); } if (!$this->GetSmarty()) { $this->SetSmarty($this->Viewer_GetSmartyObject()); } }
/** * Определяем правила валидации */ public function Init() { parent::Init(); $this->aValidateRules[] = array('topic_title', 'string', 'max' => Config::Get('module.topic.title_max_length'), 'min' => Config::Get('module.topic.title_min_length'), 'allowEmpty' => Config::Get('module.topic.title_allow_empty'), 'label' => $this->Lang_Get('topic.add.fields.title.label')); $this->aValidateRules[] = array('topic_slug_raw', 'regexp', 'allowEmpty' => true, 'pattern' => '#^[a-z0-9\\-]{1,500}$#i'); $this->aValidateRules[] = array('topic_text_source', 'string', 'max' => Config::Get('module.topic.max_length'), 'min' => Config::Get('module.topic.min_length'), 'allowEmpty' => Config::Get('module.topic.allow_empty'), 'condition' => 'isNeedValidateText', 'label' => $this->Lang_Get('topic.add.fields.text.label')); $this->aValidateRules[] = array('topic_tags', 'tags', 'countMax' => 15, 'condition' => 'isNeedValidateTags', 'label' => $this->Lang_Get('topic.add.fields.tags.label'), 'allowEmpty' => Config::Get('module.topic.allow_empty_tags')); $this->aValidateRules[] = array('blogs_id_raw', 'blogs'); $this->aValidateRules[] = array('topic_text_source', 'topic_unique'); $this->aValidateRules[] = array('topic_slug_raw', 'slug_check'); }
/** * Define of validation rule */ public function Init() { parent::Init(); $this->aValidateRules[] = array('topic_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('topic_create_title'), 'on' => array('topic')); $this->aValidateRules[] = array('question_title', 'string', 'max' => 200, 'min' => 2, 'allowEmpty' => true, 'label' => E::ModuleLang()->Get('topic_create_question_title'), 'on' => array('topic')); $this->aValidateRules[] = array('topic_text_source', 'string', 'max' => Config::Get('module.topic.max_length'), 'min' => 2, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('topic_create_text'), 'on' => array('topic')); $this->aValidateRules[] = array('topic_tags', 'tags', 'count' => 15, 'allowEmpty' => Config::Get('module.topic.allow_empty_tags'), 'label' => E::ModuleLang()->Get('topic_create_tags'), 'on' => array('topic')); $this->aValidateRules[] = array('blog_id', 'blog_id', 'on' => array('topic')); $this->aValidateRules[] = array('topic_text_source', 'topic_unique', 'on' => array('topic')); $this->aValidateRules[] = array('topic_type', 'topic_type', 'on' => array('topic')); $this->aValidateRules[] = array('link_url', 'url', 'allowEmpty' => true, 'label' => E::ModuleLang()->Get('topic_link_create_url'), 'on' => array('topic')); }
/** * Определяем правила валидации * Правила валидации нужно определять только здесь! * * @var array */ public function Init() { parent::Init(); $this->aValidateRules[] = array('login', 'login', 'on' => array('registration', '')); $this->aValidateRules[] = array('login', 'login_exists', 'on' => array('registration')); $this->aValidateRules[] = array('mail', 'email', 'allowEmpty' => false, 'on' => array('registration', '')); $this->aValidateRules[] = array('mail', 'mail_exists', 'on' => array('registration')); $this->aValidateRules[] = array('password', 'password', 'on' => array('registration')); $this->aValidateRules[] = array('password_confirm', 'compare', 'compareField' => 'password', 'on' => array('registration')); // Определяем дополнительные правила валидации if (Config::Get('module.user.captcha_use_registration')) { $this->aValidateRules[] = array('captcha', 'captcha', 'on' => array('registration')); } }
public function Init() { parent::Init(); $this->aCfg = Config::GetData('module.captcha'); $this->Reset(); }
public function Init() { parent::Init(); $this->aValidateRules[] = array('subscription_mail', 'email', 'allowEmpty' => false, 'label' => $this->Lang_Get('plugin.subscription.subscription_block_subscription_input'), 'on' => array('subscription_mail')); }
/** * Инициализация */ public function Init() { parent::Init(); $this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.user.usernote_text_max'), 'min' => 1, 'allowEmpty' => false); }
/** * Инициализация */ public function Init() { parent::Init(); $this->aValidateRules[] = array('text', 'string', 'max' => Config::Get('module.wall.text_max'), 'min' => Config::Get('module.wall.text_min'), 'allowEmpty' => false, 'on' => array('', 'add')); }
public function Init() { parent::Init(); $this->aValidateRules[] = array('type_code', 'string', 'min' => 2, 'max' => 10, 'allowEmpty' => false, 'label' => E::ModuleLang()->Get('action.admin.blogtypes_typecode'), 'on' => array('add')); }
/** * Инициализация */ public function Init() { parent::Init(); $this->aBehaviors['category']['validate_require'] = !Config::Get('module.blog.category_allow_empty'); $this->aBehaviors['category']['validate_only_without_children'] = Config::Get('module.blog.category_only_without_children'); }