Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Properties.php « ViewDataTable « core - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4f5886a327e693c75b48b133cf7003c1f3053b0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
<?php
/**
 * Piwik - Open source web analytics
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @category Piwik
 * @package Piwik
 */

namespace Piwik\ViewDataTable;

use Exception;
use Piwik\Config;
use Piwik\Metrics;

use ReflectionClass;

/**
 * Contains the list of all core DataTable display properties for use with ViewDataTable.
 *
 * @see ViewDataTable - for more info.
 */
class Properties
{
    /**
     * The default viewDataTable ID to use when determining which visualization to use.
     * This property is only valid for reports whose properties are determined by the
     * Visualization.getReportDisplayProperties event. When manually creating ViewDataTables,
     * setting this property will have no effect.
     * 
     * Default value: 'table'
     */
    const DEFAULT_VIEW_TYPE = 'default_view_type';

    /**
     * Controls what footer icons are displayed on the bottom left of the DataTable view.
     * 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. See
     * this example to get a clear idea of what is required:
     * 
     * 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.
     * 
     * 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';

    /**
     * Controls whether the buttons and UI controls around the visualization or shown or
     * if just the visualization alone is shown.
     * 
     * 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';

    /**
     * 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';

    /**
     * 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';

    /**
     * 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';

    /**
     * Array property that determines which columns will be shown. Columns not in this array
     * 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';

    /**
     * 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.
     * 
     * @see also self::TITLE. Both must be set if associating related reports.
     * 
     * Default value: array()
     */
    const RELATED_REPORTS = 'related_reports';

    /**
     * The report title. Used with related reports so report headings can be changed when switching
     * 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';

    /**
     * An array property that contains query parameter name/value overrides for API requests made
     * by ViewDataTable.
     * 
     * E.g. array('idSite' => ..., 'period' => 'month')
     * 
     * Default value: array()
     */
    const REQUEST_PARAMETERS_TO_MODIFY = 'request_parameters_to_modify';

    /**
     * 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';

    /**
     * The column to apply a filter pattern to.
     * 
     * @see also self::FILTER_PATTERN
     * 
     * Default value: false
     */
    const FILTER_PATTERN_COLUMN = 'filter_column';

    /**
     * Array property containing custom data to be saved in JSON in the data-params HTML attribute
     * of a data table div. This data can be used by JavaScript DataTable classes.
     * 
     * e.g. array('typeReferrer' => ...)
     * 
     * Default value: array()
     */
    const CUSTOM_PARAMETERS = 'custom_parameters';

    /**
     * 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';

    /**
     * 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';

    /**
     * Controls whether the limit dropdown (which allows users to change the number of data shown)
     * 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';

    /**
     * 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';

    /**
     * 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';

    /**
     * Array property that stores documentation for individual metrics.
     * 
     * E.g. array('nb_visits' => '...', ...)
     * 
     * Default: Set to values retrieved from report metadata (via API.getReportMetadata API method).
     */
    const METRIC_DOCUMENTATION = 'metrics_documentation';

    /**
     * Row metadata name that contains the tooltip for the specific row.
     * 
     * Default value: false
     */
    const TOOLTIP_METADATA_NAME = 'tooltip_metadata_name';

    /**
     * The URL to the report the view is displaying. Modifying this means clicking back to this report
     * from a Related Report will go to a different URL. Can be used to load an entire page instead
     * 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';

    /**
     * Special property that holds the properties for DataTable Visualizations.
     * 
     * @see Piwik\ViewDataTable\VisualizationProperties
     */
    const VISUALIZATION_PROPERTIES = 'visualization_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';

    /**
     * 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';

    /**
     * Array of DataTable filters that should be run before displaying a DataTable. Elements
     * of this array can either be a closure or an array with at most three elements, including:
     * - the filter name (or a closure)
     * - an array of filter parameters
     * - a boolean indicating if the filter is a priority filter or not
     * 
     * 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.
     * 
     * Default value: array()
     */
    const FILTERS = 'filters';

    /**
     * Array of callbacks that are called after the data for a ViewDataTable is successfully
     * loaded. Each callback is invoked with the DataTable instance obtained from the API
     * and the ViewDatable instance that loaded it.
     * 
     * Functions can be appended to this array property when it's necessary to configure
     * 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';

    /**
     * Controls whether the 'prev'/'next' links are shown in the DataTable footer. These links
     * change the 'filter_offset' query parameter, thus allowing pagination.
     * 
     * 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';

    /**
     * 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';

    /**
     * The list of ViewDataTable properties that are 'Client Side Parameters'.
     * 
     * @see Piwik\ViewDataTable\Visualization::getClientSideParameters
     */
    public static $clientSideParameters = array(
        'filter_excludelowpop',
        'filter_excludelowpop_value',
        'filter_pattern',
        'filter_column',
    );

    /**
     * The list of ViewDataTable properties that are 'Client Side Properties'.
     * 
     * @see Piwik\ViewDataTable\Visualization::getClientSideProperties
     */
    public static $clientSideProperties = array(
        'show_limit_control'
    );

    /**
     * The list of ViewDataTable properties that can be overriden by query parameters.
     * 
     * @see Piwik\ViewDataTable\Visualization::getOverridableProperties
     */
    public static $overridableProperties = array(
        'show_goals',
        'filter_sort_column',
        'filter_sort_order',
        'filter_limit',
        'filter_offset',
        'filter_pattern',
        'filter_column',
        'disable_generic_filters',
        'disable_queued_filters',
        'show_exclude_low_population',
        'show_flatten_table',
        'show_table',
        'show_table_all_columns',
        'show_footer',
        'show_footer_icons',
        'show_all_views_icons',
        'show_active_view_icon',
        'show_related_reports',
        'show_limit_control',
        'show_search',
        'enable_sort',
        'show_bar_chart',
        'show_pie_chart',
        'show_tag_cloud',
        'show_export_as_rss_feed',
        'show_ecommerce',
        'filter_excludelowpop',
        'filter_excludelowpop_value',
        'search_recursive',
        'show_export_as_image_icon',
        'show_pagination_control',
        'show_offset_information',
        'hide_annotations_view',
        'export_limit',
        'show_non_core_visualizations'
    );

    /**
     * Returns the set of all valid ViewDataTable properties. The result is an array with property
     * names as keys. Values of the array are undefined.
     *
     * @return array
     */
    public static function getAllProperties()
    {
        static $propertiesCache = null;

        if ($propertiesCache === null) {
            $propertiesCache = self::getFlippedClassConstantMap(__CLASS__);
        }

        return $propertiesCache;
    }

    /**
     * Returns the set of all valid properties for the given visualization class. The result is an
     * array with property names as keys. Values of the array are undefined.
     *
     * @param string  $visualizationClass
     *
     * @return array
     */
    public static function getVisualizationProperties($visualizationClass)
    {
        static $propertiesCache = array();

        if ($visualizationClass === null) {
            return array();
        }

        if (!isset($propertiesCache[$visualizationClass])) {
            $properties = self::getFlippedClassConstantMap($visualizationClass);

            $parentClass = get_parent_class($visualizationClass);
            if ($parentClass != 'Piwik\\ViewDataTable\\Visualization') {
                $properties += self::getVisualizationProperties($parentClass);
            }

            $propertiesCache[$visualizationClass] = $properties;
        }

        return $propertiesCache[$visualizationClass];
    }

    /**
     * Returns true if $name is a core ViewDataTable property, false if not.
     * 
     * @param string $name
     * @return bool
     */
    public static function isCoreViewProperty($name)
    {
        $properties = self::getAllProperties();
        return isset($properties[$name]);
    }

    /**
     * Returns true if $name is a valid visualization property for the given visualization class.
     */
    public static function isValidVisualizationProperty($visualizationClass, $name)
    {
        $properties = self::getVisualizationProperties($visualizationClass);
        return isset($properties[$name]);
    }

    /**
     * Checks if a property is a valid ViewDataTable property, and if not, throws an exception.
     *
     * @param string $name The property name.
     * @throws Exception
     */
    public static function checkValidPropertyName($name)
    {
        if (!self::isCoreViewProperty($name)) {
            throw new Exception("Invalid ViewDataTable display property '$name'.");
        }
    }

    /**
     * Checks if a property is a valid visualization property for the given visualization class,
     * and if not, throws an exception.
     * 
     * @param string $visualizationClass
     * @param string $name The property name.
     * @throws Exception
     */
    public static function checkValidVisualizationProperty($visualizationClass, $name)
    {
        if (!self::isValidVisualizationProperty($visualizationClass, $name)) {
            throw new Exception("Invalid Visualization display property '$name' for '$visualizationClass'.");
        }
    }

    /**
     * Returns the default values for each core view property.
     * 
     * @return array
     */
    public static function getDefaultPropertyValues()
    {
        return array(
            'footer_icons' => false,
            'show_visualization_only' => false,
            'datatable_js_type' => 'DataTable',
            'show_goals' => false,
            'show_ecommerce' => false,
            'show_search' => true,
            'show_table' => true,
            'show_table_all_columns' => true,
            'show_all_views_icons' => true,
            'show_active_view_icon' => true,
            'show_bar_chart' => true,
            'show_pie_chart' => true,
            'show_tag_cloud' => true,
            'show_export_as_image_icon' => false,
            'show_export_as_rss_feed' => true,
            'show_exclude_low_population' => true,
            'show_flatten_table' => true,
            'show_offset_information' => true,
            'show_pagination_control' => true,
            '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'],
            'related_reports' => array(),
            'title' => '',
            'tooltip_metadata_name' => false,
            'enable_sort' => true,
            'disable_generic_filters' => false,
            'disable_queued_filters' => false,
            'search_recursive' => false,
            'filter_excludelowpop' => false,
            'filter_excludelowpop_value' => false,
            'filter_pattern' => false,
            'filter_column' => false,
            'filter_limit' => false,
            'filter_offset' => 0,
            'filter_sort_column' => false,
            'filter_sort_order' => 'desc',
            'custom_parameters' => array(),
            'translations' => array_merge(
                Metrics::getDefaultMetrics(),
                Metrics::getDefaultProcessedMetrics()
            ),
            'request_parameters_to_modify' => array(),
            'documentation' => false,
            'datatable_css_class' => false,
            'filters' => array(),
            'after_data_loaded_functions' => array(),
            'hide_annotations_view' => true,
            'columns_to_display' => array(),
            'y_axis_unit' => false
        );
    }

    private static function getFlippedClassConstantMap($klass)
    {
        $klass = new ReflectionClass($klass);
        $constants = $klass->getConstants();
        
        unset($constants['ID']);
        unset($constants['FOOTER_ICON']);
        unset($constants['FOOTER_ICON_TITLE']);

        foreach ($constants as $name => $value) {
            if (!is_string($value)) {
                unset($constants[$name]);
            }
        }

        return array_flip($constants);
    }
}