1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
resultview.php
См. документацию.
1<?php
8namespace Bitrix\Sender\Connector;
9
10use Bitrix\Main\ArgumentException;
11use Bitrix\Sender\UI\PageNavigation;
12
19{
20 const Title = 'title';
21 const Draw = 'draw';
22 const Filter = 'filter';
23 const FilterModifier = 'filter-modifier';
24 const ColumnModifier = 'column-modifier';
25
27 protected $connector;
28
30 protected $callbacks;
31
33 protected $nav;
34
40 public function __construct(Base $connector)
41 {
42 $this->connector = $connector;
43 }
44
53 public function setCallback($name, $callable)
54 {
55 if (!is_callable($callable))
56 {
57 throw new ArgumentException('Parameter \'callable\' should be callable.');
58 }
59
60 $this->callbacks[$name] = $callable;
61
62 return $this;
63 }
64
65 protected function runCallback($name, array $arguments = [])
66 {
67 if (!isset($this->callbacks[$name]))
68 {
69 return null;
70 }
71
72 return call_user_func_array($this->callbacks[$name], $arguments);
73 }
74
80 public function getTitle()
81 {
82 return $this->runCallback(self::Title) ?: $this->connector->getName();
83 }
84
91 public function modifyFilter(array &$filter)
92 {
93 $this->runCallback(self::FilterModifier, [&$filter]);
94 }
95
102 public function modifyColumns(array &$columns)
103 {
104 $this->runCallback(self::ColumnModifier, [&$columns]);
105 }
106
113 public function setNav(PageNavigation $nav = null)
114 {
115 $this->nav = $nav;
116 return $this;
117 }
118
124 public function getNav()
125 {
126 return $this->nav;
127 }
128
134 public function hasNav()
135 {
136 return !empty($this->nav);
137 }
138
144 public function onFilter()
145 {
146 $this->runCallback(self::Filter);
147 }
148
155 public function onDraw(array &$raw)
156 {
157 $this->runCallback(self::Draw, [&$raw]);
158 }
159}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$filter
Определения iblock_catalog_list.php:54
$name
Определения menu_edit.php:35
onDraw(array &$raw)
Определения resultview.php:155
const Draw
Определения resultview.php:21
modifyFilter(array &$filter)
Определения resultview.php:91
__construct(Base $connector)
Определения resultview.php:40
const ColumnModifier
Определения resultview.php:24
const FilterModifier
Определения resultview.php:23
setCallback($name, $callable)
Определения resultview.php:53
Class ResultView
Определения resultview.php:19
getTitle()
Определения resultview.php:80
setNav(PageNavigation $nav=null)
Определения resultview.php:113
runCallback($name, array $arguments=[])
Определения resultview.php:65
modifyColumns(array &$columns)
Определения resultview.php:102