buffer
4 years ago
ioc
6 years ago
script-loader-tag
4 years ago
autoloader.php
7 years ago
cookie-consent-interface.php
7 years ago
cookie-consent.php
4 years ago
dependency-container.php
4 years ago
helper.php
4 years ago
settings-service-interface.php
4 years ago
settings-service.php
4 years ago
theme-settings-service.php
4 years ago
settings-service-interface.php
162 lines
| 1 | <?php |
| 2 | |
| 3 | namespace cookiebot_addons\lib; |
| 4 | |
| 5 | use Exception; |
| 6 | |
| 7 | /** |
| 8 | * Interface Settings_Service_Interface |
| 9 | * @package cookiebot_addons\lib |
| 10 | */ |
| 11 | interface Settings_Service_Interface { |
| 12 | |
| 13 | /** |
| 14 | * Settings_Service constructor. |
| 15 | * |
| 16 | * @param $container Dependency_Container |
| 17 | * |
| 18 | * @since 1.3.0 |
| 19 | */ |
| 20 | public function __construct( $container ); |
| 21 | |
| 22 | /** |
| 23 | * Returns true if the addon is enabled in the backend |
| 24 | * |
| 25 | * @param $addon string option name |
| 26 | * |
| 27 | * @return mixed |
| 28 | * |
| 29 | * @since 1.3.0 |
| 30 | */ |
| 31 | public function is_addon_enabled( $addon ); |
| 32 | |
| 33 | /** |
| 34 | * Returns true if the addon is installed |
| 35 | * |
| 36 | * @param $addon string plugin file, for example: test/test.php |
| 37 | * |
| 38 | * @return int|\WP_Error |
| 39 | * |
| 40 | * @since 1.3.0 |
| 41 | */ |
| 42 | public function is_addon_installed( $addon ); |
| 43 | |
| 44 | /** |
| 45 | * Returns true if the addon plugin is activated |
| 46 | * |
| 47 | * @param $addon string plugin file, for example: test/test.php |
| 48 | * |
| 49 | * @return bool |
| 50 | * |
| 51 | * @since 1.3.0 |
| 52 | */ |
| 53 | public function is_addon_activated( $addon ); |
| 54 | |
| 55 | /** |
| 56 | * Returns the addon version |
| 57 | * |
| 58 | * @param $addon |
| 59 | * |
| 60 | * @return bool |
| 61 | * |
| 62 | * @since 2.2.1 |
| 63 | */ |
| 64 | public function get_addon_version( $addon ); |
| 65 | |
| 66 | /** |
| 67 | * Returns all cookie type for given addon |
| 68 | * |
| 69 | * @param $addon string option name |
| 70 | * @param $default array default cookie types |
| 71 | * |
| 72 | * @return array |
| 73 | * |
| 74 | * @since 1.3.0 |
| 75 | */ |
| 76 | public function get_cookie_types( $addon, $default = array() ); |
| 77 | |
| 78 | /** |
| 79 | * Returns regex for given addon |
| 80 | * |
| 81 | * @param $addon string option name |
| 82 | * @param $default string default regex |
| 83 | * |
| 84 | * @return string |
| 85 | * |
| 86 | * @since 2.4.5 |
| 87 | */ |
| 88 | public function get_addon_regex( $addon, $default = '' ); |
| 89 | |
| 90 | /** |
| 91 | * Returns addons one by one through a generator |
| 92 | * |
| 93 | * @return \Generator |
| 94 | * @throws Exception |
| 95 | * |
| 96 | * @since 1.3.0 |
| 97 | */ |
| 98 | public function get_addons(); |
| 99 | |
| 100 | /** |
| 101 | * Returns active addons |
| 102 | * |
| 103 | * @return array |
| 104 | * @throws Exception |
| 105 | * |
| 106 | * @since 1.3.0 |
| 107 | */ |
| 108 | public function get_active_addons(); |
| 109 | |
| 110 | /** |
| 111 | * returns the placeholder if it does exist |
| 112 | * |
| 113 | * @param $option_key |
| 114 | * @param $default_placeholder |
| 115 | * @param $cookies |
| 116 | * @param string $src |
| 117 | * |
| 118 | * @return mixed |
| 119 | */ |
| 120 | public function get_placeholder( $option_key, $default_placeholder, $cookies, $src = '' ); |
| 121 | |
| 122 | |
| 123 | /** |
| 124 | * Check if the previous version is active |
| 125 | * |
| 126 | * @param $addons array List of addons |
| 127 | * @param $addon_class string The name of the class |
| 128 | * |
| 129 | * @return bool |
| 130 | * |
| 131 | * @since 2.1.3 |
| 132 | */ |
| 133 | public function is_previous_version_active( $addons, $addon_class ); |
| 134 | |
| 135 | /** |
| 136 | * Checks if the addon is the latest plugin version. |
| 137 | * Latest plugin version doesn't have extended class. |
| 138 | * |
| 139 | * @param $addon |
| 140 | * |
| 141 | * @return bool |
| 142 | * |
| 143 | * @since 2.1.3 |
| 144 | */ |
| 145 | public function is_latest_plugin_version( $addon ); |
| 146 | |
| 147 | /** |
| 148 | * The cookiebot plugin is deactivated |
| 149 | * so run this function to cleanup the addons. |
| 150 | * |
| 151 | * @since 2.2.0 |
| 152 | */ |
| 153 | public function cookiebot_deactivated(); |
| 154 | |
| 155 | /** |
| 156 | * The cookiebot plugin is activated and the addon settings is activated |
| 157 | * |
| 158 | * @since 3.6.3 |
| 159 | */ |
| 160 | public function cookiebot_activated(); |
| 161 | } |
| 162 |