<?php
namespace Moto\Application\Settings\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Moto; class FeedbackSettings extends AbstractInputFilter { protected $_name = 'settingsWebsite.FeedbackSettings'; public function init() { $this->add(array( 'name' => 'provider', 'required' => true, 'allow_empty' => true, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'continue_if_empty' => true, 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array('', 'none', 'MotoCallback') ) ), ), )); $options = new AbstractInputFilter(); $visibility = new AbstractInputFilter(); $visibility->add(array( 'name' => 'notFoundPage', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\IntValue'), array('name' => 'Boolean'), ) )); $visibility->add(array( 'name' => 'underConstructionPage', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\IntValue'), array('name' => 'Boolean'), ) )); $options->add($visibility, 'visibility'); $this->add($options, 'options'); $providers = new AbstractInputFilter(); $MotoCallback = new AbstractInputFilter(); $MotoCallback->add(array( 'name' => 'thumbnails', 'required' => true, )); $MotoCallback->add(array( 'name' => 'description', 'required' => true, 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 5000, ), ), ), )); $MotoCallback->add(array( 'name' => 'moreDetails', 'required' => true, )); $providers->add($MotoCallback, 'MotoCallback'); $this->add($providers, 'providers'); } } 