Piwik\Plugin\Visualization::getClientSideParametersToSet PHP Метод

getClientSideParametersToSet() защищенный Метод

This array defines things such as: - name of the module & action to call to request data for this table - optional filters information, eg. filter_limit and filter_offset - etc. The values are loaded: - from the generic filters that are applied by default @see Piwik\API\DataTableGenericFilter::getGenericFiltersInformation() - from the values already available in the GET array - from the values set using methods from this class (eg. setSearchPattern(), setLimit(), etc.)
protected getClientSideParametersToSet ( ) : array
Результат array eg. array('show_offset_information' => 0, 'show_...
    protected function getClientSideParametersToSet()
    {
        // build javascript variables to set
        $javascriptVariablesToSet = array();
        foreach ($this->config->custom_parameters as $name => $value) {
            $javascriptVariablesToSet[$name] = $value;
        }
        foreach ($_GET as $name => $value) {
            try {
                $requestValue = Common::getRequestVar($name);
            } catch (\Exception $e) {
                $requestValue = '';
            }
            $javascriptVariablesToSet[$name] = $requestValue;
        }
        foreach ($this->requestConfig->clientSideParameters as $name) {
            if (isset($javascriptVariablesToSet[$name])) {
                continue;
            }
            $valueToConvert = false;
            if (property_exists($this->requestConfig, $name)) {
                $valueToConvert = $this->requestConfig->{$name};
            } elseif (property_exists($this->config, $name)) {
                $valueToConvert = $this->config->{$name};
            }
            if (false !== $valueToConvert) {
                $javascriptVariablesToSet[$name] = $this->getIntIfValueIsBool($valueToConvert);
            }
        }
        $javascriptVariablesToSet['module'] = $this->config->controllerName;
        $javascriptVariablesToSet['action'] = $this->config->controllerAction;
        if (!isset($javascriptVariablesToSet['viewDataTable'])) {
            $javascriptVariablesToSet['viewDataTable'] = static::getViewDataTableId();
        }
        if ($this->dataTable && !$this->dataTable instanceof DataTable\Map && empty($javascriptVariablesToSet['totalRows'])) {
            $javascriptVariablesToSet['totalRows'] = $this->dataTable->getMetadata(DataTable::TOTAL_ROWS_BEFORE_LIMIT_METADATA_NAME) ?: $this->dataTable->getRowsCount();
        }
        $deleteFromJavascriptVariables = array('filter_excludelowpop', 'filter_excludelowpop_value');
        foreach ($deleteFromJavascriptVariables as $name) {
            if (isset($javascriptVariablesToSet[$name])) {
                unset($javascriptVariablesToSet[$name]);
            }
        }
        $rawSegment = \Piwik\API\Request::getRawSegmentFromRequest();
        if (!empty($rawSegment)) {
            $javascriptVariablesToSet['segment'] = $rawSegment;
        }
        return $javascriptVariablesToSet;
    }