PHP 클래스 Piwik\ViewDataTable\Config

**Client Side Properties** Client side properties are properties that should be passed on to the browser so client side JavaScript can use them. Only affects ViewDataTables that output HTML. **Overridable Properties** Overridable properties are properties that can be set via the query string. If a request has a query parameter that matches an overridable property, the property will be set to the query parameter value. **Reusing base properties** Many of the properties in this class only have meaning for the {@link Piwik\Plugin\Visualization} class, but can be set for other visualizations that extend {@link Piwik\Plugin\ViewDataTable} directly. Visualizations that extend {@link Piwik\Plugin\ViewDataTable} directly and want to re-use these properties must make sure the properties are used in the exact same way they are used in {@link Piwik\Plugin\Visualization}. **Defining new display properties** If you are creating your own visualization and want to add new display properties for it, extend this class and add your properties as fields. Properties are marked as client side properties by calling the {@link addPropertiesThatShouldBeAvailableClientSide()} method. Properties are marked as overridable by calling the {@link addPropertiesThatCanBeOverwrittenByQueryParams()} method. ### Example **Defining new display properties** class MyCustomVizConfig extends Config { ** * My custom property. It is overridable. *\/ public $my_custom_property = false; ** * Another custom property. It is available client side. *\/ public $another_custom_property = true; public function __construct() { parent::__construct(); $this->addPropertiesThatShouldBeAvailableClientSide(array('another_custom_property')); $this->addPropertiesThatCanBeOverwrittenByQueryParams(array('my_custom_property')); } }
파일 보기 프로젝트 열기: piwik/piwik 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$clientSideProperties The list of ViewDataTable properties that are 'Client Side Properties'.
$columns_to_display Example: array('label', 'nb_visits', 'nb_uniq_visitors') If this value is empty it will be defaulted to array('label', 'nb_visits') or array('label', 'nb_uniq_visitors') if the report contains a nb_uniq_visitors column after data is loaded.
$controllerAction
$controllerName
$custom_parameters e.g. array('typeReferrer' => ...) It can then be accessed in the twig templates by clientSideParameters.typeReferrer
$datatable_css_class CSS class to use in the output HTML div. This is added in addition to the visualization CSS class.
$datatable_js_type The JavaScript class to instantiate after the result HTML is obtained. This class handles all interactive behavior for the DataTable view.
$description The report description. eg like a goal description
$documentation Contains the documentation for a report.
$enable_sort Controls whether the user can sort DataTables by clicking on table column headings.
$export_limit Defaulted to the value of the [General] API_datatable_default_limit INI config option.
$filters Priority filters are run before queued filters. These filters should be filters that add/delete rows. If a closure is used, the view is appended as a parameter.
$footer_icons The value of this property must be an array of footer icon groups. Footer icon groups have set of properties, including an array of arrays describing footer icons. For example: array( array( // footer icon group 1 'class' => 'footerIconGroup1CssClass', 'buttons' => array( 'id' => 'myid', 'title' => 'My Tooltip', 'icon' => 'path/to/my/icon.png' ) ), array( // footer icon group 2 'class' => 'footerIconGroup2CssClass', 'buttons' => array(...) ) ) By default, when a user clicks on a footer icon, Piwik will assume the 'id' is a viewDataTable ID and try to reload the DataTable w/ the new viewDataTable. You can provide your own footer icon behavior by adding an appropriate handler via DataTable.registerFooterIconHandler in your JavaScript code. The default value of this property is not set here and will show the 'Normal Table' icon, the 'All Columns' icon, the 'Goals Columns' icon and all jqPlot graph columns, unless other properties tell the view to exclude them.
$hide_annotations_view Controls whether annotations are shown or not.
$metrics_documentation E.g. array('nb_visits' => '...', ...) By default this is set to values retrieved from report metadata (via API.getReportMetadata API method).
$overridableProperties The list of ViewDataTable properties that can be overriden by query parameters.
$pivot_by_column The column to display in pivot tables. Defaults to the first non-label column if not specified.
$pivot_by_dimension The ID of the dimension to pivot by when the 'pivot by subtable' option is clicked. Defaults to the subtable dimension of the report being displayed.
$pivot_dimension_name The human readable name of the pivot dimension.
$related_reports Related reports are listed below a datatable view. When clicked, the original report will change to the clicked report and the list will change so the original report can be navigated back to.
$related_reports_title "Related Reports" is displayed by default before listing the Related reports, The string can be changed.
$report_id
$search_recursive If true, searching through the DataTable will search through all subtables.
$self_url The URL used to request the report without generic filters.
$show_all_views_icons Controls whether graph and non core viewDataTable footer icons are shown or not.
$show_as_content_block boolean If enabled, shows the visualization as a content block. This is similar to wrapping your visualization with a
$show_bar_chart Controls whether the footer icon that allows users to view data as a bar chart is shown.
$show_ecommerce Controls whether the 'Ecoommerce Orders'/'Abandoned Cart' footer icons are shown or not.
$show_exclude_low_population Controls whether the 'Exclude Low Population' option (visible in the popup that displays after clicking the 'cog' icon) is shown.
$show_export_as_image_icon Controls whether to show the 'Export as Image' footer icon.
$show_export_as_rss_feed Controls whether the user is allowed to export data as an RSS feed or not.
$show_flatten_table Whether to show the 'Flatten' option (visible in the popup that displays after clicking the 'cog' icon).
$show_footer Controls whether the entire view footer is shown.
$show_footer_icons Controls whether the row that contains all footer icons & the limit selector is shown.
$show_footer_message Stores an HTML message (if any) to display under the datatable view.
$show_goals Controls whether the goals footer icon is shown.
$show_insights Controls whether the 'insights' footer icon is shown.
$show_limit_control Normally shown only if pagination is enabled.
$show_offset_information Controls whether offset information (ie, '5-10 of 20') is shown under the datatable.
$show_pagination_control Controls whether the 'prev'/'next' links are shown in the DataTable footer. These links change the 'filter_offset' query parameter, thus allowing pagination.
$show_pie_chart Controls whether the footer icon that allows users to view data as a pie chart is shown.
$show_pivot_by_subtable Whether to show the 'Pivot by subtable' option (visible in the popup that displays after clicking the 'cog' icon).
$show_related_reports Controls whether a report's related reports are listed with the view or not.
$show_search Controls whether the search box under the datatable is shown.
$show_table Controls whether the footer icon that allows users to switch to the 'normal' DataTable view is shown.
$show_table_all_columns Controls whether the 'All Columns' footer icon is shown.
$show_tag_cloud Controls whether the footer icon that allows users to view data as a tag cloud is shown.
$show_title boolean If enabled shows the title of the report.
$show_visualization_only Controls whether the buttons and UI controls around the visualization or shown or if just the visualization alone is shown.
$subtable_controller_action By default, this is set to the controller action used to request the report.
$title This must be set if related reports are added.
$title_edit_entity_url string If a URL is set, the title of the report will be clickable. Is supposed to be set for entities that can be configured (edited) such as goal. Eg when there is a goal report, and someone is allowed to edit the goal entity, a link is supposed to be with a URL to the edit goal form.
$tooltip_metadata_name Row metadata name that contains the tooltip for the specific row.
$translations The default value for this property is set elsewhere. It will contain translations of common metrics.
$y_axis_unit The unit of the displayed column. Valid if only one non-label column is displayed.

공개 메소드들

메소드 설명
__construct ( ) Constructor.
addPropertiesThatCanBeOverwrittenByQueryParams ( array $propertyNames ) Marks display properties as overridable. Read this to learn more.
addPropertiesThatShouldBeAvailableClientSide ( array $propertyNames ) Marks display properties as client side properties. Read this to learn more.
addRelatedReport ( string $relatedReport, string $title, array $queryParams = [] ) Adds a related report to the {@link $related_reports} property. If the report references the one that is currently being displayed, it will not be added to the related report list.
addRelatedReports ( array $relatedReports ) Adds several related reports to the {@link $related_reports} property. If any of the reports references the report that is currently being displayed, it will not be added to the list. All other reports will still be added though.
addTranslation ( string $columnName, string $translation ) Associates internationalized text with a metric. Overwrites existing mappings.
addTranslations ( array $translations ) Associates multiple translations with metrics.
disablePivotBySubtableIfTableHasNoSubtables ( DataTable $table )
getPresentationFilters ( )
getPriorityFilters ( )
getProperties ( ) : array Returns array of all property values in this config object. Property values are mapped by name.
removeColumnToDisplay ( $columnToRemove )
setController ( $controllerName, $controllerAction )
setDefaultColumnsToDisplay ( $columns, $hasNbVisits, $hasNbUniqVisitors )

비공개 메소드들

메소드 설명
getFiltersToRun ( )
loadDocumentation ( ) Load documentation from the API
setShouldShowPivotBySubtable ( )

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( )

addPropertiesThatCanBeOverwrittenByQueryParams() 공개 메소드

Marks display properties as overridable. Read this to learn more.
public addPropertiesThatCanBeOverwrittenByQueryParams ( array $propertyNames )
$propertyNames array List of property names, eg, `array('show_limit_control', 'show_goals')`.

addPropertiesThatShouldBeAvailableClientSide() 공개 메소드

Marks display properties as client side properties. Read this to learn more.
public addPropertiesThatShouldBeAvailableClientSide ( array $propertyNames )
$propertyNames array List of property names, eg, `array('show_limit_control', 'show_goals')`.

addRelatedReport() 공개 메소드

Adds a related report to the {@link $related_reports} property. If the report references the one that is currently being displayed, it will not be added to the related report list.
public addRelatedReport ( string $relatedReport, string $title, array $queryParams = [] )
$relatedReport string The plugin and method of the report, eg, `'DevicesDetection.getBrowsers'`.
$title string The report's display name, eg, `'Browsers'`.
$queryParams array Any extra query parameters to set in releated report's URL, eg, `array('idGoal' => 'ecommerceOrder')`.

addRelatedReports() 공개 메소드

If you need to make sure the related report URL has some extra query parameters, use {@link addRelatedReport()}.
public addRelatedReports ( array $relatedReports )
$relatedReports array Array mapping report IDs with their internationalized display titles, eg, ``` array( 'DevicesDetection.getBrowsers' => 'Browsers', 'Resolution.getConfiguration' => 'Configurations' ) ```

addTranslation() 공개 메소드

See {@link $translations}.
public addTranslation ( string $columnName, string $translation )
$columnName string The name of a column in the report data, eg, `'nb_visits'` or `'goal_1_nb_conversions'`.
$translation string The internationalized text, eg, `'Visits'` or `"Conversions for 'My Goal'"`.

addTranslations() 공개 메소드

See {@link $translations} and {@link addTranslation()}.
public addTranslations ( array $translations )
$translations array An array of column name => text mappings, eg, ``` array( 'nb_visits' => 'Visits', 'goal_1_nb_conversions' => "Conversions for 'My Goal'" ) ```

disablePivotBySubtableIfTableHasNoSubtables() 공개 메소드

public disablePivotBySubtableIfTableHasNoSubtables ( DataTable $table )
$table Piwik\DataTable

getPresentationFilters() 공개 메소드

getPriorityFilters() 공개 메소드

public getPriorityFilters ( )

getProperties() 공개 메소드

Returns array of all property values in this config object. Property values are mapped by name.
public getProperties ( ) : array
리턴 array eg, `array('show_limit_control' => 0, 'show_goals' => 1, ...)`

removeColumnToDisplay() 공개 메소드

public removeColumnToDisplay ( $columnToRemove )

setController() 공개 메소드

public setController ( $controllerName, $controllerAction )

setDefaultColumnsToDisplay() 공개 메소드

public setDefaultColumnsToDisplay ( $columns, $hasNbVisits, $hasNbUniqVisitors )

프로퍼티 상세

$clientSideProperties 공개적으로 프로퍼티

The list of ViewDataTable properties that are 'Client Side Properties'.
public $clientSideProperties

$columns_to_display 공개적으로 프로퍼티

Example: array('label', 'nb_visits', 'nb_uniq_visitors') If this value is empty it will be defaulted to array('label', 'nb_visits') or array('label', 'nb_uniq_visitors') if the report contains a nb_uniq_visitors column after data is loaded.
public $columns_to_display

$controllerAction 공개적으로 프로퍼티

public $controllerAction

$controllerName 공개적으로 프로퍼티

public $controllerName

$custom_parameters 공개적으로 프로퍼티

e.g. array('typeReferrer' => ...) It can then be accessed in the twig templates by clientSideParameters.typeReferrer
public $custom_parameters

$datatable_css_class 공개적으로 프로퍼티

CSS class to use in the output HTML div. This is added in addition to the visualization CSS class.
public $datatable_css_class

$datatable_js_type 공개적으로 프로퍼티

The JavaScript class to instantiate after the result HTML is obtained. This class handles all interactive behavior for the DataTable view.
public $datatable_js_type

$description 공개적으로 프로퍼티

The report description. eg like a goal description
public $description

$documentation 공개적으로 프로퍼티

Contains the documentation for a report.
public $documentation

$enable_sort 공개적으로 프로퍼티

Controls whether the user can sort DataTables by clicking on table column headings.
public $enable_sort

$export_limit 공개적으로 프로퍼티

Defaulted to the value of the [General] API_datatable_default_limit INI config option.
public $export_limit

$filters 공개적으로 프로퍼티

Priority filters are run before queued filters. These filters should be filters that add/delete rows. If a closure is used, the view is appended as a parameter.
public $filters

$hide_annotations_view 공개적으로 프로퍼티

Controls whether annotations are shown or not.
public $hide_annotations_view

$metrics_documentation 공개적으로 프로퍼티

E.g. array('nb_visits' => '...', ...) By default this is set to values retrieved from report metadata (via API.getReportMetadata API method).
public $metrics_documentation

$overridableProperties 공개적으로 프로퍼티

The list of ViewDataTable properties that can be overriden by query parameters.
public $overridableProperties

$pivot_by_column 공개적으로 프로퍼티

The column to display in pivot tables. Defaults to the first non-label column if not specified.
public $pivot_by_column

$pivot_by_dimension 공개적으로 프로퍼티

The ID of the dimension to pivot by when the 'pivot by subtable' option is clicked. Defaults to the subtable dimension of the report being displayed.
public $pivot_by_dimension

$pivot_dimension_name 공개적으로 프로퍼티

The human readable name of the pivot dimension.
public $pivot_dimension_name

$report_id 공개적으로 프로퍼티

public $report_id

$search_recursive 공개적으로 프로퍼티

If true, searching through the DataTable will search through all subtables.
public $search_recursive

$self_url 공개적으로 프로퍼티

The URL used to request the report without generic filters.
public $self_url

$show_all_views_icons 공개적으로 프로퍼티

Controls whether graph and non core viewDataTable footer icons are shown or not.
public $show_all_views_icons

$show_as_content_block 공개적으로 프로퍼티

If enabled, shows the visualization as a content block. This is similar to wrapping your visualization with a
public bool $show_as_content_block
리턴 boolean

$show_bar_chart 공개적으로 프로퍼티

Controls whether the footer icon that allows users to view data as a bar chart is shown.
public $show_bar_chart

$show_ecommerce 공개적으로 프로퍼티

Controls whether the 'Ecoommerce Orders'/'Abandoned Cart' footer icons are shown or not.
public $show_ecommerce

$show_exclude_low_population 공개적으로 프로퍼티

Controls whether the 'Exclude Low Population' option (visible in the popup that displays after clicking the 'cog' icon) is shown.
public $show_exclude_low_population

$show_export_as_image_icon 공개적으로 프로퍼티

Controls whether to show the 'Export as Image' footer icon.
public $show_export_as_image_icon

$show_export_as_rss_feed 공개적으로 프로퍼티

Controls whether the user is allowed to export data as an RSS feed or not.
public $show_export_as_rss_feed

$show_flatten_table 공개적으로 프로퍼티

Whether to show the 'Flatten' option (visible in the popup that displays after clicking the 'cog' icon).
public $show_flatten_table

$show_goals 공개적으로 프로퍼티

Controls whether the goals footer icon is shown.
public $show_goals

$show_insights 공개적으로 프로퍼티

Controls whether the 'insights' footer icon is shown.
public $show_insights

$show_limit_control 공개적으로 프로퍼티

Normally shown only if pagination is enabled.
public $show_limit_control

$show_offset_information 공개적으로 프로퍼티

Controls whether offset information (ie, '5-10 of 20') is shown under the datatable.
public $show_offset_information

$show_pagination_control 공개적으로 프로퍼티

Controls whether the 'prev'/'next' links are shown in the DataTable footer. These links change the 'filter_offset' query parameter, thus allowing pagination.
public $show_pagination_control

$show_pie_chart 공개적으로 프로퍼티

Controls whether the footer icon that allows users to view data as a pie chart is shown.
public $show_pie_chart

$show_pivot_by_subtable 공개적으로 프로퍼티

Whether to show the 'Pivot by subtable' option (visible in the popup that displays after clicking the 'cog' icon).
public $show_pivot_by_subtable

$show_table 공개적으로 프로퍼티

Controls whether the footer icon that allows users to switch to the 'normal' DataTable view is shown.
public $show_table

$show_table_all_columns 공개적으로 프로퍼티

Controls whether the 'All Columns' footer icon is shown.
public $show_table_all_columns

$show_tag_cloud 공개적으로 프로퍼티

Controls whether the footer icon that allows users to view data as a tag cloud is shown.
public $show_tag_cloud

$show_title 공개적으로 프로퍼티

If enabled shows the title of the report.
public bool $show_title
리턴 boolean

$show_visualization_only 공개적으로 프로퍼티

Controls whether the buttons and UI controls around the visualization or shown or if just the visualization alone is shown.
public $show_visualization_only

$subtable_controller_action 공개적으로 프로퍼티

By default, this is set to the controller action used to request the report.
public $subtable_controller_action

$title 공개적으로 프로퍼티

This must be set if related reports are added.
public $title

$title_edit_entity_url 공개적으로 프로퍼티

If a URL is set, the title of the report will be clickable. Is supposed to be set for entities that can be configured (edited) such as goal. Eg when there is a goal report, and someone is allowed to edit the goal entity, a link is supposed to be with a URL to the edit goal form.
public string $title_edit_entity_url
리턴 string

$tooltip_metadata_name 공개적으로 프로퍼티

Row metadata name that contains the tooltip for the specific row.
public $tooltip_metadata_name

$translations 공개적으로 프로퍼티

The default value for this property is set elsewhere. It will contain translations of common metrics.
public $translations

$y_axis_unit 공개적으로 프로퍼티

The unit of the displayed column. Valid if only one non-label column is displayed.
public $y_axis_unit