<?php
namespace Moto\Application\Pages\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Zend\InputFilter\Exception; class PageProperties extends AbstractInputFilter { protected $_name = 'pages.change:properties'; public function init() { $this->add(new PagePropertiesMeta(), 'meta'); $this->add(new PagePropertiesMenu(), 'menu'); $this->add(new PagePropertiesBlocks(), 'blocks'); $this->add(new PagePropertiesCustomCode(), 'custom_code'); $this->add(array( 'name' => 'template', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 200, ), ), ), )); $this->add(array( 'name' => 'password', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StringTrim'), array('name' => 'Moto\Filter\Base64Encode'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 100, ), ), ), )); $featureMedia = new AbstractInputFilter(); $featureMedia->add(array( 'name' => 'src', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 300, ), ), ), )); $featureMedia->add(array( 'name' => 'alt', 'required' => false, 'filters' => array( array('name' => 'Moto\Filter\NullValue'), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 200, ), ), ), )); $featureMedia->add(array( 'name' => 'type', 'required' => false, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), array( 'name' => 'Moto\Filter\DefaultFilter', 'options' => array( 'value' => "image" ) ), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 8, ), ), ), )); $featureMedia->add(array( 'name' => 'title', 'required' => false, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 200, ), ), ), )); $this->add($featureMedia, 'feature_media'); $this->add(array( 'name' => 'show_comments', 'required' => false, 'filters' => array( array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); } } 