Backend\Widgets\ReportContainer

Overview

ReportContainer Widget creates an area hosting report widgets.

Extends

Public Properties

public string $context

context is a unique name that defines the context where the container is used. Widget settings are saved in a specific context. This allows to have multiple report containers on different pages that have different widgets and widget settings. Context names can contain only Latin letters.

public bool $showReorder

showReorder allows the user to reorder the widgets.

public bool $showConfigure

showConfigure allows the user to configure the widgets.

public bool $showAddRemove

showAddRemove determines whether widgets could be added and deleted.

public bool $showMakeDefault

showMakeDefault displays the "Make Default" button.

public array $defaultWidgets

defaultWidgets to load. This structure could be defined in the widget configuration file, (for example config_report_container.yaml), example YAML structure:

defaultWidgets: trafficOverview: class: RainLab\GoogleAnalytics\ReportWidgets\TrafficOverview sortOrder: 1 configuration: title: 'Traffic overview' ocWidgetWidth: 12

public $canAddAndDelete

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

protected array $reportWidgets

reportWidgets used by this container.

protected boolean $reportsDefined

reportsDefined determines if report widgets have been created.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public addWidget()

public addWidget($widget, $size): void

public bindToController()

public bindToController(): void 

bindToController ensures report widgets are registered so they can also be bound to the controller this allows their AJAX features to operate.

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public onAddWidget()

public onAddWidget(): void

public onLoadAddPopup()

public onLoadAddPopup(): void

public onMakeLayoutDefault()

public onMakeLayoutDefault(): void

public onRemoveWidget()

public onRemoveWidget(): void

public onResetWidgets()

public onResetWidgets(): void

public onSetWidgetOrders()

public onSetWidgetOrders(): void

public onUpdateWidget()

public onUpdateWidget(): void

public render()

public render(): void

render this widget along with its collection of report widgets.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected defineReportWidgets()

protected defineReportWidgets(): void

defineReportWidgets registers the report widgets that will be included in this container. The chosen widgets are based on the user preferences.

protected findWidgetByAlias()

protected findWidgetByAlias($alias): void

protected getSystemParametersKey()

protected getSystemParametersKey(): void

protected getUserPreferencesKey()

protected getUserPreferencesKey(): void

protected getWidgetPropertyConfig()

protected getWidgetPropertyConfig($widget): void

protected getWidgetPropertyValues()

protected getWidgetPropertyValues($widget): void

protected getWidgetsFromUserPreferences()

protected getWidgetsFromUserPreferences(): void

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

protected makeReportWidget()

protected makeReportWidget(string $alias, array $widgetInfo): array 

makeReportWidget makes a single report widget object, returned array index:

protected removeWidget()

protected removeWidget($alias): void

protected resetWidgets()

protected resetWidgets(): void

protected resetWidgetsUserPreferences()

protected resetWidgetsUserPreferences(): void

protected saveWidgetProperties()

protected saveWidgetProperties($alias, $properties): void

protected setWidgetsToUserPreferences()

protected setWidgetsToUserPreferences($widgets): void

Show inherited protected methods

Inherited Protected Methods