PluginProbe ʕ •ᴥ•ʔ
Check & Log Email – Easy Email Testing & Mail logging / 1.0.13
Check & Log Email – Easy Email Testing & Mail logging v1.0.13
1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 2.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.13.1 2.0.13.2 2.0.14 2.0.2 2.0.3 2.0.4 2.0.5 2.0.5.1 2.0.6 2.0.7 2.0.8 2.0.9 trunk 0.5.7 0.6.0 0.6.1 0.6.2 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.12.1 1.0.13 1.0.13.1 1.0.2 1.0.3
check-email / include / Core / UI / Check_Email_UI_Loader.php
check-email / include / Core / UI Last commit date
Component 2 years ago Page 2 years ago Setting 2 years ago list_table 2 years ago Check_Email_UI_Loader.php 2 years ago
Check_Email_UI_Loader.php
70 lines
1 <?php namespace CheckEmail\Core\UI;
2
3 use CheckEmail\Core\Loadie;
4 use CheckEmail\Core\UI\Page\Check_Email_Log_List_Page;
5
6 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
7
8 /**
9 * Admin UI Loader.
10 * Loads and initializes all admin pages and components.
11 */
12 class Check_Email_UI_Loader implements Loadie {
13
14 protected $components = array();
15 protected $pages = array();
16
17
18 public function load() {
19 $this->initialize_components();
20 $this->initialize_pages();
21
22 foreach ( $this->components as $component ) {
23 $component->load();
24 }
25
26 foreach ( $this->pages as $page ) {
27 $page->load();
28 }
29 }
30
31 protected function initialize_components() {
32 if ( current_user_can( Check_Email_Log_List_Page::CAPABILITY ) ) {
33 if( $this->is_show_dashboard_widget() ) {
34 $this->components['dashboard_widget'] = new Component\Check_Email_Dashboard_Widget();
35 }
36 }
37 }
38
39 public function is_show_dashboard_widget() {
40 $this->components['core_settings'] = new Setting\Check_Email_Core_Setting();
41 $dashboard_status = false;
42 $options = get_option( 'check-email-log-core' );
43 if( isset( $options['enable_dashboard_widget'] ) ) {
44 $dashboard_status = $options['enable_dashboard_widget'];
45 }
46
47 return $dashboard_status;
48 }
49
50 /**
51 * Initialize Admin page Objects.
52 *
53 * This method may be overwritten in tests.
54 *
55 * @access protected
56 */
57 protected function initialize_pages() {
58 $this->pages['check_email'] = new Page\Check_Email_Status_Page();
59 $this->pages['log_list_page'] = new Page\Check_Email_Log_List_Page();
60 $this->pages['settings_page'] = new Page\Check_Email_Settings_Page();
61 if(!defined('CK_MAIL_PRO_VERSION')){
62 $this->pages['features_page'] = new Page\Check_Email_PremiumFeatures_Page();
63 }
64 $this->pages['support_page'] = new Page\Check_Email_HelpSupport_Page();
65 if(!defined('CK_MAIL_PRO_VERSION')){
66 $this->pages['pro_page'] = new Page\Check_Email_UpgradeToPro_Page();
67 }
68 }
69 }
70