PluginProbe
Email Log / 2.1.0
Email Log v2.1.0
2.63 2.4.8 2.4.9 2.6 2.61 2.62 trunk 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.8.1 0.9 0.9.1 0.9.2 1.1 1.5 1.5.1 1.5.2 1.5.3 1.5.4 All 61 releases
email-log / include / Core / UI / UILoader.php

UILoader.php in Email Log 2.1.0, at include/Core/UI/UILoader.php

72 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php namespace EmailLog\Core\UI;
2
3 use EmailLog\Core\Loadie;
4
5 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
6
7 /**
8 * Admin UI Loader.
9 * Loads and initializes all admin pages and components.
10 *
11 * @since 2.0
12 */
13 class UILoader implements Loadie {
14
15 /**
16 * UI Component List.
17 *
18 * @var array
19 */
20 protected $components = array();
21
22 /**
23 * List of Admin pages.
24 *
25 * @var \EmailLog\Core\UI\Page\BasePage[]
26 */
27 protected $pages = array();
28
29 /**
30 * Load all components and setup hooks.
31 *
32 * @inheritdoc
33 */
34 public function load() {
35 $this->initialize_components();
36 $this->initialize_pages();
37
38 foreach ( $this->components as $component ) {
39 $component->load();
40 }
41
42 foreach ( $this->pages as $page ) {
43 $page->load();
44 }
45 }
46
47 /**
48 * Initialize UI component Objects.
49 *
50 * This method may be overwritten in tests.
51 *
52 * @access protected
53 */
54 protected function initialize_components() {
55 $this->components['admin_ui_enhancer'] = new Component\AdminUIEnhancer();
56 $this->components['core_settings'] = new Setting\CoreSetting();
57 }
58
59 /**
60 * Initialize Admin page Objects.
61 *
62 * This method may be overwritten in tests.
63 *
64 * @access protected
65 */
66 protected function initialize_pages() {
67 $this->pages['log_list_page'] = new Page\LogListPage();
68 $this->pages['settings_page'] = new Page\SettingsPage();
69 $this->pages['addon_list_page'] = new Page\AddonListPage();
70 }
71 }
72