apiUrl = $apiUrl; $this->init($args); } /** * Initialize the handler with config parameters * * @param array $args Configuration params */ public function init($args = []) { foreach ($args as $key => $value) { if (property_exists($this, $key)) { $this->{$key} = $value; } } } /** * Retrieve the configuration data to be used when initializing this * handler on the frontend * * @return array Configuration data */ public function getConfig() { $config = [ 'apiUrl' => $this->apiUrl, 'tableColumns' => $this->tableColumns, 'dateStart' => $this->dateStart, 'dateStartMin' => PKPStatisticsHelper::STATISTICS_EARLIEST_DATE, 'dateEnd' => $this->dateEnd, 'dateEndMax' => date('Y-m-d', strtotime('yesterday')), 'dateRangeOptions' => $this->dateRangeOptions, 'activeFilters' => [], 'isLoadingItems' => false, 'isSidebarVisible' => false, ]; if ($this->filters) { $config['filters'] = $this->filters; } return $config; } }