| 1 |
<?php |
| 2 |
|
| 3 |
namespace cybot\cookiebot\settings\pages; |
| 4 |
|
| 5 |
use cybot\cookiebot\lib\Cookiebot_Frame; |
| 6 |
use cybot\cookiebot\lib\Cookiebot_WP; |
| 7 |
use InvalidArgumentException; |
| 8 |
use function cybot\cookiebot\lib\include_view; |
| 9 |
|
| 10 |
class Gcm_Page implements Settings_Page_Interface { |
| 11 |
|
| 12 |
const OPTION_NAME = 'cookiebot-gcm-cookies'; |
| 13 |
|
| 14 |
/** |
| 15 |
* @throws InvalidArgumentException |
| 16 |
*/ |
| 17 |
public function display() { |
| 18 |
$args = array( |
| 19 |
'cookie_categories_disabled' => Cookiebot_WP::get_cookie_categories_status(), |
| 20 |
'gcm_enabled_option' => get_option( 'cookiebot-gcm' ), |
| 21 |
'gcm_url_passthrough_option' => get_option( 'cookiebot-gcm-url-passthrough' ), |
| 22 |
'auto_disabled' => Cookiebot_WP::get_cookie_blocking_mode() === 'auto' ? ' disabled__item' : '', |
| 23 |
'is_preferences' => Cookiebot_WP::is_cookie_category_selected( self::OPTION_NAME, 'preferences' ), |
| 24 |
'is_statistics' => Cookiebot_WP::is_cookie_category_selected( self::OPTION_NAME, 'statistics' ), |
| 25 |
'is_marketing' => Cookiebot_WP::is_cookie_category_selected( self::OPTION_NAME, 'marketing' ), |
| 26 |
); |
| 27 |
|
| 28 |
include_view( Cookiebot_Frame::get_view_path() . 'settings/gcm-page.php', $args ); |
| 29 |
} |
| 30 |
} |
| 31 |
|