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
|
<?php /** * AW_Admin_Reports_Tab_Abstract class. * * @package AutomateWoo/Admin */ abstract class AW_Admin_Reports_Tab_Abstract {
/** * Report tab ID. * * @var string */ public $id;
/** * Report tab name. * * @var string */ public $name;
/** * Reports Controller object. * * @var AutomateWoo\Admin\Controllers\Reports */ public $controller;
/** * Get report object. * * @return object */ abstract public function get_report_class();
/** * Get report tab ID. * * @return string */ public function get_id() { return $this->id; }
/** * Get report tab url. * * @return string */ public function get_url() { return admin_url( 'admin.php?page=automatewoo-reports&tab=' . $this->get_id() ); }
/** * Output before report content. * * @return string|false */ public function output_before_report() { return false; }
/** * Report action handler. * * @param string $action */ public function handle_actions( $action ) {}
/** * Output report content. */ public function output() {
$class = $this->get_report_class();
if ( ! $class ) { return; }
$class->nonce_action = $this->controller->get_nonce_action();
$class->output_report(); } }
|