diff --git a/core/ViewDataTable/Properties.php b/core/ViewDataTable/Properties.php index 4c17672b7ca..ee961659686 100644 --- a/core/ViewDataTable/Properties.php +++ b/core/ViewDataTable/Properties.php @@ -22,8 +22,6 @@ * Contains the list of all core DataTable display properties for use with ViewDataTable. * * @see ViewDataTable - for more info. - * - * TODO: list default value for each property */ class Properties { @@ -63,7 +61,9 @@ class Properties * can provide your own footer icon behavior by adding an appropriate handler via * DataTable.registerFooterIconHandler in your JavaScript. * - * Default value: // TODO + * Default value: The default value 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. */ const FOOTER_ICONS = 'footer_icons'; @@ -71,28 +71,41 @@ class Properties * Controls whether the buttons and UI controls around the visualization or shown or * if just the visualization alone is shown. * - * Default: false + * Default value: false */ const SHOW_VISUALIZATION_ONLY = 'show_visualization_only'; /** * Controls whether the goals footer icon is shown. + * + * Default value: false */ const SHOW_GOALS = 'show_goals'; /** * Array property mapping DataTable column names with their internationalized names. + * + * The value you specify for this property is merged with the default value so you + * don't have to specify translations that already exist in the default value. + * + * Default value: Array containing translations of common metrics. */ const COLUMN_NAME_TRANSLATIONS = 'translations'; /** * Controls which column to sort the DataTable by before truncating and displaying. + * + * Default value: If the report contains nb_uniq_visitors and nb_uniq_visitors is a + * displayed column, then the default value is 'nb_uniq_visitors'. + * Otherwise, it is 'nb_visits'. */ const SORTED_COLUMN = 'filter_sort_column'; /** * Controls the sort order. Either 'asc' or 'desc'. - * + * + * Default value: 'desc' + * * @see self::SORTED_COLUMN */ const SORT_ORDER = 'filter_sort_order'; @@ -100,6 +113,8 @@ class Properties /** * The number of items to truncate the data set to before rendering the DataTable view. * + * Default value: false + * * @see self::OFFSET */ const LIMIT = 'filter_limit'; @@ -107,6 +122,8 @@ class Properties /** * The number of items from the start of the data set that should be ignored. * + * Default value: 0 + * * @see self::LIMIT */ const OFFSET = 'filter_offset'; @@ -114,33 +131,45 @@ class Properties /** * Controls whether the 'Exclude Low Population' option (visible in the popup that displays after * clicking the 'cog' icon) is shown. + * + * Default value: true */ const SHOW_EXCLUDE_LOW_POPULATION = 'show_exclude_low_population'; /** * Whether to show the 'Flatten' option (visible in the popup that displays after clicking the * 'cog' icon). + * + * Default value: true */ const SHOW_FLATTEN_TABLE = 'show_flatten_table'; /** * Controls whether the footer icon that allows user to switch to the 'normal' DataTable view * is shown. + * + * Default value: true */ const SHOW_NORMAL_TABLE_VIEW = 'show_table'; /** * Controls whether the 'All Columns' footer icon is shown. + * + * Default value: true */ const SHOW_ALL_TABLE_VIEW = 'show_table_all_columns'; /** * Controls whether the entire view footer is shown. + * + * Default value: true */ const SHOW_FOOTER = 'show_footer'; /** * Controls whether the row that contains all footer icons & the limit selector is shown. + * + * Default value: true */ const SHOW_FOOTER_ICONS = 'show_footer_icons'; @@ -149,17 +178,24 @@ class Properties * should not appear in ViewDataTable visualizations. * * Example: array('label', 'nb_visits', 'nb_uniq_visitors') + * + * Default value: array('label', 'nb_visits') or array('label', 'nb_uniq_visitors') if + * the report contains a nb_uniq_visitors column. */ const COLUMNS_TO_DISPLAY = 'columns_to_display'; /** * Controls whether the footer icons that change the ViewDataTable type of a view are shown * or not. + * + * Default value: true */ const SHOW_ALL_VIEW_ICONS = 'show_all_views_icons'; /** * Controls whether to display a tiny upside-down caret over the currently active view icon. + * + * Default value: true */ const SHOW_ACTIVE_VIEW_ICON = 'show_active_view_icon'; @@ -169,6 +205,8 @@ class Properties * navigated back to. * * @see also self::TITLE. Both must be set if associating related reports. + * + * Default value: array() */ const RELATED_REPORTS = 'related_reports'; @@ -177,16 +215,22 @@ class Properties * reports. * * @see also self::RELATED_REPORTS. This must be set if related reports are added. + * + * Default value: '' */ const TITLE = 'title'; /** * Controls whether a report's related reports are listed with the view or not. + * + * Default value: true */ const SHOW_RELATED_REPORTS = 'show_related_reports'; /** * Contains the documentation for a report. + * + * Default value: false */ const REPORT_DOCUMENTATION = 'documentation'; @@ -195,6 +239,8 @@ class Properties * by ViewDataTable. * * E.g. array('idSite' => ..., 'period' => 'month') + * + * Default value: array() */ const REQUEST_PARAMETERS_TO_MODIFY = 'request_parameters_to_modify'; @@ -202,6 +248,8 @@ class Properties * A regex pattern to use to filter the DataTable before it is shown. * * @see also self::FILTER_PATTERN_COLUMN + * + * Default value: false */ const FILTER_PATTERN = 'filter_pattern'; @@ -209,6 +257,8 @@ class Properties * The column to apply a filter pattern to. * * @see also self::FILTER_PATTERN + * + * Default value: false */ const FILTER_PATTERN_COLUMN = 'filter_column'; @@ -217,6 +267,8 @@ class Properties * of a data table div. This data can be used by JavaScript DataTable classes. * * e.g. array('typeReferer' => ...) + * + * Default value: array() */ const CUSTOM_PARAMETERS = 'custom_parameters'; @@ -224,6 +276,8 @@ class Properties * Whether to run generic filters on the DataTable before rendering or not. * * @see Piwik_API_DataTableGenericFilter + * + * Default value: false */ const DISABLE_GENERIC_FILTERS = 'disable_generic_filters'; @@ -231,6 +285,8 @@ class Properties * Whether to run ViewDataTable's list of queued filters or not. * * NOTE: Priority queued filters are always run. + * + * Default value: false */ const DISABLE_QUEUED_FILTERS = 'disable_queued_filters'; @@ -239,41 +295,57 @@ class Properties * is always shown or not. * * Normally shown only if pagination is enabled. + * + * Default value: true */ const ALWAYS_SHOW_LIMIT_DROPDOWN = 'show_limit_control'; /** * Controls whether the search box under the datatable is shown. + * + * Default value: true */ const SHOW_SEARCH_BOX = 'show_search'; /** * Controls whether the user can sort DataTables by clicking on table column headings. + * + * Default value: true */ const ENABLE_SORT = 'enable_sort'; /** * Controls whether the footer icon that allows users to view data as a bar chart is shown. + * + * Default value: true */ const SHOW_BAR_CHART_ICON = 'show_bar_chart'; /** * Controls whether the footer icon that allows users to view data as a pie chart is shown. + * + * Default value: true */ const SHOW_PIE_CHART_ICON = 'show_pie_chart'; /** * Controls whether the footer icon that allows users to view data as a tag cloud is shown. + * + * Default value: true */ const SHOW_TAG_CLOUD = 'show_tag_cloud'; /** * Controls whether the user is allowed to export data as an RSS feed or not. + * + * Default value: true */ const SHOW_EXPORT_AS_RSS_FEED = 'show_export_as_rss_feed'; /** * Controls whether the 'Ecoommerce Orders'/'Abandoned Cart' footer icons are shown or not. + * + * Default value: false */ const SHOW_ECOMMERCE_FOOTER_ICONS = 'show_ecommerce'; @@ -281,6 +353,8 @@ class Properties * Stores the column name to filter when filtering out rows with low values. * * @see also self::EXCLUDE_LOW_POPULATION_VALUE + * + * Default value: false */ const EXCLUDE_LOW_POPULATION_COLUMN = 'filter_excludelowpop'; @@ -288,11 +362,15 @@ class Properties * Stores the value considered 'low' when filtering out rows w/ low values. * * @see also self::EXCLUDE_LOW_POPULATION_COLUMN + * + * Default value: false */ const EXCLUDE_LOW_POPULATION_VALUE = 'filter_excludelowpop_value'; /** * Stores an HTML message (if any) to display under the datatable view. + * + * Default value: false */ const FOOTER_MESSAGE = 'show_footer_message'; @@ -307,6 +385,8 @@ class Properties /** * Row metadata name that contains the tooltip for the specific row. + * + * Default value: false */ const TOOLTIP_METADATA_NAME = 'tooltip_metadata_name'; @@ -316,6 +396,8 @@ class Properties * of a single report when going back to the original report. * * @see also self::RELATED_REPORTS + * + * Default value: The URL used to request the report without generic filters. */ const THIS_REPORT_URL = 'self_url'; @@ -329,12 +411,16 @@ class Properties /** * CSS class to use in the output HTML div. This is added in addition to the visualization CSS * class. + * + * Default value: false */ const DATATABLE_CSS_CLASS = 'datatable_css_class'; /** * The JavaScript class to instantiate after the result HTML is obtained. This class handles all * interactive behavior for the DataTable view. + * + * Default value: 'DataTable' */ const DATATABLE_JS_TYPE = 'datatable_js_type'; @@ -342,16 +428,22 @@ class Properties * If true, searching through the DataTable will search through all subtables. * * @see also self::FILTER_PATTERN + * + * Default value: false */ const DO_RECURSIVE_SEARCH = 'search_recursive'; /** * The unit of the displayed column. Valid if only one non-label column is displayed. + * + * Default value: false */ const DISPLAYED_COLUMN_UNIT = 'y_axis_unit'; /** * Controls whether to show the 'Export as Image' footer icon. + * + * Default value: false */ const SHOW_EXPORT_AS_IMAGE_ICON = 'show_export_as_image_icon'; @@ -366,6 +458,8 @@ class Properties * add/delete rows. * * If a closure is used, the view is appended as a parameter. + * + * Default value: array() */ const FILTERS = 'filters'; @@ -378,11 +472,15 @@ class Properties * a ViewDataTable after data has been loaded. If you need to use properties that are * only set after data is loaded (like 'columns_to_display'), you'll have to use this * property. + * + * Default value: array() */ const AFTER_DATA_LOADED_FUNCTIONS = 'after_data_loaded_functions'; /** * Contains the controller action to call when requesting subtables of the current report. + * + * Default value: The controller action used to request the report. */ const SUBTABLE_CONTROLLER_ACTION = 'subtable_controller_action'; @@ -393,6 +491,8 @@ class Properties * TODO: pagination/offset is only valid for HtmlTables... should only display for those visualizations. * * @see self::SHOW_OFFSET_INFORMATION + * + * Default value: true */ const SHOW_PAGINATION_CONTROL = 'show_pagination_control'; @@ -400,21 +500,29 @@ class Properties * Controls whether offset information (ie, '5-10 of 20') is shown under the datatable. * * @see self::SHOW_PAGINATION_CONTROL + * + * Default value: true */ const SHOW_OFFSET_INFORMATION = 'show_offset_information'; /** * Controls whether annotations are shown or not. + * + * Default value: true */ const HIDE_ANNOTATIONS_VIEW = 'hide_annotations_view'; /** * The filter_limit query parameter value to use in export links. + * + * Default value: The value of the 'API_datatable_default_limit' config option. */ const EXPORT_LIMIT = 'export_limit'; /** * Controls whether non-Core DataTable visualizations are shown or not. + * + * Default value: true */ const SHOW_NON_CORE_VISUALIZATIONS = 'show_non_core_visualizations'; @@ -608,6 +716,7 @@ public static function getDefaultPropertyValues() 'show_limit_control' => true, 'show_footer' => true, 'show_footer_icons' => true, + 'show_footer_message' => false, 'show_related_reports' => true, 'show_non_core_visualizations' => true, 'export_limit' => Config::getInstance()->General['API_datatable_default_limit'], @@ -638,6 +747,7 @@ public static function getDefaultPropertyValues() 'after_data_loaded_functions' => array(), 'hide_annotations_view' => true, 'columns_to_display' => array(), + 'y_axis_unit' => false ); $columns = Common::getRequestVar('columns', false); diff --git a/core/Visualization/Graph.php b/core/Visualization/Graph.php index 46a50c49193..ead67f31696 100644 --- a/core/Visualization/Graph.php +++ b/core/Visualization/Graph.php @@ -26,16 +26,22 @@ abstract class Graph extends DataTableVisualization /** * Whether the series picker should allow picking more than one series or not. + * + * Default value: true */ const ALLOW_MULTI_SELECT_SERIES_PICKER = 'allow_multi_select_series_picker'; /** - * The maximum number of rows to renderh. All other rows will be aggregated in an 'Others' row. + * The maximum number of rows to render. All other rows will be aggregated in an 'Others' row. + * + * Default value: false (no limit) */ const MAX_GRAPH_ELEMENTS = 'max_graph_elements'; /** * Array property that contains the names of columns that can be selected in the Series Picker. + * + * Default value: false */ const SELECTABLE_COLUMNS = 'selectable_columns'; @@ -43,6 +49,8 @@ abstract class Graph extends DataTableVisualization * Contains the column (if any) of the values used in the Row Picker. * * @see self::ROWS_TO_DISPLAY + * + * Default value: false */ const ROW_PICKER_VALUE_COLUMN = 'row_picker_match_rows_by'; @@ -51,6 +59,8 @@ abstract class Graph extends DataTableVisualization * The values are of a specific column determined by the row_picker_match_rows_by column. * * @see self::ROW_PICKER_VALUE_COLUMN + * + * Default value: false */ const ROWS_TO_DISPLAY = 'rows_to_display'; @@ -64,17 +74,23 @@ abstract class Graph extends DataTableVisualization /** * Controls whether all ticks & labels are shown on a graph's x-axis or just some. + * + * Default value: false */ const SHOW_ALL_TICKS = 'show_all_ticks'; /** * If true, a row with totals of each DataTable column is added. + * + * Default value: false */ const ADD_TOTAL_ROW = 'add_total_row'; /** * Controls whether the Series Picker is shown or not. The Series Picker allows users to * choose between displaying data of different columns. + * + * Default value: true */ const SHOW_SERIES_PICKER = 'show_series_picker'; @@ -85,6 +101,8 @@ abstract class Graph extends DataTableVisualization * NOTE: Sometimes this percentage is meaningless (when the total of the column values is * not the total number of elements in the set). In this case the tooltip should not be * displayed. + * + * Default value: true */ const DISPLAY_PERCENTAGE_IN_TOOLTIP = 'display_percentage_in_tooltip'; @@ -135,7 +153,7 @@ public static function getDefaultPropertyValues() 'show_limit_control' => false, 'visualization_properties' => array( 'graph' => array( - 'add_total_row' => 0, + 'add_total_row' => false, 'show_all_ticks' => false, 'allow_multi_select_series_picker' => true, 'max_graph_elements' => false, diff --git a/plugins/CoreVisualizations/Visualizations/Cloud.php b/plugins/CoreVisualizations/Visualizations/Cloud.php index 37cd117b5d4..6b016c38c5b 100644 --- a/plugins/CoreVisualizations/Visualizations/Cloud.php +++ b/plugins/CoreVisualizations/Visualizations/Cloud.php @@ -31,6 +31,8 @@ class Cloud extends DataTableVisualization /** * Whether to display the logo assocatied with a DataTable row (stored as 'logo' row metadata) * instead of the label in Tag Clouds. + * + * Default value: false */ const DISPLAY_LOGO_INSTEAD_OF_LABEL = 'display_logo_instead_of_label'; diff --git a/plugins/CoreVisualizations/Visualizations/HtmlTable.php b/plugins/CoreVisualizations/Visualizations/HtmlTable.php index 03120461ed5..2b98761d8a4 100644 --- a/plugins/CoreVisualizations/Visualizations/HtmlTable.php +++ b/plugins/CoreVisualizations/Visualizations/HtmlTable.php @@ -42,12 +42,16 @@ class HtmlTable extends DataTableVisualization /** * Controls whether the entire DataTable should be rendered (including subtables) or just one * specific table in the tree. + * + * Default value: false */ const SHOW_EXPANDED = 'show_expanded'; /** * When showing an expanded datatable, this property controls whether rows with subtables are * replaced with their subtables, or if they are shown alongside their subtables. + * + * Default value: false */ const REPLACE_ROW_WITH_SUBTABLE = 'replace_row_with_subtable'; @@ -55,6 +59,8 @@ class HtmlTable extends DataTableVisualization * Controls whether any DataTable Row Action icons are shown. If true, no icons are shown. * * @see also self::DISABLE_ROW_EVOLUTION + * + * Default value: false */ const DISABLE_ROW_ACTIONS = 'disable_row_actions'; @@ -62,6 +68,8 @@ class HtmlTable extends DataTableVisualization * Controls whether the row evolution DataTable Row Action icon is shown or not. * * @see also self::DISABLE_ROW_ACTIONS + * + * Default value: false */ const DISABLE_ROW_EVOLUTION = 'disable_row_evolution'; @@ -69,12 +77,16 @@ class HtmlTable extends DataTableVisualization * If true, the 'label', 'nb_visits', 'nb_uniq_visitors' (if present), 'nb_actions', * 'nb_actions_per_visit', 'avg_time_on_site', 'bounce_rate' and 'conversion_rate' (if * goals view is not allowed) are displayed. + * + * Default value: false */ const SHOW_EXTRA_COLUMNS = 'show_extra_columns'; /** * If true, conversions for each existing goal will be displayed for the visits in * each row. + * + * Default value: false */ const SHOW_GOALS_COLUMNS = 'show_goals_columns'; @@ -83,6 +95,8 @@ class HtmlTable extends DataTableVisualization * 'show_goals_columns' property is also true. * * @see also self::SHOW_GOALS_COLUMNS + * + * Default value: false */ const DISABLE_SUBTABLE_IN_GOALS_VIEW = 'disable_subtable_when_show_goals'; @@ -90,6 +104,8 @@ class HtmlTable extends DataTableVisualization * Controls whether the summary row is displayed on every page of the datatable view or not. * If false, the summary row will be treated as the last row of the dataset and will only visible * when viewing the last rows. + * + * Default value: false */ const KEEP_SUMMARY_ROW = 'keep_summary_row'; @@ -97,6 +113,8 @@ class HtmlTable extends DataTableVisualization * If true, the summary row will be colored differently than all other DataTable rows. * * @see also self::KEEP_SUMMARY_ROW + * + * Default value: false */ const HIGHLIGHT_SUMMARY_ROW = 'highlight_summary_row'; diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph.php index 11e1e403004..95cbf7610ea 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph.php @@ -29,6 +29,8 @@ class JqplotGraph extends Graph * must be a subclass of JQPlotExternalSeriesToggle. * * @see self::EXTERNAL_SERIES_TOGGLE_SHOW_ALL + * + * Default value: false */ const EXTERNAL_SERIES_TOGGLE = 'external_series_toggle'; @@ -36,11 +38,15 @@ class JqplotGraph extends Graph * Whether the graph should show all loaded series upon initial display. * * @see self::EXTERNAL_SERIES_TOGGLE + * + * Default value: false */ const EXTERNAL_SERIES_TOGGLE_SHOW_ALL = 'external_series_toggle_show_all'; /** - * The number of x-axis ticks between x-axis labels. + * The number of x-axis ticks for each x-axis label. + * + * Default: 2 */ const X_AXIS_STEP_SIZE = 'x_axis_step_size'; diff --git a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php index 40892f09c03..7e8237a6a34 100644 --- a/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php +++ b/plugins/CoreVisualizations/Visualizations/JqplotGraph/Evolution.php @@ -28,6 +28,8 @@ class Evolution extends JqplotGraph /** * Whether to show a line graph or a bar graph. + * + * Default value: true */ const SHOW_LINE_GRAPH = 'show_line_graph';