shouldLoadExpanded() public static method

Returns whether the DataTable result will have to be expanded for the current request before rendering.
public static shouldLoadExpanded ( ) : boolean
return boolean
コード例 #1
0
ファイル: Request.php プロジェクト: bossrabbit/piwik
 /**
  * @return array  URL to call the API, eg. "method=Referrers.getKeywords&period=day&date=yesterday"...
  */
 public function getRequestArray()
 {
     // we prepare the array to give to the API Request
     // we setup the method and format variable
     // - we request the method to call to get this specific DataTable
     // - the format = original specifies that we want to get the original DataTable structure itself, not rendered
     $requestArray = array('method' => $this->requestConfig->apiMethodToRequestDataTable, 'format' => 'original');
     $toSetEventually = array('filter_limit', 'keep_summary_row', 'filter_sort_column', 'filter_sort_order', 'filter_excludelowpop', 'filter_excludelowpop_value', 'filter_column', 'filter_pattern', 'flat', 'expanded', 'pivotBy', 'pivotByColumn', 'pivotByColumnLimit');
     foreach ($toSetEventually as $varToSet) {
         $value = $this->getDefaultOrCurrent($varToSet);
         if (false !== $value) {
             $requestArray[$varToSet] = $value;
         }
     }
     $segment = ApiRequest::getRawSegmentFromRequest();
     if (!empty($segment)) {
         $requestArray['segment'] = $segment;
     }
     if (ApiRequest::shouldLoadExpanded()) {
         $requestArray['expanded'] = 1;
     }
     $requestArray = array_merge($requestArray, $this->requestConfig->request_parameters_to_modify);
     if (!empty($requestArray['filter_limit']) && $requestArray['filter_limit'] === 0) {
         unset($requestArray['filter_limit']);
     }
     if ($this->requestConfig->disable_generic_filters) {
         $requestArray['disable_generic_filters'] = '1';
     }
     if ($this->requestConfig->disable_queued_filters) {
         $requestArray['disable_queued_filters'] = 1;
     }
     return $requestArray;
 }
コード例 #2
0
ファイル: Base.php プロジェクト: piwik/piwik
 protected function addBaseDisplayProperties(ViewDataTable $view)
 {
     $view->config->datatable_js_type = 'ActionsDataTable';
     $view->config->search_recursive = true;
     $view->config->show_table_all_columns = false;
     $view->requestConfig->filter_limit = Actions::ACTIONS_REPORT_ROWS_DISPLAY;
     $view->config->show_all_views_icons = false;
     if ($view->isViewDataTableId(HtmlTable::ID)) {
         $view->config->show_embedded_subtable = true;
     }
     if (Request::shouldLoadExpanded()) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->show_expanded = true;
         }
         $view->config->filters[] = function ($dataTable) {
             Actions::setDataTableRowLevels($dataTable);
         };
     }
     $view->config->filters[] = function ($dataTable) use($view) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->datatable_css_class = 'dataTableActions';
         }
     };
 }
コード例 #3
0
 private function addBaseDisplayProperties(ViewDataTable $view)
 {
     $view->config->datatable_js_type = 'ActionsDataTable';
     $view->config->search_recursive = true;
     $view->config->show_table_all_columns = false;
     $view->requestConfig->filter_limit = self::ACTIONS_REPORT_ROWS_DISPLAY;
     $view->config->show_all_views_icons = false;
     if ($view->isViewDataTableId(HtmlTable::ID)) {
         $view->config->show_embedded_subtable = true;
     }
     // if the flat parameter is not provided, make sure it is set to 0 in the URL,
     // so users can see that they can set it to 1 (see #3365)
     $view->config->custom_parameters = array('flat' => 0);
     if (Request::shouldLoadExpanded()) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->show_expanded = true;
         }
         $view->config->filters[] = function ($dataTable) {
             Actions::setDataTableRowLevels($dataTable);
         };
     }
     $view->config->filters[] = function ($dataTable) use($view) {
         if ($view->isViewDataTableId(HtmlTable::ID)) {
             $view->config->datatable_css_class = 'dataTableActions';
         }
     };
 }