19 private $batchKey =
null;
20 private $group =
null;
21 private $buttons = [];
22 private $disabled =
false;
23 private $stepperEnabled =
false;
24 private $stepperIds = [];
25 private $limited =
false;
26 private $limitComponentParams = [];
27 private $isExternal =
false;
28 private $externalUrl =
"";
29 private $isSliderSupport =
true;
31 private $setOptionsCallback;
32 private ?
string $sliderLoader =
null;
34 public function __construct(
string $boardId =
'', array $options = [])
36 $this->options = $options;
43 'bitrix:report.analytics.config.control',
68 $this->title = $title;
76 return $this->boardKey;
84 $this->boardKey = $boardKey;
92 return $this->machineKey ?: $this->boardKey;
100 $this->machineKey = $machineKey;
108 return $this->filter;
116 $this->filter = $filter;
124 return $this->batchKey;
132 $this->batchKey = $batchKey;
140 return $this->batchKey !==
null;
148 $this->buttons[] = $button;
166 foreach ($buttons as $button)
168 $result[
'html'] .= $button->process()->getHtml();
169 foreach ($button->getJsList() as $jsPath)
171 $result[
'assets'][
'js'][] = $jsPath;
174 foreach ($button->getCssList() as $cssPath)
176 $result[
'assets'][
'css'][] = $cssPath;
179 foreach ($button->getStringList() as $string)
181 $result[
'assets'][
'string'][] = $string;
193 return $this->buttons;
201 return $this->disabled;
209 $this->disabled = $disabled;
215 'ID' =>
'crm-analytics',
216 'VIEW_TARGET' =>
null,
218 [
'zones' => [
'com.br'],
'id' =>
'58',
'lang' =>
'br',
'sec' =>
'k6be5r'],
219 [
'zones' => [
'es'],
'id' =>
'60',
'lang' =>
'la',
'sec' =>
'1shpig'],
220 [
'zones' => [
'de'],
'id' =>
'62',
'lang' =>
'de',
'sec' =>
'dj2q8l'],
221 [
'zones' => [
'ua'],
'id' =>
'66',
'lang' =>
'ua',
'sec' =>
't5y7px'],
222 [
'zones' => [
'ru',
'kz',
'by'],
'id' =>
'68',
'lang' =>
'ru',
'sec' =>
'h6thh2'],
223 [
'zones' => [
'en'],
'id' =>
'64',
'lang' =>
'en',
'sec' =>
'776ire'],
239 return $this->stepperEnabled;
244 return $this->stepperIds;
249 $this->stepperIds =$stepperIds;
256 $this->stepperEnabled = $stepperEnabled;
261 return $this->limited;
264 private function getLimitComponentOptions()
266 return $this->limitComponentParams;
271 $componentParams = $this->getLimitComponentOptions();
272 if (!isset($componentParams[
'NAME']))
276 return $componentParams[
'NAME'];
281 $componentOptions = $this->getLimitComponentOptions();
282 if (!isset($componentOptions[
'TEMPLATE_NAME']))
286 return $componentOptions[
'TEMPLATE_NAME'];
291 $componentOptions = $this->getLimitComponentOptions();
292 if (!isset($componentOptions[
'PARAMS']))
296 return $componentOptions[
'PARAMS'];
299 public function setLimit($limitComponentParams, $limit =
false)
301 $this->limitComponentParams = $limitComponentParams;
302 $this->limited = $limit;
310 return $this->isExternal;
326 return $this->externalUrl;
334 $this->externalUrl = $externalUrl;
342 return $this->isSliderSupport;
355 return $this->sliderLoader;
360 $this->sliderLoader = $sliderLoader;
367 return 'bitrix:report.analytics.empty';
375 return 'bitrix:report.visualconstructor.board.base';
398 'IS_DEFAULT_MODE_DEMO' =>
false,
399 'IS_BOARD_DEFAULT' =>
true,
429 $this->group = $group;
435 foreach ($this->options as $optionFields)
437 if ($optionFields[
'NAME'] === $optionName)
446 throw new SystemException(
"Unknown option {$optionName} for the board {$this->boardKey}");
449 if (!is_callable($this->setOptionsCallback))
451 throw new SystemException(
"setOptionsCallback is not callable for the board {$this->boardKey}");
454 call_user_func($this->setOptionsCallback, $optionName, !$optionFields[
'VALUE']);
459 $this->setOptionsCallback = $cb;
464 return $this->options;
setStepperIds($stepperIds=[])
setSliderSupport(bool $isSliderSupport)
setExternal(bool $isExternal)
toggleOption(string $optionName)
getLimitComponentParams()
setStepperEnabled($stepperEnabled)
setFilter(Filter $filter)
getDisplayComponentName()
registerSetOptionsCallback(callable $cb)
addButton(BoardButton $button)
setLimit($limitComponentParams, $limit=false)
getDisplayComponentParams()
setMachineKey($machineKey)
getLimitComponentTemplateName()
__construct(string $boardId='', array $options=[])
getDisplayComponentTemplate()
setExternalUrl(string $externalUrl)
setSliderLoader(string $sliderLoader)