1 | <?php |
||
2 | /** |
||
3 | * Contains the settings class for LSX |
||
4 | * |
||
5 | * @package lsx-health-plan |
||
6 | */ |
||
7 | |||
8 | namespace lsx_health_plan\classes\admin; |
||
9 | |||
10 | /** |
||
11 | * Contains the settings for each post type \lsx_health_plan\classes\admin\Help_Page(). |
||
12 | */ |
||
13 | class Help_Page { |
||
14 | |||
15 | /** |
||
16 | * Holds class instance |
||
17 | * |
||
18 | * @since 1.0.0 |
||
19 | * |
||
20 | * @var object \lsx_health_plan\classes\admin\Help_Page() |
||
21 | */ |
||
22 | protected static $instance = null; |
||
23 | |||
24 | /** |
||
25 | * Option key, and option page slug |
||
26 | * |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $screen_id = 'lsx_hp_help'; |
||
30 | |||
31 | /** |
||
32 | * Constructor |
||
33 | */ |
||
34 | public function __construct() { |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
35 | add_action( 'admin_enqueue_scripts', array( $this, 'assets' ) ); |
||
36 | add_action( 'admin_menu', array( $this, 'register_menu' ) ); |
||
37 | add_action( 'lsx_hp_help', array( $this, 'header' ), 10 ); |
||
38 | add_action( 'lsx_hp_help', array( $this, 'body' ), 20 ); |
||
39 | add_action( 'lsx_hp_help', array( $this, 'footer' ), 30 ); |
||
40 | } |
||
0 ignored issues
–
show
|
|||
41 | |||
42 | /** |
||
43 | * Return an instance of this class. |
||
44 | * |
||
45 | * @since 1.0.0 |
||
46 | * |
||
47 | * @return object \lsx_health_plan\classes\admin\Help_Page() A single instance of this class. |
||
48 | */ |
||
49 | public static function get_instance() { |
||
50 | // If the single instance hasn't been set, set it now. |
||
51 | if ( null === self::$instance ) { |
||
0 ignored issues
–
show
|
|||
52 | self::$instance = new self(); |
||
53 | } |
||
0 ignored issues
–
show
|
|||
54 | return self::$instance; |
||
55 | } |
||
0 ignored issues
–
show
|
|||
56 | |||
57 | |||
58 | |||
59 | /** |
||
60 | * Load hp_help screen css. |
||
61 | * |
||
62 | * @package lsx |
||
63 | * @subpackage hp-help-page |
||
64 | * |
||
65 | * @param string $hook_suffix the current page hook suffix. |
||
66 | */ |
||
67 | public function assets( $hook_suffix ) { |
||
68 | if ( 'plan_page_help' === $hook_suffix ) { |
||
0 ignored issues
–
show
|
|||
69 | wp_enqueue_style( 'lsx-hp-help-screen', LSX_HEALTH_PLAN_URL . 'assets/css/help.css', array(), LSX_HEALTH_PLAN_VER ); |
||
70 | wp_style_add_data( 'lsx-hp-help-screen', 'rtl', 'replace' ); |
||
71 | } |
||
72 | } |
||
0 ignored issues
–
show
|
|||
73 | |||
74 | /** |
||
75 | * Creates the dashboard page. |
||
76 | * |
||
77 | * @package lsx |
||
78 | * @subpackage hp-help-page |
||
79 | */ |
||
80 | public function register_menu() { |
||
81 | add_submenu_page( 'edit.php?post_type=plan', __( 'Help', 'lsx-health-plan' ), __( 'Help', 'lsx-health-plan' ), 'manage_options', 'help', array( $this, 'screen' ) ); |
||
82 | } |
||
0 ignored issues
–
show
|
|||
83 | |||
84 | |||
85 | /** |
||
86 | * The help screen. |
||
87 | * |
||
88 | * @package lsx |
||
89 | * @subpackage hp-help-page |
||
90 | */ |
||
91 | public function screen() { |
||
92 | require_once ABSPATH . 'wp-load.php'; |
||
93 | require_once ABSPATH . 'wp-admin/admin.php'; |
||
94 | require_once ABSPATH . 'wp-admin/admin-header.php'; |
||
95 | ?> |
||
96 | <div class="wrap about-wrap"> |
||
97 | <?php |
||
98 | /** |
||
99 | * Functions hooked into lsx_hp_help action |
||
100 | * |
||
101 | * @hooked lsx_hp_help_header - 10 |
||
102 | * @hooked lsx_hp_help_body - 20 |
||
103 | * @hooked lsx_hp_help_footer - 30 |
||
104 | */ |
||
105 | do_action( 'lsx_hp_help' ); |
||
106 | ?> |
||
107 | </div> |
||
108 | <?php |
||
109 | } |
||
0 ignored issues
–
show
|
|||
110 | |||
111 | /** |
||
112 | * Help screen intro. |
||
113 | * |
||
114 | * @package lsx |
||
115 | * @subpackage hp-help-page |
||
116 | */ |
||
117 | public function header() { |
||
118 | ?> |
||
119 | <div class="enrich"> |
||
120 | <h2><?php esc_html_e( 'LightSpeed’s LSX Health Plugin', 'lsx-health-plan' ); ?></h2> |
||
121 | <p><?php esc_html_e( "Thank you for using the LSX Health plugin. All of us here at LightSpeed appreciate your ongoing support and we can't wait to see what people create with the plugin. We're committed to ensuring you have all the help you need to make the most of the plugin.", 'lsx-health-plan' ); ?></p> |
||
122 | </div> |
||
123 | <?php |
||
124 | } |
||
0 ignored issues
–
show
|
|||
125 | |||
126 | /** |
||
127 | * Help screen body section. |
||
128 | * |
||
129 | * @package lsx |
||
130 | * @subpackage hp-help-page |
||
131 | */ |
||
132 | public function body() { |
||
133 | include LSX_HEALTH_PLAN_PATH . 'templates/partials/help.php'; |
||
134 | } |
||
0 ignored issues
–
show
|
|||
135 | |||
136 | /** |
||
137 | * Help screen contribute section. |
||
138 | * |
||
139 | * @package lsx |
||
140 | * @subpackage hp-help-page |
||
141 | */ |
||
142 | public function footer() { |
||
143 | |||
144 | } |
||
0 ignored issues
–
show
|
|||
145 | } |
||
146 |