You are here

class GoogleAnalyticsReportsGoogleAnalyticsViewsWizard in Google Analytics Reports 7.3

Tests creating Google Analytics views with the wizard.

Hierarchy

Expanded class hierarchy of GoogleAnalyticsReportsGoogleAnalyticsViewsWizard

1 string reference to 'GoogleAnalyticsReportsGoogleAnalyticsViewsWizard'
google_analytics.inc in plugins/views_wizard/google_analytics.inc

File

plugins/views_wizard/google_analytics_reports_google_analytics_views_wizard.class.php, line 11
Definition of GoogleAnalyticsReportsGoogleAnalyticsViewsWizard.

View source
class GoogleAnalyticsReportsGoogleAnalyticsViewsWizard extends ViewsUiBaseViewsWizard {

  /**
   * @override
   */
  protected function default_display_options($form, $form_state) {
    $display_options = parent::default_display_options($form, $form_state);

    // Add permission-based access control.
    $display_options['access']['type'] = 'perm';
    $display_options['access']['perm'] = 'access google analytics reports';

    // Remove the default fields, since we are customizing them here.
    unset($display_options['fields']);

    // Add the title field.

    /* Field: Page tracking: Page Title */
    $display_options['fields']['pageTitle']['id'] = 'pageTitle';
    $display_options['fields']['pageTitle']['table'] = 'google_analytics';
    $display_options['fields']['pageTitle']['field'] = 'pageTitle';
    $display_options['fields']['pageTitle']['label'] = '';
    $display_options['fields']['pageTitle']['element_label_colon'] = FALSE;

    // Remove the default filters, since we are customizing them here.
    unset($display_options['filters']);

    /* Filter criterion: Google Analytics: Start date of report */
    $display_options['filters']['start_date']['id'] = 'start_date';
    $display_options['filters']['start_date']['table'] = 'google_analytics';
    $display_options['filters']['start_date']['field'] = 'start_date';
    $display_options['filters']['start_date']['value']['value'] = '-31 day';
    $display_options['filters']['start_date']['value']['type'] = 'offset';
    $display_options['filters']['start_date']['group'] = 1;
    $display_options['filters']['start_date']['expose']['operator'] = FALSE;

    /* Filter criterion: Google Analytics: End date of report */
    $display_options['filters']['end_date']['id'] = 'end_date';
    $display_options['filters']['end_date']['table'] = 'google_analytics';
    $display_options['filters']['end_date']['field'] = 'end_date';
    $display_options['filters']['end_date']['value']['value'] = '-1 day';
    $display_options['filters']['end_date']['value']['type'] = 'offset';
    $display_options['filters']['end_date']['group'] = 1;
    $display_options['filters']['end_date']['expose']['operator'] = FALSE;
    return $display_options;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
GoogleAnalyticsReportsGoogleAnalyticsViewsWizard::default_display_options protected function @override Overrides ViewsUiBaseViewsWizard::default_display_options
ViewsUiBaseViewsWizard::$base_table protected property
ViewsUiBaseViewsWizard::$entity_info protected property
ViewsUiBaseViewsWizard::$entity_type protected property
ViewsUiBaseViewsWizard::$filter_defaults protected property
ViewsUiBaseViewsWizard::$plugin protected property
ViewsUiBaseViewsWizard::$validated_views protected property
ViewsUiBaseViewsWizard::add_displays protected function Add the array of display options to the view, with appropriate overrides.
ViewsUiBaseViewsWizard::alter_display_options protected function Alter the full array of display options before they are added to the view.
ViewsUiBaseViewsWizard::block_display_options protected function 2
ViewsUiBaseViewsWizard::build_display_options protected function Build an array of display options for the view.
ViewsUiBaseViewsWizard::build_filters protected function Build the part of the form that allows the user to select the filters.
ViewsUiBaseViewsWizard::build_form function For AJAX callbacks to build other elements in the "show" form. Overrides ViewsWizardInterface::build_form
ViewsUiBaseViewsWizard::build_form_style protected function Build the part of the form that builds the display format options. 2
ViewsUiBaseViewsWizard::build_sorts protected function Build the part of the form that allows the user to select the sort order.
ViewsUiBaseViewsWizard::create_view function Create a View from values that have been already submitted to validate(). Overrides ViewsWizardInterface::create_view
ViewsUiBaseViewsWizard::default_display_filters protected function
ViewsUiBaseViewsWizard::default_display_filters_user protected function
ViewsUiBaseViewsWizard::default_display_sorts protected function
ViewsUiBaseViewsWizard::default_display_sorts_user protected function
ViewsUiBaseViewsWizard::instantiate_view protected function
ViewsUiBaseViewsWizard::page_display_options protected function 2
ViewsUiBaseViewsWizard::page_feed_display_options protected function
ViewsUiBaseViewsWizard::retrieve_validated_view protected function
ViewsUiBaseViewsWizard::row_style_options protected function Add possible row style options. 2
ViewsUiBaseViewsWizard::set_default_options protected function Sets options for a display and makes them the default options if possible.
ViewsUiBaseViewsWizard::set_override_options protected function Sets options for a display, inheriting from the defaults when possible.
ViewsUiBaseViewsWizard::set_validated_view protected function
ViewsUiBaseViewsWizard::validate function Instantiates a view and validates values. Overrides ViewsWizardInterface::validate
ViewsUiBaseViewsWizard::__construct function Constructor. Overrides ViewsWizardInterface::__construct