.

WidgetPager Class Reference
[View]

Renders a pager. More...

Inheritance diagram for WidgetPager:
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_ADD_BREADCRUMB = 8192
const  DONT_CHANGE_TITLE = 4096
const  DONT_INDEX_PAGE_2PP = 2048
const  HIDE_INACTIVE_LINKS = 128
const  NO_FORCE_TOTAL_LINKS = 1024
const  NO_PAGE_X_OF_N = 512
const  NO_STRIP = 256

Detailed Description

Renders a pager.

Author:
Gerd Riesselmann

Definition at line 308 of file pager.widget.php.


Constructor & Destructor Documentation

WidgetPager::__construct ( data  ) 

Definition at line 324 of file pager.widget.php.

00324                                            {
00325                 $this->data = $data;
00326         }

Member Function Documentation

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

Definition at line 319 of file pager.widget.php.

00319                                                                  {
00320                 $w = new WidgetPager($data);
00321                 return $w->render($policy);
00322         }
WidgetPager::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 328 of file pager.widget.php.

00328                                                    {
00329                 if (Arr::get_item($this->data, 'pages_total', 0) <= 1) {
00330                         return '';
00331                 }
00332                 
00333                 $policy = $policy | ($this->data['policy'] * 2048); // Compatability
00334                 $calculator = Arr::get_item($this->data, 'calculator', Config::get_value(Config::PAGER_CALCULATOR));
00335                 if (!$calculator instanceof WidgetPagerCalculator) {
00336                         $calculator = new WidgetPagerCalculator();
00337                 }
00338                 
00339                 $calculator->set_data($this->data);
00340                 $calculator->set_policy($policy);
00341                 
00342                 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/pager.meta');
00343                 $view->assign('pager_calculator', $calculator);
00344                 $view->assign('page_data', $this->data['page_data']);
00345                 $view->render(); // this view should not return anything! 
00346                 
00347                 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/pager.breadcrumb');
00348                 $view->assign('pager_calculator', $calculator);
00349                 $view->assign('page_data', $this->data['page_data']);
00350                 $view->render(); // this view should not return anything! 
00351                                         
00352                 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/pager');
00353                 $view->assign('pager_calculator', $calculator);
00354                 $view->assign('page_data', $this->data['page_data']);
00355                 return $view->render();
00356         }

Member Data Documentation

WidgetPager::$data

Definition at line 317 of file pager.widget.php.

Definition at line 315 of file pager.widget.php.

Definition at line 314 of file pager.widget.php.

Definition at line 313 of file pager.widget.php.

Definition at line 309 of file pager.widget.php.

Definition at line 312 of file pager.widget.php.

Definition at line 311 of file pager.widget.php.

const WidgetPager::NO_STRIP = 256

Definition at line 310 of file pager.widget.php.


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