$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);
if ($this->book->parametres->scorm_enable) {
$this->book->parametres->seoVersion = false;
}
-
+ $this->writeStats();
$this->writeSecure();
$this->log('Copied assets');
$this->loadPlugins();
$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 !== '') {