.

WidgetBlock Class Reference
[View]

A widget printing a named block upon actions retrieved from given item. More...

Inheritance diagram for WidgetBlock:
IWidget IRenderer

List of all members.

Public Member Functions

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

Static Public Member Functions

static  output ($page_data, $position= '')
  Output Blocks.
static  render_blocks ($arr_blocks, $position=false)
static  retrieve ($name, $page_data, $route_id= '', $position=false, $weight=false, $more_params=array())
  Retrieves named block and stores it in page data.

Public Attributes

  $page_data
  $position

Detailed Description

A widget printing a named block upon actions retrieved from given item.

Author:
Gerd Riesselmann

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


Constructor & Destructor Documentation

WidgetBlock::__construct ( page_data,
position  
)

Definition at line 67 of file block.widget.php.

00067                                                            {
00068                 $this->position = $position;
00069                 $this->page_data = $page_data;
00070         }

Member Function Documentation

static WidgetBlock::output ( page_data,
position = ''  
) [static]

Output Blocks.

Parameters:
PageData  $page_data
string  $position
Returns:
string

Definition at line 62 of file block.widget.php.

00062                                                                   {
00063                 $w = new WidgetBlock($page_data, $position);
00064                 return $w->render();
00065         }
WidgetBlock::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 72 of file block.widget.php.

00072                                                    {
00073                 $this->page_data->sort_blocks();
00074                 $arr_blocks = $this->page_data->get_blocks($this->position);
00075                 return self::render_blocks($arr_blocks, $this->position);       
00076         }
static WidgetBlock::render_blocks ( arr_blocks,
position = false  
) [static]

Definition at line 48 of file block.widget.php.

00048                                                                              {
00049                 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/blocks');
00050                 $view->assign('blocks', $arr_blocks);
00051                 $view->assign('position', $position);
00052                 return $view->render();
00053         }
static WidgetBlock::retrieve ( name,
page_data,
route_id = '',
position = false,
weight = false,
more_params = array()  
) [static]

Retrieves named block and stores it in page data.

Parameters:
string  $name
PageData  $page_data
string  $route_id
Returns:
void

Definition at line 30 of file block.widget.php.

00030                                                                                                                                        {
00031                 $params = array(
00032                         'name' => $name,
00033                         'route_id' => $route_id
00034                 );
00035                 $params = array_merge($more_params, $params);
00036                 
00037                 $result = array();
00038                 EventSource::Instance()->invoke_event('block', $params, $result);
00039                 
00040                 if ($page_data) {
00041                         foreach($result as $block) {
00042                                 $page_data->add_block($block, $position, $weight);      
00043                         }
00044                 }
00045                 return $result;
00046         }

Member Data Documentation

WidgetBlock::$page_data

Definition at line 20 of file block.widget.php.

WidgetBlock::$position

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


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