gyro/core/view/widgets/filtertext.widget.php
Go to the documentation of this file.00001 <?php 00002 /** 00003 * A widget printing text filter 00004 * 00005 * @author Gerd Riesselmann 00006 * @ingroup View 00007 */ 00008 class WidgetFilterText implements IWidget { 00009 const DONT_INDEX_FILTERED = 2048; 00010 const DONT_CHANGE_TITLE = 4096; 00011 00012 public $data; 00013 00014 public static function output($data, $policy = self::NONE) { 00015 $w = new WidgetFilterText($data); 00016 return $w->render($policy); 00017 } 00018 00019 public function __construct($data) { 00020 $this->data = $data; 00021 } 00022 00023 public function render($policy = self::NONE) { 00024 $out = ''; 00025 foreach (Arr::force($this->data, false) as $item) { 00026 $adapter = Arr::get_item($item, 'adapter', false); 00027 if (empty($adapter)) { 00028 continue; 00029 } 00030 00031 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/filtertext.meta'); 00032 $view->assign_array($item); 00033 $view->assign('policy', $policy); 00034 $view->render(); // No output! 00035 00036 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/filtertext'); 00037 $view->assign_array($item); 00038 $view->assign('policy', $policy); 00039 $out .= $view->render(); 00040 } 00041 return $out; 00042 } 00043 }