.

WidgetFilter Class Reference
[View]

A widget printing filters. More...

Inheritance diagram for WidgetFilter:
IWidget IRenderer

List of all members.

Public Member Functions

  __construct ($data)
  render ($policy=self::NONE)
  Renders what should be rendered.

Static Public Member Functions

static  output ($data, $policy=self::NONE)

Public Attributes

  $data
const  DONT_CHANGE_TITLE = 4096
const  DONT_INDEX_FILTERED = 2048

Detailed Description

A widget printing filters.

Author:
Gerd Riesselmann

Definition at line 8 of file filter.widget.php.


Constructor & Destructor Documentation

WidgetFilter::__construct ( data  ) 

Definition at line 19 of file filter.widget.php.

00019                                            {
00020                 $this->data = $data;
00021         }

Member Function Documentation

static WidgetFilter::output ( data,
policy = self::NONE  
) [static]

Definition at line 14 of file filter.widget.php.

00014                                                                  {
00015                 $w = new WidgetFilter($data);
00016                 return $w->render($policy);
00017         }
WidgetFilter::render ( policy = self::NONE  ) 

Renders what should be rendered.

Parameters:
int  $policy Defines how to render, meaning depends on implementation
Returns:
string The rendered content

Implements IRenderer.

Definition at line 23 of file filter.widget.php.

00023                                                    {
00024                 $builder = Arr::get_item($this->data, 'filter_url_builder', false);
00025                 $page_data = Arr::get_item($this->data, 'page_data', false);
00026                 if (empty($builder) || empty($page_data)) {
00027                         return '';
00028                 }
00029                 
00030                 $groups = Arr::force(Arr::get_item($this->data, 'filter_groups', array()));
00031                 $ret = '';
00032                 foreach($groups as $group) {
00033                         $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'core::widgets/filter.meta');
00034                         $view->assign('filter_group', $group);
00035                         $view->assign('page_data', $page_data);
00036                         $view->assign('policy', $policy);
00037                         $view->render(); // No output!
00038                         
00039                         $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'core::widgets/filter');
00040                         $view->assign('filter_group', $group);
00041                         $view->assign('filter_url_builder', $builder);
00042                         $view->assign('page_data', $page_data);
00043                         $view->assign('policy', $policy);
00044                         $ret .= $view->render();
00045                 }
00046                 if ($ret) {
00047                         $ret = html::div($ret, 'filter_groups');
00048                 }
00049                 return $ret;
00050         }

Member Data Documentation

WidgetFilter::$data

Definition at line 12 of file filter.widget.php.

Definition at line 10 of file filter.widget.php.

Definition at line 9 of file filter.widget.php.


The documentation for this class was generated from the following file: