surecart
/
app
/
src
/
Controllers
/
Admin
/
CancellationInsights
/
CancellationInsightsController.php
CancellationInsightsController.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Controllers\Admin\CancellationInsights; |
| 4 | |
| 5 | use SureCart\Controllers\Admin\CancellationInsights\CancellationInsightsListTable; |
| 6 | use SureCart\Controllers\Admin\AdminController; |
| 7 | |
| 8 | /** |
| 9 | * Handles product admin requests. |
| 10 | */ |
| 11 | class CancellationInsightsController extends AdminController { |
| 12 | /** |
| 13 | * Index. |
| 14 | */ |
| 15 | public function index() { |
| 16 | $this->withHeader( |
| 17 | array( |
| 18 | 'breadcrumbs' => [ |
| 19 | 'subscriptions' => [ |
| 20 | 'title' => __( 'Subscription Saver & Insights', 'surecart' ), |
| 21 | ], |
| 22 | ], |
| 23 | 'report_url' => SURECART_REPORTS_URL . 'cancellation_acts', |
| 24 | ) |
| 25 | ); |
| 26 | |
| 27 | $table = new CancellationInsightsListTable(); |
| 28 | $table->prepare_items(); |
| 29 | return \SureCart::view( 'admin/cancellation-insights/index' )->with( |
| 30 | [ |
| 31 | 'table' => $table, |
| 32 | 'enabled' => \SureCart::account()->entitlements->subscription_preservation ?? false, |
| 33 | ] |
| 34 | ); |
| 35 | } |
| 36 | } |
| 37 |