]> _ Git - cubeextranet.git/commitdiff
wip #3839 @1.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Aug 2020 16:46:16 +0000 (16:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 18 Aug 2020 16:46:16 +0000 (16:46 +0000)
inc/ws/Metier/class.ws.book.parametres.php
inc/ws/Util/html5/master/class.ws.html5.compiler.php
inc/ws/Util/html5/master/class.ws.html5.seo.php

index 2f53658511e3133a3ec316422f3f46bd350fc209..f691ba418b6040de284035d4252cc6179aee655e 100644 (file)
@@ -349,8 +349,12 @@ class wsBookParametres extends wsParametres
         $this->fields['statsCustom'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code Stats personnalisé (placé avant fermeture du body)'));
         $this->fields['xiti'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Code XiTi global'));
         $this->fields['xiti_page'] = array('type' => 'textarea', 'default' => '', 'editable' => true, 'label' => __('Modèle code xiti (pour tags relatifs aux pages)'));
+        $this->fields['tagcommander_id'] = ['type' => 'text', 'default' => '', 'editable' => true, 'label' => 'Tag commander ID', 'grade' => 3];
+        $this->fields['tagcommander_prod'] = ['type' => 'boolean', 'default' => true, 'editable' => true, 'label' => 'Production', 'grade' => 3];
+        $this->fields['tagcommander_plan'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => 'Plan de taggage "Tag commander"', 'grade' => 3];
+        $this->fields['tagcommander_default_vars'] = ['type' => 'textarea', 'default' => '', 'editable' => true, 'label' => 'Variables par défaut', 'grade' => 3];
         $this->forms['stats'] = array('label' => __('Statistiques'),
-            'fieldsnames' => array('stats', 'stats_score', 'stats_exclude_ip', '|', 'relay_url_params', '|', 'googleAnalytics', '|', 'googleAnalyticsCustom', 'statsCustom', '|', 'xiti', 'xiti_page'));
+            'fieldsnames' => array('stats', 'stats_score', 'stats_exclude_ip', '|', 'relay_url_params', '|', 'googleAnalytics', '|', 'googleAnalyticsCustom', 'statsCustom', '|', 'xiti', 'xiti_page', '|', 'tagcommander_id','tagcommander_prod', 'tagcommander_plan', 'tagcommander_default_vars'));
 
         $this->fields['displayChaptersPopup'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __('Always display chapters in a popup'), 'grade' => 1);
         $this->fields['displayChaptersIcon'] = array('type' => 'boolean', 'default' => true, 'editable' => true, 'label' => __("Affiche l'icône du sommaire"), 'grade' => 1);
index 8652544a091fcff9fa6cc737e254fab86dc25339..82a2bdb58fd7cd591186dee29fcc4e27eeb9bcf2 100644 (file)
@@ -576,7 +576,7 @@ class wsHTML5Compiler
         if ($this->book->parametres->scorm_enable) {
             $this->book->parametres->seoVersion = false;
         }
-
+        $this->writeStats();
         $this->writeSecure();
         $this->log('Copied assets');
         $this->loadPlugins();
@@ -617,6 +617,19 @@ class wsHTML5Compiler
         $this->log('Files Synced');
     }
 
+    protected function writeStats()
+    {
+        if ($this->book->parametres->tagcommander_id) {
+            $id = $this->book->parametres->tagcommander_id;
+            if (!$this->book->parametres->tagcommander_prod) {
+                $id .= '/uat';
+            }
+            $this->book->parametres->googleAnalyticsCustom .= '<script src="//cdn.tagcommander.com/' . $id . '/tc_Multisite_Head.js"></script>';
+            $this->book->parametres->statsCustom .= '<script src="//cdn.tagcommander.com/' . $id . '/tc_Multisite_Analytics.js"></script>';
+            $this->book->parametres->statsCustom .= '<script src="//cdn.tagcommander.com/' . $id . '/tc_Multisite_Medias.js"></script>';
+        }
+    }
+
     protected function writeSecure()
     {
         if ($this->book->parametres->secureClientSidePassword !== '') {
index a7bc5586d1e0e4e7659dfdefb440736f0df0030c..5e4812db4381c18be7070b18daee1c495012fa3e 100644 (file)
@@ -224,8 +224,6 @@ class wsHTML5SeoPage
 \r
     public function getSEOContent()\r
     {\r
-\r
-\r
         $res = '';\r
         if (null !== $this->h1) {\r
             $res .= '<h1>' . htmlentities($this->h1) . '</h1>';\r