| 1 |
<?php |
| 2 |
/** |
| 3 |
* Template for the statistics report popup body ( SweetAlert2 ). |
| 4 |
* |
| 5 |
* The table itself is server-rendered by AdminStatisticsReportTable through |
| 6 |
* TemplateAJAX: the JS modal injects this body, sets the .lp-target args |
| 7 |
* ( report + current filters + search ) and triggers the load. Pagination is |
| 8 |
* handled by loadAJAX.js ( .page-numbers ); search + CSV export are wired by |
| 9 |
* the report-modal JS module. |
| 10 |
* |
| 11 |
* @since 4.4.2 |
| 12 |
* @version 2.0.0 |
| 13 |
*/ |
| 14 |
|
| 15 |
use LearnPress\TemplateHooks\Admin\AdminStatisticsReportTable; |
| 16 |
use LearnPress\TemplateHooks\TemplateAJAX; |
| 17 |
|
| 18 |
defined( 'ABSPATH' ) || exit(); |
| 19 |
|
| 20 |
$lp_report_args = array( |
| 21 |
'id_url' => 'lp-stats-report', |
| 22 |
'report' => '', |
| 23 |
'paged' => 1, |
| 24 |
'search' => '', |
| 25 |
'enableScrollToView' => false, |
| 26 |
'enableUpdateParamsUrl' => false, |
| 27 |
'html_no_load_ajax_first' => sprintf( |
| 28 |
'<div class="lp-stats-report-modal__loading">%s</div>', |
| 29 |
esc_html__( 'Loading…', 'learnpress' ) |
| 30 |
), |
| 31 |
); |
| 32 |
|
| 33 |
$lp_report_callback = array( |
| 34 |
'class' => AdminStatisticsReportTable::class, |
| 35 |
'method' => 'render_report_table', |
| 36 |
); |
| 37 |
?> |
| 38 |
<script type="text/html" id="lp-tmpl-stats-report-modal"> |
| 39 |
<div class="lp-stats-report-modal"> |
| 40 |
<div class="lp-stats-report-modal__toolbar"> |
| 41 |
<input type="search" class="lp-stats-report-modal__search" placeholder="<?php esc_attr_e( 'Search…', 'learnpress' ); ?>"> |
| 42 |
<button type="button" class="lp-stats-report-modal__export button"><?php esc_html_e( 'Export CSV', 'learnpress' ); ?></button> |
| 43 |
</div> |
| 44 |
<div class="lp-stats-report-modal__body"> |
| 45 |
<?php echo TemplateAJAX::load_content_via_ajax( $lp_report_args, $lp_report_callback ); ?> |
| 46 |
</div> |
| 47 |
</div> |
| 48 |
</script> |
| 49 |
|