forked from franck-paul/googleTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_public.php
More file actions
executable file
·46 lines (40 loc) · 1.72 KB
/
_public.php
File metadata and controls
executable file
·46 lines (40 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
/**
* @brief googleTools, a plugin for Dotclear 2
*
* @package Dotclear
* @subpackage Plugins
*
* @author xave and contributors
*
* @copyright xave
* @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html
*/
if (!defined('DC_RC_PATH')) {
return;
}
dcCore::app()->addBehavior('publicHeadContent', ['googlestuffPublicBehaviours', 'publicHeadContent']);
class googlestuffPublicBehaviours
{
public static function publicHeadContent($core = null)
{
$res = '';
if (dcCore::app()->blog->settings->googlestuff->googlestuff_verify != '') {
$res .= '<meta name="google-site-verification" content="' . dcCore::app()->blog->settings->googlestuff->googlestuff_verify . '" />' . "\n";
}
if (dcCore::app()->blog->settings->googlestuff->googlestuff_uacct != '') {
$res .= dcUtils::jsJson('googletools_ga', ['uacct' => dcCore::app()->blog->settings->googlestuff->googlestuff_uacct]) .
dcUtils::jsModuleLoad('googleTools/js/ga.js');
if (dcCore::app()->blog->settings->googlestuff->cnil_cookies) {
// Includes French CNIL consent check if required
$res .= dcUtils::jsJson('googletools_cnil', [
'uacct' => dcCore::app()->blog->settings->googlestuff->googlestuff_uacct,
'query' => __('This site use Google Analytics cookies in order to tracking visits. If you want to avoid this, click <a href="javascript:gaOptout()">here</a>.'),
'denied' => __('No Google Analytics cookies will be created for tracking your visits on this site.'),
]) .
dcUtils::jsModuleLoad('googleTools/js/cnil.js');
}
}
echo $res;
}
}