349 lines
7.7 KiB
PHP
349 lines
7.7 KiB
PHP
<?php
|
|
|
|
|
|
|
|
// Prise en compte Thelia 1.4.0
|
|
|
|
@include_once(realpath(dirname(__FILE__)) . "/../../../fonctions/authplugins.php");
|
|
|
|
|
|
|
|
if (function_exists('autorisation')) autorisation("ganalytics");
|
|
|
|
|
|
|
|
include_once("pre.php");
|
|
|
|
include_once("auth.php");
|
|
|
|
|
|
|
|
include_once(realpath(dirname(__FILE__)) . "/Ganalytics.class.php");
|
|
|
|
$Ganalytics = new Ganalytics();
|
|
|
|
|
|
|
|
foreach($Ganalytics->langues as $lang){
|
|
|
|
$_codeGA = 'codeGA'.$lang['id'];
|
|
|
|
$$_codeGA = $Ganalytics->getVar($_codeGA);
|
|
|
|
$_profGA = 'profGA'.$lang['id'];
|
|
|
|
$$_profGA = $Ganalytics->getVar($_profGA);
|
|
|
|
$_urlsiteGA = 'urlsiteGA'.$lang['id'];
|
|
|
|
$$_urlsiteGA = $Ganalytics->getVar($_urlsiteGA);
|
|
|
|
}
|
|
|
|
|
|
|
|
$_mailGA = $Ganalytics->getVar('mailGA');
|
|
|
|
$_passGA = $Ganalytics->getVar('passGA');
|
|
|
|
$_apiKeyGA = $Ganalytics->getVar('apiKeyGA');
|
|
|
|
$ga_logs = $Ganalytics->getVar('ga_suivi_std');
|
|
|
|
$ga_suivi_std = $Ganalytics->getVar('ga_logs');
|
|
|
|
|
|
|
|
// Enregistrement des variables de config :
|
|
|
|
if($action == 'modifier')
|
|
|
|
{
|
|
|
|
foreach($Ganalytics->langues as $lang){
|
|
|
|
$_codeGA = 'codeGA'.$lang['id'];
|
|
|
|
$_profGA = 'profGA'.$lang['id'];
|
|
|
|
$$_codeGA->valeur = $_POST['codeGA'.$lang['id']];
|
|
|
|
$$_profGA->valeur = $_POST['profGA'.$lang['id']];
|
|
|
|
$$_codeGA->maj();
|
|
|
|
$$_profGA->maj();
|
|
|
|
if($_POST['urlsiteGA'.$lang['id']]){
|
|
|
|
$_urlsiteGA = 'urlsiteGA'.$lang['id'];
|
|
|
|
$$_urlsiteGA->valeur = $_POST['urlsiteGA'.$lang['id']];
|
|
|
|
$$_urlsiteGA->maj();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
$_mailGA->valeur = $_POST['mailGA'];
|
|
|
|
$_passGA->valeur = $_POST['passGA'];
|
|
|
|
$_apiKeyGA->valeur = $_POST['apiKeyGA'];
|
|
|
|
$ga_suivi_std->valeur = ($_POST['ga_suivi_std']) ? 1 : 0 ;
|
|
|
|
$ga_logs->valeur = ($_POST['ga_logs']) ? 1 : 0 ;
|
|
|
|
|
|
|
|
$_mailGA->maj();
|
|
|
|
$_passGA->maj();
|
|
|
|
$_apiKeyGA->maj();
|
|
|
|
$ga_suivi_std->maj();
|
|
|
|
$ga_logs->maj();
|
|
|
|
|
|
|
|
$tabstmp = array('ga_insert_statuts','ga_annul_statuts');
|
|
|
|
foreach($tabstmp as $tab){
|
|
|
|
$var = new variable();
|
|
|
|
$var->charger($tab);
|
|
|
|
$var->valeur = implode(',',$_POST[$tab]);
|
|
|
|
$var->maj();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$ga_suivi_std_check = ($ga_suivi_std->valeur) ? 'checked="checked"' : '';
|
|
|
|
$ga_logs_check = ($ga_logs->valeur) ? 'checked="checked"' : '';
|
|
|
|
$ga_insert_statuts = $Ganalytics->getArrayFromStringVar('ga_insert_statuts');
|
|
|
|
$ga_annul_statuts = $Ganalytics->getArrayFromStringVar('ga_annul_statuts'); ?>
|
|
|
|
|
|
|
|
<div id="contenu_int">
|
|
|
|
<p>
|
|
|
|
<a class="lien04" href="accueil.php">Accueil</a>
|
|
|
|
<img width="12" height="9" border="0" src="gfx/suivant.gif"><a class="lien04" href="module_liste.php">Modules</a>
|
|
|
|
<img width="12" height="9" border="0" src="gfx/suivant.gif"><a class="lien04" href="module.php?nom=ganalytics">Google Analytics</a>
|
|
|
|
</p>
|
|
|
|
<img src="../client/plugins/<?php echo Ganalytics::MODULE ?>/logo.png" alt="" style="float:right; margin:0px 50px 0px 0px;" />
|
|
|
|
<div id="bloc_description">
|
|
|
|
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" name="formganalytics" method="post">
|
|
|
|
<input type="hidden" name="nom" value="ganalytics" />
|
|
|
|
<input type="hidden" name="action" value="modifier" />
|
|
|
|
<div class="entete">
|
|
|
|
<div class="titre">CONFIGURATION</div>
|
|
|
|
<div class="fonction_valider"><a href="#" onClick="formganalytics.submit(); return false;">VALIDER LES MODIFICATIONS</a></div>
|
|
|
|
</div>
|
|
|
|
<table width="100%" cellpadding="5" cellspacing="0">
|
|
|
|
<tr class="fonce">
|
|
|
|
<td width="30%" class="designation">Email du compte Analytics <br/></td>
|
|
|
|
<td><input type="text" size="50" name="mailGA" value="<?php echo $_mailGA->valeur ?>"></td>
|
|
|
|
</tr>
|
|
|
|
<tr class="claire">
|
|
|
|
<td width="30%" class="designation">Password du compte Analytics <br/></td>
|
|
|
|
<td><input type="password" size="50" name="passGA" value="<?php echo $_passGA->valeur ?>"></td>
|
|
|
|
</tr>
|
|
|
|
<tr class="claire">
|
|
|
|
<td width="30%" class="designation">Api Key *<br/></td>
|
|
|
|
<td><input type="text" size="50" name="apiKeyGA" value="<?php echo $_apiKeyGA->valeur ?>"></td>
|
|
|
|
</tr><?php
|
|
|
|
foreach($Ganalytics->langues as $lang){
|
|
|
|
$_codeGA = 'codeGA'.$lang['id'];
|
|
|
|
$_profGA = 'profGA'.$lang['id'];
|
|
|
|
$_urlsiteGA = 'urlsiteGA'.$lang['id'];
|
|
|
|
?>
|
|
|
|
<tr class="fonce">
|
|
|
|
<td width="30%" class="designation">Code de suivi Analytics <span style="color:#FFF;font-weight:bold"><?php echo $lang['description'] ?></span><br/>(UA-xxxxxxx-xx)</td>
|
|
|
|
<td><input type="text" size="50" name="codeGA<?php echo $lang['id'] ?>" value="<?php echo $$_codeGA->valeur ?>"></td>
|
|
|
|
</tr>
|
|
|
|
<tr class="claire">
|
|
|
|
<td width="30%" class="designation">Id du profil Analytics <span style="color:#FFF;font-weight:bold"><?php echo $lang['description'] ?></span><br/></td>
|
|
|
|
<td><input type="text" size="50" name="profGA<?php echo $lang['id'] ?>" value="<?php echo $$_profGA->valeur ?>"></td>
|
|
|
|
</tr>
|
|
|
|
<?php
|
|
|
|
|
|
|
|
if(!$Ganalytics->is_sup_15()){ ?>
|
|
|
|
<tr class="fonce">
|
|
|
|
<td width="30%" class="designation">Nom de domaine<br /> <span style="color:#FFF;font-weight:bold"><?php echo $lang['description'] ?></span><br/></td>
|
|
|
|
<td><input type="text" size="50" name="urlsiteGA<?php echo $lang['id'] ?>" value="<?php echo $$_urlsiteGA->valeur ?>"></td>
|
|
|
|
</tr><?php
|
|
|
|
}
|
|
|
|
}?>
|
|
|
|
<tr class="fonce">
|
|
|
|
<td width="30%" class="designation">Inclure le suivi analytics "standard" sur toutes les pages du site</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="ga_suivi_std" <?php echo $ga_suivi_std_check ?>/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="claire">
|
|
|
|
<td width="30%" class="designation">Activer le fichier de logs</td>
|
|
|
|
<td>
|
|
|
|
<input type="checkbox" name="ga_logs" <?php echo $ga_logs_check ?>/>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="fonce">
|
|
|
|
<td width="30%" class="designation">Statuts déclenchant l'insertion d'une commande dans Google Analytics</td>
|
|
|
|
<td>
|
|
|
|
<select multiple="multiple" style="width:325px" size="10" name="ga_insert_statuts[]" class="form"><?php
|
|
|
|
$statut = new Statut();
|
|
|
|
$query = "select * from $statut->table";
|
|
|
|
$resul = mysql_query($query);
|
|
|
|
while($row = mysql_fetch_object($resul))
|
|
|
|
{
|
|
|
|
$statutdesc = new Statutdesc();
|
|
|
|
$statutdesc->charger($row->id);
|
|
|
|
$selected = (in_array($row->id, $ga_insert_statuts)) ? 'selected="selected"' : '' ?>
|
|
|
|
<option value="<?php echo $row->id ?>" <?php echo $selected; ?>>
|
|
|
|
<?php echo($statutdesc->titre); ?>
|
|
|
|
</option><?php
|
|
|
|
}?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<tr class="claire">
|
|
|
|
<td width="30%" class="designation">Statuts déclenchant l'annulation d'une commande dans Google Analytics</td>
|
|
|
|
<td>
|
|
|
|
<select multiple="multiple" style="width:325px" size="10" name="ga_annul_statuts[]" class="form"><?php
|
|
|
|
$statut = new Statut();
|
|
|
|
$query = "select * from $statut->table";
|
|
|
|
$resul = mysql_query($query);
|
|
|
|
while($row = mysql_fetch_object($resul))
|
|
|
|
{
|
|
|
|
$statutdesc = new Statutdesc();
|
|
|
|
$statutdesc->charger($row->id);
|
|
|
|
$selected = (in_array($row->id, $ga_annul_statuts)) ? 'selected="selected"' : '' ?>
|
|
|
|
<option value="<?php echo $row->id ?>" <?php echo $selected; ?>>
|
|
|
|
<?php echo($statutdesc->titre); ?>
|
|
|
|
</option><?php
|
|
|
|
}?>
|
|
|
|
</select>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<p style="clear: both; margin-top: 30px;color:#505050;font-size:9px;text-align:left;">Plugin Thelia réalisé par <a href="http://www.speedyweb.fr">Speedyweb</a>. Contact: <a href="mailto:contact@speedyweb.fr">contact@speedyweb.fr</a> - <a href="../client/plugins/<?php echo Ganalytics::MODULE?>/readme-viewer.php" target="readme">Fichier Readme.txt</a></p>
|
|
|
|
</div>
|