<?php
namespace Moto\InputFilter\ClickAction; use Moto; class Taxonomy extends Moto\InputFilter\AbstractInputFilter { public function init() { $this->add(array( 'name' => 'id', 'required' => true, 'filters' => array(), 'validators' => array( array( 'name' => 'Digits', 'break_chain_on_failure' => true, ), array( 'name' => 'Db\RecordExists', 'options' => array( 'table' => Moto\Config::get('database.prefix') . 'content_taxonomies', 'field' => 'id', 'adapter' => Moto\Config::get('databaseAdapter'), ) ) ), )); $this->add(array( 'name' => 'target', 'required' => false, 'continue_if_empty' => true, 'filters' => array( array( 'name' => 'Moto\Filter\DefaultFilter', 'options' => array( 'value' => '_self' ) ), array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array('_self', '_blank') ) ), ), )); $this->add(array( 'name' => 'nofollow', 'required' => false, 'filters' => array( array( 'name' => 'Moto\Filter\DefaultFilter', 'options' => array( 'value' => false ) ), array('name' => 'Boolean'), ), 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array(false, true) ) ), ), )); $this->add(array( 'name' => 'anchor', 'required' => false, 'filters' => array( array('name' => 'StripTags'), array('name' => 'StringTrim'), ), 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, 'max' => 200, ), ), ), )); } } 