buffer
1 year ago
script_loader_tag
4 months ago
traits
3 months ago
Account_Service.php
3 months ago
Consent_API_Helper.php
1 year ago
Cookie_Consent.php
3 months ago
Cookie_Consent_Interface.php
1 year ago
Cookiebot_Activated.php
4 months ago
Cookiebot_Admin_Links.php
1 year ago
Cookiebot_Automatic_Updates.php
1 year ago
Cookiebot_Deactivated.php
5 months ago
Cookiebot_Frame.php
1 year ago
Cookiebot_Javascript_Helper.php
7 months ago
Cookiebot_Review.php
3 months ago
Cookiebot_WP.php
1 week ago
Dependency_Container.php
3 months ago
Settings_Page_Tab.php
1 year ago
Settings_Service.php
1 year ago
Settings_Service_Interface.php
1 year ago
Supported_Languages.php
1 year ago
Supported_Regions.php
1 year ago
WP_Rocket_Helper.php
1 year ago
Widgets.php
1 year ago
global-deprecations.php
1 year ago
helper.php
3 months ago
Cookiebot_Frame.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace cybot\cookiebot\lib; |
| 4 | |
| 5 | class Cookiebot_Frame { |
| 6 | |
| 7 | public static function is_cb_frame_type( $multisite = false ) { |
| 8 | $cbid = $multisite ? Cookiebot_WP::get_network_cbid() : Cookiebot_WP::get_cbid(); |
| 9 | if ( empty( $cbid ) ) { |
| 10 | return 'empty'; |
| 11 | } elseif ( preg_match( self::CB_FRAME_REGEX, $cbid ) ) { |
| 12 | return true; |
| 13 | } else { |
| 14 | return false; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | public static function get_view_path( $multisite = false, $is_common = false ) { |
| 19 | if ( self::is_cb_frame_type( $multisite ) === 'empty' || $is_common ) { |
| 20 | return 'admin/common/'; |
| 21 | } elseif ( self::is_cb_frame_type( $multisite ) === true ) { |
| 22 | return 'admin/cb_frame/'; |
| 23 | } else { |
| 24 | return 'admin/uc_frame/'; |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | const CB_FRAME_REGEX = '/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/'; |
| 29 | } |
| 30 |