00001 <?php
00002
00003
00004
00005
00006
00007
00008 class WidgetSorter implements IWidget {
00009 const DONT_INDEX_SORTED = 2048;
00010 const DONT_CHANGE_TITLE = 4096;
00011
00012 public $data;
00013
00014 public static function output($data, $policy = self::NONE) {
00015 $w = new WidgetSorter($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 if (Arr::get_item($this->data, 'columns_total', 0) < 2) {
00025 return '';
00026 }
00027
00028 $policy = $policy | ($this->data['policy'] * 2048);
00029
00030 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'widgets/sorter.meta');
00031 $view->assign('sorter_data', $this->data);
00032 $view->assign('page_data', $this->data['page_data']);
00033 $view->assign('policy', $policy);
00034 $view->render();
00035
00036 $view = ViewFactory::create_view(IViewFactory::MESSAGE, 'core::widgets/sorter');
00037 $view->assign('sorter_data', $this->data);
00038 $view->assign('page_data', $this->data['page_data']);
00039 $view->assign('policy', $policy);
00040 return $view->render();
00041 }
00042 }