2015-12-28 10:59:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class SanitizerBuilder {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @desc provide sanitizer for a given node type
|
|
|
|
*
|
|
|
|
* @param $type
|
|
|
|
* @return NodeSanitizer
|
|
|
|
*/
|
|
|
|
static public function createFromType( $type ) {
|
|
|
|
switch ( $type ) {
|
|
|
|
case 'data':
|
|
|
|
return new NodeDataSanitizer();
|
|
|
|
case 'horizontal-group-content':
|
|
|
|
return new NodeHorizontalGroupSanitizer();
|
|
|
|
case 'title':
|
|
|
|
return new NodeTitleSanitizer();
|
|
|
|
case 'image':
|
|
|
|
return new NodeImageSanitizer();
|
|
|
|
case 'hero-mobile':
|
2016-04-04 11:49:48 +00:00
|
|
|
case 'hero-mobile-wikiamobile':
|
2015-12-28 10:59:53 +00:00
|
|
|
return new NodeHeroImageSanitizer();
|
|
|
|
default:
|
|
|
|
return new PassThroughSanitizer();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|