225 $label->setDefaultValue(
Loc::getMessage(
'REPORT_WIDGET_DEFAULT_TITLE'));
226 $label->addAssets(array(
227 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')
229 $label->setIsDisplayLabel(
false);
236 $colorPicker->setDefaultValue(
'#ffffff');
239 $previewBlockField->setWidget($widgetHandler->
getWidget());
240 $previewBlockField->addJsEventListener($previewBlockField, $previewBlockField::JS_EVENT_ON_VIEW_SELECT, array(
241 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
242 'action' =>
'viewTypeSelect'
245 $previewBlockField->addJsEventListener($label, $label::JS_EVENT_ON_CHANGE, array(
246 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
247 'action' =>
'reloadWidgetPreview'
249 $previewBlockField->addJsEventListener($timePeriod, $timePeriod::JS_EVENT_ON_SELECT, array(
250 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
251 'action' =>
'reloadWidgetPreview'
254 $previewBlockField->addAssets(array(
255 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/previewblock.js')
257 $titleContainer =
new Div();
258 $titleContainer->addClass(
'report-configuration-row');
259 $titleContainer->addClass(
'report-configuration-no-padding-bottom');
260 $titleContainer->addClass(
'report-configuration-row-white-background');
261 $titleContainer->addClass(
'report-configuration-row-margin-bottom');
262 $widgetHandler->addFormElement($titleContainer->start());
263 $widgetHandler->addFormElement($label);
264 $widgetHandler->addFormElement($colorPicker);
265 $widgetHandler->addFormElement($titleContainer->end());
267 $timePeriodContainer =
new Div();
268 $timePeriodContainer->addClass(
'report-configuration-row');
269 $timePeriodContainer->addClass(
'report-configuration-row-white-background');
270 $widgetHandler->addFormElement($timePeriodContainer->start());
271 $widgetHandler->addFormElement($timePeriod);
272 $widgetHandler->addFormElement($timePeriodContainer->end());
274 $previewBlockContainer =
new Div();
275 $previewBlockContainer->addClass(
'report-configuration-row');
276 $previewBlockContainer->addClass(
'report-configuration-row-margin-top-big');
277 $previewBlockContainer->addClass(
'report-configuration-row-white-background');
278 $widgetHandler->addFormElement($previewBlockContainer->start());
279 $widgetHandler->addFormElement($previewBlockField);
280 $widgetHandler->addFormElement($previewBlockContainer->end());
291 $headContainer =
new Div();
292 $headContainer->addAssets(array(
293 'css' => array(
'/bitrix/js/report/css/visualconstructor/configheader.css')
296 $widgetHandler = $reportHandler->getWidgetHandler();
297 $previewBlock = $widgetHandler->getFormElement(
'view_type');
299 $headContainer->
setKey(
'head_container');
300 $headContainer->addClass(
'report-configuration-head');
301 $labelColorContainer =
new Div();
302 $labelColorContainer->setKey(
'label_color_container');
303 $labelColorContainer->addClass(
'report-configuration-row');
307 $labelField->setIsDisplayLabel(
false);
308 $labelField->addAssets(array(
309 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/reporttitle.js')
311 $previewBlock->addJsEventListener($labelField, $labelField::JS_EVENT_ON_CHANGE, array(
312 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
313 'action' =>
'reloadWidgetPreview'
317 $colorField->setDefaultValue(
'#4fc3f7');
318 $colorField->addAssets(array(
319 'js' => array(
'/bitrix/js/report/js/visualconstructor/fields/colorfield.js')
321 $colorField->addJsEventListener($colorField, $colorField::JS_EVENT_ON_SELECT, array(
322 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.ColorField',
323 'action' =>
'selectColorInConfigurationForm'
326 if ($reportHandler->getConfiguration(
'color'))
328 $headContainer->addInlineStyle(
'background-color', $reportHandler->getConfiguration(
'color')->getValue());
332 $reportHandlersCount = count($reportHandler->getWidgetHandler()->getReportHandlers());
334 $headContainer->addInlineStyle(
'background-color', $colorDefaultValue);
335 $colorField->setValue($colorDefaultValue);
338 $previewBlock->addJsEventListener($colorField, $colorField::JS_EVENT_ON_SELECT, array(
339 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
340 'action' =>
'reloadWidgetPreview'
343 $container->addDataAttribute(
'role',
'report-remove-button');
344 $removeButton =
new ComplexHtml(
'report-remove-button-' . $reportHandler->getReport()->getGId(),
'<div class="report-remove-button"></div>');
345 $removeButton->addJsEventListener($removeButton, $removeButton::JS_EVENT_ON_CLICK, array(
346 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.ReportHandlerSelect',
347 'action' =>
'removeReportFromConfiguration'
349 $previewBlock->addJsEventListener($removeButton, $removeButton::JS_EVENT_ON_CLICK, array(
350 'class' =>
'BX.Report.VisualConstructor.FieldEventHandlers.PreviewBlock',
351 'action' =>
'reloadWidgetPreview'
354 $container->addElement($removeButton);
355 $headContainerStart = $headContainer->start();
356 $headContainerEnd = $headContainer->end();
357 $containerStartElement = $labelColorContainer->start();
358 $containerEndElement = $labelColorContainer->end();
360 $reportHandler->addFormElementToStart($headContainerStart);
361 $reportHandler->addFormElementAfter($containerStartElement, $headContainerStart);
362 $reportHandler->addFormElementAfter($labelField, $containerStartElement);
363 $reportHandler->addFormElementAfter($colorField, $labelField);
364 $reportHandler->addFormElementAfter($container, $colorField);
365 $reportHandler->addFormElementAfter($containerEndElement, $container);
366 $reportHandler->addFormElementAfter($headContainerEnd, $containerEndElement);