1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace EventEspresso\core\domain\entities\routing\handlers\admin; |
4
|
|
|
|
5
|
|
|
use EE_Dependency_Map; |
6
|
|
|
use EventEspresso\core\domain\entities\routing\handlers\Route; |
7
|
|
|
use EventEspresso\core\domain\services\admin\PluginUpsells; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class WordPressPluginsPage |
11
|
|
|
* detects and executes logic for the WordPress Plugins admin page |
12
|
|
|
* |
13
|
|
|
* @package EventEspresso\core\domain\entities\routing\handlers\admin |
14
|
|
|
* @author Brent Christensen |
15
|
|
|
* @since $VID:$ |
16
|
|
|
*/ |
17
|
|
|
class WordPressPluginsPage extends Route |
18
|
|
|
{ |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* returns true if the current request matches this route |
22
|
|
|
* |
23
|
|
|
* @return bool |
24
|
|
|
* @since $VID:$ |
25
|
|
|
*/ |
26
|
|
|
public function matchesCurrentRequest() |
27
|
|
|
{ |
28
|
|
|
global $pagenow; |
29
|
|
|
return $this->request->isAdmin() && $pagenow && $pagenow === 'plugins.php'; |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @since $VID:$ |
35
|
|
|
*/ |
36
|
|
View Code Duplication |
protected function registerDependencies() |
37
|
|
|
{ |
38
|
|
|
$this->dependency_map->registerDependencies( |
39
|
|
|
'EventEspresso\core\domain\services\assets\WordpressPluginsPageAssetManager', |
40
|
|
|
[ |
41
|
|
|
'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
42
|
|
|
'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
43
|
|
|
'EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache, |
44
|
|
|
'EventEspresso\core\domain\services\admin\ExitModal' => EE_Dependency_Map::load_from_cache, |
45
|
|
|
] |
46
|
|
|
); |
47
|
|
|
$this->dependency_map->registerDependencies( |
48
|
|
|
'EventEspresso\core\domain\services\admin\ExitModal', |
49
|
|
|
['EventEspresso\core\services\assets\Registry' => EE_Dependency_Map::load_from_cache] |
50
|
|
|
); |
51
|
|
|
$this->dependency_map->registerDependencies( |
52
|
|
|
'EventEspresso\core\domain\services\admin\PluginUpsells', |
53
|
|
|
['EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache] |
54
|
|
|
); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* implements logic required to run during request |
60
|
|
|
* |
61
|
|
|
* @return bool |
62
|
|
|
* @since $VID:$ |
63
|
|
|
*/ |
64
|
|
|
protected function requestHandler() |
65
|
|
|
{ |
66
|
|
|
$this->loader->getShared('EventEspresso\core\domain\services\assets\WordpressPluginsPageAssetManager'); |
67
|
|
|
/** @var PluginUpsells $plugin_upsells */ |
68
|
|
|
$plugin_upsells = $this->loader->getShared('EventEspresso\core\domain\services\admin\PluginUpsells'); |
69
|
|
|
$plugin_upsells->decafUpsells(); |
70
|
|
|
return true; |
71
|
|
|
} |
72
|
|
|
} |
73
|
|
|
|