- interface_exists: documentation ( source)
<?php
if(!interface_exists('gmTrackerInterface')) {
// require_once(dirname(__FILE__) . '/gmTrackerInterface.php');
}
/**
* Cookie approval tracking filter
*
* @package gm_Tracking
* @author Pierre GERRIER <pierre@gerrier.fr>
* @copyright © 2014 Le Groupe Moniteur
*/
class CookieApprovalTracking implements gmTrackerInterface {
static public function get_tracking_code() {
$out = '';
if(!isset($_COOKIE[COOKIE_APPROVAL_NAME])) {
$out = '<div id="bandeauCookies" class="bot" data-dom="' . COOKIE_APPROVAL_DOMAIN . '" data-name="' . COOKIE_APPROVAL_NAME . '">
<div>En poursuivant votre navigation sur ce site, vous acceptez l\'utilisation de cookies pour vous proposer des services et offres adaptés à vos centres d\'intérêt.
<a href="#" class="btOk">OK</a>
<span class="plus">
<a href="http://www.infopro-digital.com/cookies/" target="_blank"><span class="fleche"></span>En savoir plus</a>
<a href="#" class="fermer" title="Fermer">X</a>
</span>
</div>
</div>';
}
return $out;
}
static public function get_admin_bar_label() {
return 'Cookie approval ' . (static::$active ? 'Activé' : 'Désactivé');
}
static public function get_admin_bar_content() {
return false;
}
}
/**
* Base interface for user-tracking filters
*
* @package gm_Tracking
* @author Pierre GERRIER <pierre@gerrier.fr>
* @copyright © 2013 Le Groupe Moniteur
*/
interface gmTrackerInterface {
/**
* Computes the tracking code
*
* You should override this method when you add
* a new tracking filter.
*
* @return string The tracking markup to be inserted
*/
static public function get_tracking_code();
/**
* Provides the label displayed in the admin bar menu
* @return string
*/
static public function get_admin_bar_label();
/**
* Provides the content displayed in the admin bar menu
* @return false|string
*/
static public function get_admin_bar_content();
}