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