| 1 |
<?php |
| 2 |
namespace Elementor\Core\Schemes; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly. |
| 6 |
} |
| 7 |
|
| 8 |
/** |
| 9 |
* Elementor scheme manager. |
| 10 |
* |
| 11 |
* Elementor scheme manager handler class is responsible for registering and |
| 12 |
* initializing all the supported schemes. |
| 13 |
* |
| 14 |
* @since 1.0.0 |
| 15 |
*/ |
| 16 |
class Manager { |
| 17 |
|
| 18 |
/** |
| 19 |
* Registered schemes. |
| 20 |
* |
| 21 |
* Holds the list of all the registered schemes. |
| 22 |
* |
| 23 |
* @access protected |
| 24 |
* |
| 25 |
* @var Base[] |
| 26 |
*/ |
| 27 |
protected $_registered_schemes = []; |
| 28 |
|
| 29 |
/** |
| 30 |
* Enabled schemes. |
| 31 |
* |
| 32 |
* Holds the list of all the enabled schemes. |
| 33 |
* |
| 34 |
* @access private |
| 35 |
* @static |
| 36 |
* |
| 37 |
* @var array |
| 38 |
*/ |
| 39 |
private static $_enabled_schemes; |
| 40 |
|
| 41 |
/** |
| 42 |
* Schemes types. |
| 43 |
* |
| 44 |
* Holds the list of the schemes types. Default types are `color`, |
| 45 |
* `typography` and `color-picker`. |
| 46 |
* |
| 47 |
* @access private |
| 48 |
* @static |
| 49 |
* |
| 50 |
* @var array |
| 51 |
*/ |
| 52 |
private static $_schemes_types = [ |
| 53 |
'color', |
| 54 |
'typography', |
| 55 |
'color-picker', |
| 56 |
]; |
| 57 |
|
| 58 |
/** |
| 59 |
* Register new scheme. |
| 60 |
* |
| 61 |
* Add a new scheme to the schemes list. The method creates a new scheme |
| 62 |
* instance for any given scheme class and adds the scheme to the registered |
| 63 |
* schemes list. |
| 64 |
* |
| 65 |
* @since 1.0.0 |
| 66 |
* @access public |
| 67 |
* @deprecated 3.0.0 |
| 68 |
* |
| 69 |
* @param string $scheme_class Scheme class name. |
| 70 |
*/ |
| 71 |
public function register_scheme( $scheme_class ) {} |
| 72 |
|
| 73 |
/** |
| 74 |
* Unregister scheme. |
| 75 |
* |
| 76 |
* Removes a scheme from the list of registered schemes. |
| 77 |
* |
| 78 |
* @since 1.0.0 |
| 79 |
* @access public |
| 80 |
* @deprecated 3.0.0 |
| 81 |
* |
| 82 |
* @param string $id Scheme ID. |
| 83 |
* |
| 84 |
* @return bool True if the scheme was removed, False otherwise. |
| 85 |
*/ |
| 86 |
public function unregister_scheme( $id ) { |
| 87 |
return true; |
| 88 |
} |
| 89 |
|
| 90 |
/** |
| 91 |
* Get registered schemes. |
| 92 |
* |
| 93 |
* Retrieve the registered schemes list from the current instance. |
| 94 |
* |
| 95 |
* @since 1.0.0 |
| 96 |
* @access public |
| 97 |
* @deprecated 3.0.0 |
| 98 |
*/ |
| 99 |
public function get_registered_schemes() { |
| 100 |
return []; |
| 101 |
} |
| 102 |
|
| 103 |
/** |
| 104 |
* Get schemes data. |
| 105 |
* |
| 106 |
* Retrieve all the registered schemes with data for each scheme. |
| 107 |
* |
| 108 |
* @since 1.0.0 |
| 109 |
* @access public |
| 110 |
* @deprecated 3.0.0 |
| 111 |
* |
| 112 |
* @return array Registered schemes with each scheme data. |
| 113 |
*/ |
| 114 |
public function get_registered_schemes_data() { |
| 115 |
return []; |
| 116 |
} |
| 117 |
|
| 118 |
/** |
| 119 |
* Get default schemes. |
| 120 |
* |
| 121 |
* Retrieve all the registered schemes with default scheme for each scheme. |
| 122 |
* |
| 123 |
* @since 1.0.0 |
| 124 |
* @access public |
| 125 |
* @deprecated 3.0.0 |
| 126 |
* |
| 127 |
* @return array Registered schemes with with default scheme for each scheme. |
| 128 |
*/ |
| 129 |
public function get_schemes_defaults() { |
| 130 |
return []; |
| 131 |
} |
| 132 |
|
| 133 |
/** |
| 134 |
* Get system schemes. |
| 135 |
* |
| 136 |
* Retrieve all the registered ui schemes with system schemes for each scheme. |
| 137 |
* |
| 138 |
* @since 1.0.0 |
| 139 |
* @access public |
| 140 |
* @deprecated 3.0.0 |
| 141 |
* |
| 142 |
* @return array Registered ui schemes with with system scheme for each scheme. |
| 143 |
*/ |
| 144 |
public function get_system_schemes() { |
| 145 |
return []; |
| 146 |
} |
| 147 |
|
| 148 |
/** |
| 149 |
* Get scheme. |
| 150 |
* |
| 151 |
* Retrieve a single scheme from the list of all the registered schemes in |
| 152 |
* the current instance. |
| 153 |
* |
| 154 |
* @since 1.0.0 |
| 155 |
* @access public |
| 156 |
* @deprecated 3.0.0 |
| 157 |
* |
| 158 |
* @param string $id Scheme ID. |
| 159 |
*/ |
| 160 |
public function get_scheme( $id ) { |
| 161 |
return false; |
| 162 |
} |
| 163 |
|
| 164 |
/** |
| 165 |
* Get scheme value. |
| 166 |
* |
| 167 |
* Retrieve the scheme value from the list of all the registered schemes in |
| 168 |
* the current instance. |
| 169 |
* |
| 170 |
* @since 1.0.0 |
| 171 |
* @access public |
| 172 |
* @deprecated 3.0.0 |
| 173 |
* |
| 174 |
* @param string $scheme_type Scheme type. |
| 175 |
* @param string $scheme_value Scheme value. |
| 176 |
*/ |
| 177 |
public function get_scheme_value( $scheme_type, $scheme_value ) { |
| 178 |
return false; |
| 179 |
} |
| 180 |
|
| 181 |
/** |
| 182 |
* Print ui schemes templates. |
| 183 |
* |
| 184 |
* Used to generate the scheme templates on the editor using Underscore JS |
| 185 |
* template, for all the registered ui schemes. |
| 186 |
* |
| 187 |
* @since 1.0.0 |
| 188 |
* @access public |
| 189 |
* @deprecated 3.0.0 |
| 190 |
*/ |
| 191 |
public function print_schemes_templates() {} |
| 192 |
|
| 193 |
/** |
| 194 |
* Get enabled schemes. |
| 195 |
* |
| 196 |
* Retrieve all enabled schemes from the list of the registered schemes in |
| 197 |
* the current instance. |
| 198 |
* |
| 199 |
* @since 1.0.0 |
| 200 |
* @access public |
| 201 |
* @deprecated 3.0.0 |
| 202 |
* @static |
| 203 |
* |
| 204 |
* @return array Enabled schemes. |
| 205 |
*/ |
| 206 |
public static function get_enabled_schemes() { |
| 207 |
return []; |
| 208 |
} |
| 209 |
} |
| 210 |
|