@@ -17,57 +17,57 @@ |
||
17 | 17 | */ |
18 | 18 | class EspressoCoreAppAssetManager extends ReactAssetManager |
19 | 19 | { |
20 | - const JS_HANDLE_BARISTA = 'eventespresso-barista'; |
|
20 | + const JS_HANDLE_BARISTA = 'eventespresso-barista'; |
|
21 | 21 | |
22 | - const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
22 | + const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
|
23 | 23 | |
24 | - const JS_HANDLE_EVENT_EDITOR = 'eventespresso-eventEditor'; |
|
24 | + const JS_HANDLE_EVENT_EDITOR = 'eventespresso-eventEditor'; |
|
25 | 25 | |
26 | - const JS_HANDLE_REM_EDITOR = 'eventespresso-rem'; |
|
26 | + const JS_HANDLE_REM_EDITOR = 'eventespresso-rem'; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @throws InvalidDataTypeException |
|
30 | - * @throws InvalidEntityException |
|
31 | - * @throws DuplicateCollectionIdentifierException |
|
32 | - * @throws DomainException |
|
33 | - */ |
|
34 | - public function addAssets() |
|
35 | - { |
|
36 | - parent::addAssets(); |
|
37 | - $this->registerJavascript(); |
|
38 | - } |
|
28 | + /** |
|
29 | + * @throws InvalidDataTypeException |
|
30 | + * @throws InvalidEntityException |
|
31 | + * @throws DuplicateCollectionIdentifierException |
|
32 | + * @throws DomainException |
|
33 | + */ |
|
34 | + public function addAssets() |
|
35 | + { |
|
36 | + parent::addAssets(); |
|
37 | + $this->registerJavascript(); |
|
38 | + } |
|
39 | 39 | |
40 | 40 | |
41 | - /** |
|
42 | - * Register javascript assets |
|
43 | - * |
|
44 | - * @throws InvalidDataTypeException |
|
45 | - * @throws InvalidEntityException |
|
46 | - * @throws DuplicateCollectionIdentifierException |
|
47 | - * @throws DomainException |
|
48 | - */ |
|
49 | - private function registerJavascript() |
|
50 | - { |
|
51 | - $this->addJs( |
|
52 | - EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
53 | - [ |
|
54 | - ReactAssetManager::JS_HANDLE_REACT, |
|
55 | - ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
56 | - CoreAssetManager::JS_HANDLE_JS_CORE, |
|
57 | - 'wp-components', |
|
58 | - 'wp-i18n', |
|
59 | - 'wp-keycodes', |
|
60 | - 'wp-url', |
|
61 | - ] |
|
62 | - )->setRequiresTranslation(); |
|
41 | + /** |
|
42 | + * Register javascript assets |
|
43 | + * |
|
44 | + * @throws InvalidDataTypeException |
|
45 | + * @throws InvalidEntityException |
|
46 | + * @throws DuplicateCollectionIdentifierException |
|
47 | + * @throws DomainException |
|
48 | + */ |
|
49 | + private function registerJavascript() |
|
50 | + { |
|
51 | + $this->addJs( |
|
52 | + EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
53 | + [ |
|
54 | + ReactAssetManager::JS_HANDLE_REACT, |
|
55 | + ReactAssetManager::JS_HANDLE_REACT_DOM, |
|
56 | + CoreAssetManager::JS_HANDLE_JS_CORE, |
|
57 | + 'wp-components', |
|
58 | + 'wp-i18n', |
|
59 | + 'wp-keycodes', |
|
60 | + 'wp-url', |
|
61 | + ] |
|
62 | + )->setRequiresTranslation(); |
|
63 | 63 | |
64 | - $this->addJs( |
|
65 | - EspressoCoreAppAssetManager::JS_HANDLE_BARISTA, |
|
66 | - [ |
|
67 | - EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
68 | - EspressoCoreAppAssetManager::JS_HANDLE_EVENT_EDITOR, |
|
69 | - EspressoCoreAppAssetManager::JS_HANDLE_REM_EDITOR, |
|
70 | - ] |
|
71 | - ); |
|
72 | - } |
|
64 | + $this->addJs( |
|
65 | + EspressoCoreAppAssetManager::JS_HANDLE_BARISTA, |
|
66 | + [ |
|
67 | + EspressoCoreAppAssetManager::JS_HANDLE_EDITOR, |
|
68 | + EspressoCoreAppAssetManager::JS_HANDLE_EVENT_EDITOR, |
|
69 | + EspressoCoreAppAssetManager::JS_HANDLE_REM_EDITOR, |
|
70 | + ] |
|
71 | + ); |
|
72 | + } |
|
73 | 73 | } |
@@ -21,9 +21,9 @@ |
||
21 | 21 | |
22 | 22 | const JS_HANDLE_EDITOR = 'eventespresso-core-app'; |
23 | 23 | |
24 | - const JS_HANDLE_EVENT_EDITOR = 'eventespresso-eventEditor'; |
|
24 | + const JS_HANDLE_EVENT_EDITOR = 'eventespresso-eventEditor'; |
|
25 | 25 | |
26 | - const JS_HANDLE_REM_EDITOR = 'eventespresso-rem'; |
|
26 | + const JS_HANDLE_REM_EDITOR = 'eventespresso-rem'; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * @throws InvalidDataTypeException |
@@ -19,127 +19,127 @@ |
||
19 | 19 | class EspressoLegacyAdmin extends AdminRoute |
20 | 20 | { |
21 | 21 | |
22 | - /** |
|
23 | - * returns true if the current request matches this route |
|
24 | - * |
|
25 | - * @return bool |
|
26 | - * @since $VID:$ |
|
27 | - */ |
|
28 | - public function matchesCurrentRequest() |
|
29 | - { |
|
30 | - global $pagenow; |
|
31 | - return $this->request->isAdminAjax() || ( |
|
32 | - parent::matchesCurrentRequest() && $pagenow && $pagenow === 'admin.php' |
|
33 | - ); |
|
34 | - } |
|
22 | + /** |
|
23 | + * returns true if the current request matches this route |
|
24 | + * |
|
25 | + * @return bool |
|
26 | + * @since $VID:$ |
|
27 | + */ |
|
28 | + public function matchesCurrentRequest() |
|
29 | + { |
|
30 | + global $pagenow; |
|
31 | + return $this->request->isAdminAjax() || ( |
|
32 | + parent::matchesCurrentRequest() && $pagenow && $pagenow === 'admin.php' |
|
33 | + ); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | |
37 | - /** |
|
38 | - * @since $VID:$ |
|
39 | - */ |
|
40 | - protected function registerDependencies() |
|
41 | - { |
|
42 | - $asset_manger_dependencies = [ |
|
43 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
44 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
45 | - 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
46 | - ]; |
|
47 | - $this->dependency_map->registerDependencies(JqueryAssetManager::class, $asset_manger_dependencies); |
|
48 | - $this->dependency_map->registerDependencies(EspressoLegacyAdminAssetManager::class, $asset_manger_dependencies); |
|
49 | - $this->dependency_map->registerDependencies( |
|
50 | - LegacyAccountingAssetManager::class, |
|
51 | - ['EE_Currency_Config' => EE_Dependency_Map::load_from_cache] + $asset_manger_dependencies |
|
52 | - ); |
|
53 | - $this->dependency_map->registerDependencies( |
|
54 | - 'EE_Admin_Transactions_List_Table', |
|
55 | - [ |
|
56 | - null, |
|
57 | - 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
58 | - ] |
|
59 | - ); |
|
60 | - $this->dependency_map->registerDependencies( |
|
61 | - 'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings', |
|
62 | - ['EE_Registration_Config' => EE_Dependency_Map::load_from_cache] |
|
63 | - ); |
|
64 | - $this->dependency_map->registerDependencies( |
|
65 | - 'EventEspresso\admin_pages\general_settings\OrganizationSettings', |
|
66 | - [ |
|
67 | - 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
68 | - 'EE_Organization_Config' => EE_Dependency_Map::load_from_cache, |
|
69 | - 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
70 | - 'EE_Network_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
71 | - 'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache, |
|
72 | - ] |
|
73 | - ); |
|
74 | - $this->dependency_map->registerDependencies( |
|
75 | - 'EventEspresso\core\services\address\CountrySubRegionDao', |
|
76 | - [ |
|
77 | - 'EEM_State' => EE_Dependency_Map::load_from_cache, |
|
78 | - 'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache |
|
79 | - ] |
|
80 | - ); |
|
81 | - $this->dependency_map->registerDependencies( |
|
82 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder', |
|
83 | - [ |
|
84 | - null, |
|
85 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
86 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
87 | - ] |
|
88 | - ); |
|
89 | - $this->dependency_map->registerDependencies( |
|
90 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader', |
|
91 | - [ |
|
92 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
93 | - 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
94 | - ] |
|
95 | - ); |
|
96 | - $this->dependency_map->registerDependencies( |
|
97 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader', |
|
98 | - [ |
|
99 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
100 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
101 | - ] |
|
102 | - ); |
|
103 | - $this->dependency_map->registerDependencies( |
|
104 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader', |
|
105 | - [ |
|
106 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
107 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
108 | - ] |
|
109 | - ); |
|
110 | - $this->dependency_map->registerDependencies( |
|
111 | - 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader', |
|
112 | - [ |
|
113 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
114 | - 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
115 | - ] |
|
116 | - ); |
|
117 | - } |
|
37 | + /** |
|
38 | + * @since $VID:$ |
|
39 | + */ |
|
40 | + protected function registerDependencies() |
|
41 | + { |
|
42 | + $asset_manger_dependencies = [ |
|
43 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
44 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
45 | + 'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
|
46 | + ]; |
|
47 | + $this->dependency_map->registerDependencies(JqueryAssetManager::class, $asset_manger_dependencies); |
|
48 | + $this->dependency_map->registerDependencies(EspressoLegacyAdminAssetManager::class, $asset_manger_dependencies); |
|
49 | + $this->dependency_map->registerDependencies( |
|
50 | + LegacyAccountingAssetManager::class, |
|
51 | + ['EE_Currency_Config' => EE_Dependency_Map::load_from_cache] + $asset_manger_dependencies |
|
52 | + ); |
|
53 | + $this->dependency_map->registerDependencies( |
|
54 | + 'EE_Admin_Transactions_List_Table', |
|
55 | + [ |
|
56 | + null, |
|
57 | + 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
58 | + ] |
|
59 | + ); |
|
60 | + $this->dependency_map->registerDependencies( |
|
61 | + 'EventEspresso\caffeinated\modules\recaptcha_invisible\RecaptchaAdminSettings', |
|
62 | + ['EE_Registration_Config' => EE_Dependency_Map::load_from_cache] |
|
63 | + ); |
|
64 | + $this->dependency_map->registerDependencies( |
|
65 | + 'EventEspresso\admin_pages\general_settings\OrganizationSettings', |
|
66 | + [ |
|
67 | + 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
68 | + 'EE_Organization_Config' => EE_Dependency_Map::load_from_cache, |
|
69 | + 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
70 | + 'EE_Network_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
71 | + 'EventEspresso\core\services\address\CountrySubRegionDao' => EE_Dependency_Map::load_from_cache, |
|
72 | + ] |
|
73 | + ); |
|
74 | + $this->dependency_map->registerDependencies( |
|
75 | + 'EventEspresso\core\services\address\CountrySubRegionDao', |
|
76 | + [ |
|
77 | + 'EEM_State' => EE_Dependency_Map::load_from_cache, |
|
78 | + 'EventEspresso\core\services\validators\JsonValidator' => EE_Dependency_Map::load_from_cache |
|
79 | + ] |
|
80 | + ); |
|
81 | + $this->dependency_map->registerDependencies( |
|
82 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\QueryBuilder', |
|
83 | + [ |
|
84 | + null, |
|
85 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
86 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
87 | + ] |
|
88 | + ); |
|
89 | + $this->dependency_map->registerDependencies( |
|
90 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\AttendeeFilterHeader', |
|
91 | + [ |
|
92 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
93 | + 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
94 | + ] |
|
95 | + ); |
|
96 | + $this->dependency_map->registerDependencies( |
|
97 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\DateFilterHeader', |
|
98 | + [ |
|
99 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
100 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
101 | + ] |
|
102 | + ); |
|
103 | + $this->dependency_map->registerDependencies( |
|
104 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\EventFilterHeader', |
|
105 | + [ |
|
106 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
107 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
108 | + ] |
|
109 | + ); |
|
110 | + $this->dependency_map->registerDependencies( |
|
111 | + 'EventEspresso\core\domain\services\admin\registrations\list_table\page_header\TicketFilterHeader', |
|
112 | + [ |
|
113 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
114 | + 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
115 | + ] |
|
116 | + ); |
|
117 | + } |
|
118 | 118 | |
119 | 119 | |
120 | - /** |
|
121 | - * implements logic required to run during request |
|
122 | - * |
|
123 | - * @return bool |
|
124 | - * @since $VID:$ |
|
125 | - */ |
|
126 | - protected function requestHandler() |
|
127 | - { |
|
128 | - $this->loader->getShared(JqueryAssetManager::class); |
|
129 | - $this->loader->getShared(EspressoLegacyAdminAssetManager::class); |
|
130 | - $this->loader->getShared(LegacyAccountingAssetManager::class); |
|
131 | - add_action('admin_enqueue_scripts', [$this, 'enqueueAssets']); |
|
132 | - return true; |
|
133 | - } |
|
120 | + /** |
|
121 | + * implements logic required to run during request |
|
122 | + * |
|
123 | + * @return bool |
|
124 | + * @since $VID:$ |
|
125 | + */ |
|
126 | + protected function requestHandler() |
|
127 | + { |
|
128 | + $this->loader->getShared(JqueryAssetManager::class); |
|
129 | + $this->loader->getShared(EspressoLegacyAdminAssetManager::class); |
|
130 | + $this->loader->getShared(LegacyAccountingAssetManager::class); |
|
131 | + add_action('admin_enqueue_scripts', [$this, 'enqueueAssets']); |
|
132 | + return true; |
|
133 | + } |
|
134 | 134 | |
135 | 135 | |
136 | - /** |
|
137 | - * enqueue_scripts - Load the scripts and css |
|
138 | - * |
|
139 | - * @return void |
|
140 | - */ |
|
141 | - public function enqueueAssets() |
|
142 | - { |
|
143 | - wp_enqueue_script(EspressoCoreAppAssetManager::JS_HANDLE_BARISTA); |
|
144 | - } |
|
136 | + /** |
|
137 | + * enqueue_scripts - Load the scripts and css |
|
138 | + * |
|
139 | + * @return void |
|
140 | + */ |
|
141 | + public function enqueueAssets() |
|
142 | + { |
|
143 | + wp_enqueue_script(EspressoCoreAppAssetManager::JS_HANDLE_BARISTA); |
|
144 | + } |
|
145 | 145 | } |