table.php
6 years ago
table_map_no_dimension.php
6 years ago
table_no_data.php
6 years ago
table_no_dimension.php
6 years ago
table_no_dimension.php
36 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Matomo - free/libre analytics platform |
| 4 | * |
| 5 | * @link https://matomo.org |
| 6 | * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later |
| 7 | * @package matomo |
| 8 | */ |
| 9 | |
| 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | exit; // if accessed directly |
| 12 | } |
| 13 | |
| 14 | /** @var array $report */ |
| 15 | /** @var array $report_meta */ |
| 16 | /** @var string $first_metric_name */ |
| 17 | /** @var string $first_metric_display_name */ |
| 18 | ?> |
| 19 | |
| 20 | <div class="table"> |
| 21 | <table class="widefat matomo-table"> |
| 22 | <tbody> |
| 23 | <?php |
| 24 | $matomo_columns = ! empty( $report['columns'] ) ? $report['columns'] : array(); |
| 25 | foreach ( $report['reportData']->getRows() as $matomo_val => $matomo_row ) { |
| 26 | foreach ( $matomo_row as $matomo_metric_name => $matomo_value ) { |
| 27 | $matomo_display_name = ! empty( $matomo_columns[ $matomo_metric_name ] ) ? $matomo_columns[ $matomo_metric_name ] : $matomo_metric_name; |
| 28 | echo '<tr><td width="75%">' . esc_html( $matomo_display_name ) . '</td><td width="25%">' . esc_html( $matomo_value ) . '</td></tr>'; |
| 29 | } |
| 30 | } |
| 31 | ?> |
| 32 | </tbody> |
| 33 | |
| 34 | </table> |
| 35 | </div> |
| 36 |