Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/elementor/core/modules-manager.php
Keine Baseline-Datei – Diff nur gegen leer.
1
-
1
+
<?php
2
+
namespace Elementor\Core;
3
+
4
+
use Elementor\Core\Base\Module;
5
+
use Elementor\Plugin;
6
+
7
+
if ( ! defined( 'ABSPATH' ) ) {
8
+
exit; // Exit if accessed directly.
9
+
}
10
+
11
+
/**
12
+
* Elementor modules manager.
13
+
*
14
+
* Elementor modules manager handler class is responsible for registering and
15
+
* managing Elementor modules.
16
+
*
17
+
* @since 1.6.0
18
+
*/
19
+
class Modules_Manager {
20
+
21
+
/**
22
+
* Registered modules.
23
+
*
24
+
* Holds the list of all the registered modules.
25
+
*
26
+
* @since 1.6.0
27
+
* @access public
28
+
*
29
+
* @var array
30
+
*/
31
+
private $modules = [];
32
+
33
+
/**
34
+
* Modules manager constructor.
35
+
*
36
+
* Initializing the Elementor modules manager.
37
+
*
38
+
* @since 1.6.0
39
+
* @access public
40
+
*/
41
+
public function __construct() {
42
+
$modules_namespace_prefix = $this->get_modules_namespace_prefix();
43
+
44
+
foreach ( $this->get_modules_names() as $module_name ) {
45
+
$class_name = str_replace( '-', ' ', $module_name );
46
+
47
+
$class_name = str_replace( ' ', '', ucwords( $class_name ) );
48
+
49
+
$class_name = $modules_namespace_prefix . '\\Modules\\' . $class_name . '\Module';
50
+
51
+
/** @var Module $class_name */
52
+
53
+
$experimental_data = $class_name::get_experimental_data();
54
+
55
+
if ( $experimental_data ) {
56
+
Plugin::$instance->experiments->add_feature( $experimental_data );
57
+
58
+
if ( ! Plugin::$instance->experiments->is_feature_active( $experimental_data['name'] ) ) {
59
+
continue;
60
+
}
61
+
}
62
+
63
+
if ( $class_name::is_active() ) {
64
+
$this->modules[ $module_name ] = $class_name::instance();
65
+
}
66
+
}
67
+
}
68
+
69
+
/**
70
+
* Get modules names.
71
+
*
72
+
* Retrieve the modules names.
73
+
*
74
+
* @since 2.0.0
75
+
* @access public
76
+
*
77
+
* @return string[] Modules names.
78
+
*/
79
+
public function get_modules_names() {
80
+
return [
81
+
'admin-bar',
82
+
'history',
83
+
'library',
84
+
'dynamic-tags',
85
+
'page-templates',
86
+
'gutenberg',
87
+
'wp-cli',
88
+
'wp-rest',
89
+
'safe-mode',
90
+
'ai',
91
+
'notifications',
92
+
'usage',
93
+
'dev-tools',
94
+
'landing-pages',
95
+
'compatibility-tag',
96
+
'generator-tag',
97
+
'elements-color-picker',
98
+
'elementor-counter',
99
+
'shapes',
100
+
'favorites',
101
+
'admin-top-bar',
102
+
'element-manager',
103
+
'pro-free-trial-popup',
104
+
'nested-elements',
105
+
// Depends on Nested Elements module
106
+
'nested-tabs',
107
+
'nested-accordion',
108
+
'container-converter',
109
+
'web-cli',
110
+
'promotions',
111
+
'pro-install',
112
+
'notes',
113
+
'performance-lab',
114
+
'lazyload',
115
+
'image-loading-optimization',
116
+
'kit-elements-defaults',
117
+
'announcements',
118
+
'editor-app-bar',
119
+
'site-navigation',
120
+
'styleguide',
121
+
'element-cache',
122
+
'apps',
123
+
'home',
124
+
'link-in-bio',
125
+
'floating-buttons',
126
+
'content-sanitizer',
127
+
'atomic-widgets',
128
+
'global-classes',
129
+
'variables',
130
+
'wc-product-editor',
131
+
'checklist',
132
+
'cloud-library',
133
+
'cloud-kit-library',
134
+
'atomic-opt-in',
135
+
'components',
136
+
'interactions',
137
+
'editor-one',
138
+
];
139
+
}
140
+
141
+
/**
142
+
* Get modules.
143
+
*
144
+
* Retrieve all the registered modules or a specific module.
145
+
*
146
+
* @since 2.0.0
147
+
* @access public
148
+
*
149
+
* @param string $module_name Module name.
150
+
*
151
+
* @return null|Module|Module[] All the registered modules or a specific module.
152
+
*/
153
+
public function get_modules( $module_name ) {
154
+
if ( $module_name ) {
155
+
if ( isset( $this->modules[ $module_name ] ) ) {
156
+
return $this->modules[ $module_name ];
157
+
}
158
+
159
+
return null;
160
+
}
161
+
162
+
return $this->modules;
163
+
}
164
+
165
+
/**
166
+
* Get modules namespace prefix.
167
+
*
168
+
* Retrieve the modules namespace prefix.
169
+
*
170
+
* @since 2.0.0
171
+
* @access protected
172
+
*
173
+
* @return string Modules namespace prefix.
174
+
*/
175
+
protected function get_modules_namespace_prefix() {
176
+
return 'Elementor';
177
+
}
178
+
}
179
+