chart.php
38 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Overview chart template. |
| 4 | * |
| 5 | * @since 1.8.2 |
| 6 | * |
| 7 | * @var string $id Identifier to outline the context of where the chart will be used. i.e., "entries". |
| 8 | * @var array $notice Container variable for holding placeholder heading and description text that is displayed when the chart has no stats to show. |
| 9 | * @var string $total_items Total number of items (entries) as a placeholder text to be shown. |
| 10 | */ |
| 11 | |
| 12 | defined( 'ABSPATH' ) || exit; // Exit if accessed directly. |
| 13 | |
| 14 | ?> |
| 15 | <div class="wpforms-overview-chart"> |
| 16 | <div class="spinner"></div> |
| 17 | <div class="wpforms-overview-chart-notice wpforms-hide"> |
| 18 | <div class="wpforms-overview-chart-notice-content"> |
| 19 | <h2><?php echo esc_html( $notice['heading'] ); ?></h2> |
| 20 | <p><?php echo esc_html( $notice['description'] ); ?></p> |
| 21 | </div> |
| 22 | </div> |
| 23 | |
| 24 | <?php if ( ! empty( $total_items ) ) : ?> |
| 25 | <h3 class="wpforms-overview-chart-heading"> |
| 26 | <?php echo esc_html( $total_items ); ?>: |
| 27 | <span class="wpforms-overview-chart-total-items">0</span> |
| 28 | </h3> |
| 29 | <?php endif; ?> |
| 30 | |
| 31 | <div class="wpforms-overview-chart-canvas"> |
| 32 | <canvas id="wpforms-<?php echo esc_attr( $id ); ?>-overview-canvas" width="400" height="300"></canvas> |
| 33 | </div> |
| 34 | </div> |
| 35 | |
| 36 | <?php |
| 37 | /* Omit closing PHP tag at the end of PHP files to avoid "headers already sent" issues. */ |
| 38 |