Browse Source

Meilleure gestion des services en fonction de leur type

pull/19/head
Chancellier Pierre-Jean 9 months ago
parent
commit
ba09079ff8
  1. 2
      README.md
  2. 3
      action/tarteaucitron_activer_service.php
  3. 96
      action/tarteaucitron_referencer_services.php
  4. 7
      formulaires/configurer_tarteaucitron_services.php
  5. 28
      inc/tarteaucitron.php
  6. 2
      json/services.json
  7. 1
      modeles/tac_acast.html
  8. 1
      modeles/tac_addthis.html
  9. 1
      modeles/tac_addtoanyfeed.html
  10. 1
      modeles/tac_addtoanyshare.html
  11. 1
      modeles/tac_adform.html
  12. 1
      modeles/tac_adsense.html
  13. 1
      modeles/tac_adsensesearchform.html
  14. 1
      modeles/tac_adsensesearchresult.html
  15. 2
      modeles/tac_aduptech_ads.html
  16. 3
      modeles/tac_aduptech_conversion.html
  17. 4
      modeles/tac_aduptech_retargeting.html
  18. 1
      modeles/tac_amazon.html
  19. 1
      modeles/tac_artetv.html
  20. 1
      modeles/tac_ausha.html
  21. 1
      modeles/tac_bandcamp.html
  22. 1
      modeles/tac_bingads.html
  23. 1
      modeles/tac_calameo.html
  24. 4
      modeles/tac_canalu.html
  25. 1
      modeles/tac_clicmanager.html
  26. 1
      modeles/tac_criteo.html
  27. 9
      modeles/tac_dailymotion.html
  28. 1
      modeles/tac_datingaffiliation.html
  29. 1
      modeles/tac_datingaffiliationpopup.html
  30. 1
      modeles/tac_deezer.html
  31. 1
      modeles/tac_discord.html
  32. 1
      modeles/tac_disqus.html
  33. 6
      modeles/tac_facebook.html
  34. 1
      modeles/tac_facebookcomment.html
  35. 1
      modeles/tac_facebooklikebox.html
  36. 1
      modeles/tac_facebookpost.html
  37. 1
      modeles/tac_fculture.html
  38. 1
      modeles/tac_ferankpub.html
  39. 6
      modeles/tac_gagenda.html
  40. 1
      modeles/tac_gdocs.html
  41. 1
      modeles/tac_genially.html
  42. 1
      modeles/tac_gforms.html
  43. 1
      modeles/tac_googleadwordsconversion.html
  44. 1
      modeles/tac_googlemaps.html
  45. 1
      modeles/tac_googlemapssearch.html
  46. 1
      modeles/tac_googlepartners.html
  47. 1
      modeles/tac_gplus.html
  48. 1
      modeles/tac_gplusbadge.html
  49. 1
      modeles/tac_gsheets.html
  50. 1
      modeles/tac_gslides.html
  51. 1
      modeles/tac_hcaptcha.html
  52. 1
      modeles/tac_helloasso.html
  53. 1
      modeles/tac_instagram.html
  54. 1
      modeles/tac_issuu.html
  55. 1
      modeles/tac_linkedin.html
  56. 1
      modeles/tac_maps_noapi.html
  57. 1
      modeles/tac_mixcloud.html
  58. 1
      modeles/tac_outbrain.html
  59. 1
      modeles/tac_pinterest.html
  60. 1
      modeles/tac_podcloud.html
  61. 1
      modeles/tac_prelinker.html
  62. 1
      modeles/tac_prezi.html
  63. 1
      modeles/tac_pubdirecte.html
  64. 1
      modeles/tac_recaptcha.html
  65. 1
      modeles/tac_shareaholic.html
  66. 1
      modeles/tac_shareasale.html
  67. 1
      modeles/tac_sharethis.html
  68. 1
      modeles/tac_slideshare.html
  69. 1
      modeles/tac_soundcloud.html
  70. 1
      modeles/tac_spotify.html
  71. 1
      modeles/tac_timelinejs.html
  72. 1
      modeles/tac_twenga.html
  73. 1
      modeles/tac_twitter.html
  74. 1
      modeles/tac_twitterembed.html
  75. 1
      modeles/tac_twittertimeline.html
  76. 6
      modeles/tac_vimeo.html
  77. 1
      modeles/tac_vshop.html
  78. 1
      modeles/tac_xandrconversion.html
  79. 1
      modeles/tac_xandrsegment.html
  80. 16
      modeles/tac_youtube.html
  81. 54
      tarteaucitron_pipelines.php

2
README.md

@ -12,7 +12,7 @@ La documentation est ici : https://contrib.spip.net/Tarteaucitron-5292
3. Au besoin, renseignez les paramètres nécessaires dans la liste des services activés
4. Recherchez votre service sur https://tarteaucitron.io/fr/install/ (Etape 3 : ajouter les services) et pensez à supprimer le marqueur du service sur votre site web s'il est présent.
4. Recherchez votre service sur https://tarteaucitron.io/fr/install/ (Etape 3 : ajouter les services) et pensez à supprimer (ou à remplacer selon les cas) le marqueur du service dans vos squelettes s'il est présent. Si le marqueur est situé dans du contenu éditorial (le texte d'un article par exemple), ne tenez pas compe du marqueur et passez à l'étape 4.
4. Certains services peuvent concerner du contenu éditorial. Dans ce cas, le rédacteur peut insérer un service directement via le porte-plume. Si l'entrée n'existe pas dans le porte-plume, créez une issue ou une Pull-Request sur [gitea](https://git.spip.net/spip-contrib-extensions/tarteaucitron/) (il suffit de créer un fichier modeles/tac_monservice.html et une icône carrée dans icones_barre/monservice.png en 17px de côté). Si des articles antérieurs contiennent des iframes pour ces services, il faut traiter le contenu ancien.

3
action/tarteaucitron_activer_service.php

@ -39,14 +39,13 @@ function action_tarteaucitron_activer_service_dist(){
$services_actifs = lire_config("tarteaucitron/services");
$services_actifs[$service] = array();
// TODO : récupérer les params dans le fichier JSON
$json_source = find_in_path('json/services.json');
$json = file_get_contents($json_source);
$parsed_json = json_decode($json);
$params = $parsed_json->{$service}->{'params'};
foreach($params as $param) {
$services_actifs[$service][$param] = $param;
$services_actifs[$service][$param] = substr($param,5);
}
ecrire_config("tarteaucitron/services/", $services_actifs);

96
action/tarteaucitron_referencer_services.php

@ -28,8 +28,9 @@ function action_tarteaucitron_referencer_services_dist(){
$service = $matches[1];
$list_services[$service] = array();
$list_services[$service]['params'] = array();
if (preg_match('/"type": "(\w+)",/', $lines[$i+2], $matches)) {
if (preg_match('/["\']?type["\']?: ["\'](\w+)["\'],/', $lines[$i+2], $matches)) {
$type = $matches[1];
$list_services[$service]['type'] = $type;
}
@ -52,36 +53,94 @@ function action_tarteaucitron_referencer_services_dist(){
$id = $div_service->lastChild->attributes['id']->value;
$div_code = $doc->getElementById('m' . $id);
$span_list = $div_code->getElementsByTagName('span');
$is_code_js_found = false;
$nb_items = $span_list->length;
$k = 0;
$is_modele_found = false;
$is_service_hidden = in_array($list_services[$service]['type'],array('support','analytic'));
if (!$is_service_hidden) {
$list_services[$service]['params_modele'] = array();
}
// Pour chaque span.code
for($i=0; $i<$nb_items; $i++) {
$span = $span_list->item($i);
$attributes = $span->attributes;
foreach($attributes as $attr_name => $attr) {
if ($attr_name == "class" && $attr->value == "code" && !$is_code_js_found) {
$class_attr = $span->attributes->getNamedItem("class");
if ((!is_null($class_attr)) && ($class_attr->nodeValue=='code')) {
$k++;
// Récupère le code JS pour activer le service
if ($k==1) {
$param_list = $span->getElementsByTagName('b');
$j = $param_list->length -1;
$list_services[$service]['params'] = array();
$nb_params = $param_list->length;
$j = $nb_params -1;
while ($j > -1) {
$param = $param_list[$j];
$nom_param = str_replace(" ","_",$param->textContent);
$nom_param = "ptac_" . str_replace(" ","_",$param->textContent);
$newelement = $doc->createTextNode("'" . $nom_param . "'");
$span->replaceChild($newelement,$param);
array_unshift($list_services[$service]['params'],$nom_param);
$j--;
}
$s = $span->getElementsByTagName('s');
$span->removeChild($s[0]);
$script = trim(strip_tags($span->nodeValue));
$script = preg_replace('/(\n\s+)/', "\n", $script);
$script = str_replace("''","'",$script);
$list_services[$service]['JS'] = $script;
$is_code_js_found = true;
}
// Récupère le modèle HTML
} elseif (($i!=$nb_items-1) && (!$is_modele_found)) {
$is_modele_found = true;
$param_list = $span->getElementsByTagName('b');
$nb_params = $param_list->length;
$j = $nb_params -1;
while ($j > -1) {
$param = $param_list[$j];
$nom_param = str_replace(" ","_",$param->textContent);
if ($is_service_hidden) {
$nom_param = "ptac_" . $nom_param;
if (!in_array($nom_param,$list_services[$service]['params'])) {
array_unshift($list_services[$service]['params'],$nom_param);
}
} else {
if (preg_match('/(_\(.+\))/',$nom_param,$matches)) {
$nom_param = str_replace($matches[1],"", $nom_param);
}
array_unshift($list_services[$service]['params_modele'],$nom_param);
$nom_param = "[(#ENV{" . $nom_param . "})]";
}
$newelement = $doc->createTextNode($nom_param);
$span->replaceChild($newelement,$param);
$j--;
}
$script = trim($span->nodeValue);
$script = preg_replace('/(\n\s+)/', "\n", $script);
$script = str_replace("''","'",$script);
if ($is_service_hidden) {
$script = strip_tags($script);
$list_services[$service]['JS'] = $script . "\n" . $list_services[$service]['JS'];
} else {
$fichier_modele = _DIR_PLUGIN_TARTEAUCITRON . "modeles/tac_" . $service . ".html";
file_put_contents($fichier_modele, $script);
}
}
}
}
foreach($list_services[$service] as $prop => $value) {
if (empty($list_services[$service][$prop])) {
unset($list_services[$service][$prop]);
}
}
} else {
@ -91,8 +150,11 @@ function action_tarteaucitron_referencer_services_dist(){
// Création du JSON avec les services, leur type, leur(s) paramètre(s) et le code JS associé
$file_json = find_in_path('json/services.json');
file_put_contents($file_json, json_encode($list_services));
echo "Opération réussie !<br>";
echo "Le fichier <b>" . $file_json . "</b> a été mis à jour.";
if (file_put_contents($file_json, json_encode($list_services))) {
echo "Opération réussie !<br>";
echo "Le fichier <b>" . $file_json . "</b> a été mis à jour.";
} else {
echo "Erreur lors de l'écriture du fichier " . $file_json . ".";
}
}

7
formulaires/configurer_tarteaucitron_services.php

@ -10,7 +10,7 @@ function formulaires_configurer_tarteaucitron_services_charger_dist(){
if (!empty($params)) {
$i = 0;
foreach($params as $name => $value) {
$valeurs[$service . '_p' . $i . '_' . $name] = $value;
$valeurs[$service . '_p' . $i . '_' . substr($name,5)] = $value;
$i++;
}
}
@ -27,7 +27,7 @@ function formulaires_configurer_tarteaucitron_services_traiter_dist(){
if (!empty($params)) {
$i = 0;
foreach($params as $name => $value) {
$valeur_saisie = _request($service . '_p' . $i . '_' . $name);
$valeur_saisie = _request($service . '_p' . $i . '_' . substr($name,5));
$valeur_saisie = is_null($valeur_saisie) ? '' : $valeur_saisie;
$services_actifs[$service][$name] = $valeur_saisie;
$i++;
@ -75,7 +75,8 @@ function formulaires_configurer_tarteaucitron_services_saisies_dist(){
$fieldset['saisies'][] = $champ;
$i = 0;
foreach($params as $param => $value) {
foreach($params as $param) {
$param = substr($param,5);
$fieldset['saisies'][] = array(
'saisie' => 'input',
'options' => array(

28
inc/tarteaucitron.php

@ -36,26 +36,16 @@ function tarteaucitron_actif() {
function tarteaucitron_liste_services() {
$services_actifs = lire_config('tarteaucitron/services', array());
$list_services = [];
$json_source = find_in_path('json/services.json');
$json = file_get_contents($json_source);
$parsed_json = json_decode($json);
if ($lines=file(find_in_path('lib/tarteaucitron/tarteaucitron.services.js'))){
$i=0;
foreach($lines as $line) {
if(preg_match('/^tarteaucitron\.services\.(\w+)/', $line, $matches)) {
$service = $matches[1];
$statut = (is_array($services_actifs[$service])) ? 'actif' : 'inactif';
if (preg_match('/"type": "(\w+)",/', $lines[$i+2], $matches)) {
$type = $matches[1];
}
$list_services[$service] = array(
'type' => $type,
'statut' => $statut,
'params' => $services_actifs[$service]
);
}
$i++;
}
foreach($parsed_json as $service => $prop) {
$list_services[$service] = array(
'type' => $prop->{'type'},
'statut' => (array_key_exists($service,$services_actifs)) ? 'actif' : 'inactif',
'params' => (!empty($prop->{'params'})) ? $prop->{'params'} : array()
);
}
return $list_services;

2
json/services.json

File diff suppressed because one or more lines are too long

1
modeles/tac_acast.html

@ -0,0 +1 @@
<div class="acast_embed" height="[(#ENV{height})]" width="[(#ENV{width})]" id="[(#ENV{id})]" id2="[(#ENV{id2})]" seek="[(#ENV{seek})]"></div>

1
modeles/tac_addthis.html

@ -0,0 +1 @@
<div class="addthis_inline_share_toolbox"></div>

1
modeles/tac_addtoanyfeed.html

@ -0,0 +1 @@
<a class="a2a_dd" href="#" onclick="window.open(tarteaucitron.user.addtoanyfeedSubscribeLink)"><img src="//static.addtoany.com/buttons/subscribe_171_16.gif" width="171" height="16" border="0" alt="Subscribe"/></a>

1
modeles/tac_addtoanyshare.html

@ -0,0 +1 @@
<a class="a2a_dd" href="https://www.addtoany.com/share_save"><img src="//static.addtoany.com/buttons/share_save_171_16.png" width="171" height="16" border="0" alt="Share"/></a>

1
modeles/tac_adform.html

@ -0,0 +1 @@
<script>tarteaucitron.user.adformpagename = '[(#ENV{adformpagename})]';</script>

1
modeles/tac_adsense.html

@ -0,0 +1 @@
<ins class="adsbygoogle" style="display:inline-block;width:[(#ENV{width})]px;height:[(#ENV{height})]px" data-ad-client="[(#ENV{ca_pub_xxxxxxxxxxxxxxx})]" data-ad-slot="[(#ENV{ad_slot})]"></ins><script type="text/javascript">(adsbygoogle = window.adsbygoogle || []).push({});</script>

1
modeles/tac_adsensesearchform.html

@ -0,0 +1 @@
<form action="[(#ENV{url_destination})]" id="cse-search-box" target="[(#ENV{target})]"><div><input type="hidden" name="cx" value="[(#ENV{partner-pub-XXXXXXXXXXXX:XXXXXX})]" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="25" /><input type="submit" name="sa" value="Search" /></div></form>

1
modeles/tac_adsensesearchresult.html

@ -0,0 +1 @@
<gcse:searchresults-only id="gcse_searchresults"></gcse:searchresults-only>

2
modeles/tac_aduptech_ads.html

@ -0,0 +1,2 @@
<div class="aduptech_ads"
placementKey="[(#ENV{PLACEMENT_KEY})]"></div>

3
modeles/tac_aduptech_conversion.html

@ -0,0 +1,3 @@
<div class="aduptech_conversion"
advertiserId="[(#ENV{ADVERTISER_ID})]"
conversionCode="[(#ENV{CONVERSION_CODE})]"></div>

4
modeles/tac_aduptech_retargeting.html

@ -0,0 +1,4 @@
<div class="aduptech_retargeting"
account="[(#ENV{ACCOUNT_ID})]"
product='["[(#ENV{PRODUCT_ID1})]", "[(#ENV{PRODUCT_ID2})]"]'
track="productList" ></div>

1
modeles/tac_amazon.html

@ -0,0 +1 @@
<div class="amazon_product" amazonid="[(#ENV{xxxxx-xx})]" productid="[(#ENV{product_id})]"></div>

1
modeles/tac_artetv.html

@ -0,0 +1 @@
<div class="artetv_player" json="[(#ENV{video_json})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_ausha.html

@ -0,0 +1 @@
<div class="ausha_player" data-height="[(#ENV{data-height})]" data-podcast-id="[(#ENV{data-podcast-id})]" data-player-id="[(#ENV{data-player-id})]" data-playlist="[(#ENV{data-playlist})]" data-color="[(#ENV{data-color})]"></div>

1
modeles/tac_bandcamp.html

@ -0,0 +1 @@
<div class="bandcamp_player" albumID="[(#ENV{album_id})]" size="[(#ENV{size})]" artwork="[(#ENV{artwork})]" transparent="[(#ENV{transparent})]" minimal="[(#ENV{minimal})]" tracklist="[(#ENV{tracklist})]" linkcol="[(#ENV{linkcol})]" package="[(#ENV{package})]" bgcol="[(#ENV{bgcol})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_bingads.html

@ -0,0 +1 @@
<script>tarteaucitron.user.bingadsID = '[(#ENV{bingadsID})]';</script>

1
modeles/tac_calameo.html

@ -0,0 +1 @@
<div class="calameo-canvas" data-id="[(#ENV{bkcode})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

4
modeles/tac_canalu.html

@ -1,3 +1 @@
[<div class="canalu_player"
videoTitle="(#ENV{id})">
</div><br>]
<div class="canalu_player" videoTitle="[(#ENV{videoTitle})]"></div>

1
modeles/tac_clicmanager.html

@ -0,0 +1 @@
<div class="clicmanager-canvas" c="[(#ENV{c})]" s="[(#ENV{s})]" t="[(#ENV{t})]"></div>

1
modeles/tac_criteo.html

@ -0,0 +1 @@
<div class="criteo-canvas" zoneid="[(#ENV{zoneid})]"></div>

9
modeles/tac_dailymotion.html

@ -1,8 +1 @@
[<div class="dailymotion_player"
videoID="(#ENV{id})"
width="[(#ENV{width,720})]"
height="[(#ENV{height,405})]"
showinfo="showinfo [(#ENV{showinfo,1})]"
autoplay="autoplay [(#ENV{autoplay,0})]"
embedType="embedType [(#ENV{embedType,video})]">
</div><br>]
<div class="dailymotion_player" videoID="[(#ENV{video_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]" showinfo="[(#ENV{showinfo})]" autoplay="[(#ENV{autoplay})]" embedType="[(#ENV{embedType})]"></div>

1
modeles/tac_datingaffiliation.html

@ -0,0 +1 @@
<div class="datingaffiliation-canvas" data-comfrom="[(#ENV{data-comfrom})]" data-r="[(#ENV{data-r})]" data-p="[(#ENV{data-p})]" data-cf0="[(#ENV{data-cf0})]" data-langue="[(#ENV{data-langue})]" data-forwardAffiliate="[(#ENV{data-forwardAffiliate})]" data-cf2="[(#ENV{data-cf2})]" data-cfsa2="[(#ENV{data-cfsa2})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_datingaffiliationpopup.html

@ -0,0 +1 @@
<div class="datingaffiliationpopup-canvas" comfrom="[(#ENV{comfrom})]" promo="[(#ENV{promo})]" productid="[(#ENV{productid})]" submitconfig="[(#ENV{submitconfig})]" ur="[(#ENV{ur})]" brand="[(#ENV{brand})]" lang="[(#ENV{lang})]" cf0="[(#ENV{cf0})]" cf2="[(#ENV{cf2})]" subid1="[(#ENV{subid1})]" cfsa2="[(#ENV{cfsa2})]" subid2="[(#ENV{subid2})]" nicheid="[(#ENV{nicheid})]" degreid="[(#ENV{degreid})]" bt="[(#ENV{bt})]" vis="[(#ENV{vis})]" hid="[(#ENV{hid})]" snd="[(#ENV{snd})]" aabd="[(#ENV{aabd})]" aabs="[(#ENV{aabs})]"></div>

1
modeles/tac_deezer.html

@ -0,0 +1 @@
<div class="deezer_player" deezerID="[(#ENV{deezerID})]" theme="[(#ENV{theme})]" embedType="[(#ENV{type})]" radius="[(#ENV{radius})]" tracklist="[(#ENV{tracklist})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_discord.html

@ -0,0 +1 @@
<div class="discord_widget" width="[(#ENV{width})]" height="[(#ENV{height})]" guildID="[(#ENV{guildID})]"></div>

1
modeles/tac_disqus.html

@ -0,0 +1 @@
<div id="disqus_thread"></div>

6
modeles/tac_facebook.html

@ -1,5 +1 @@
[<div class="fb-video"
data-href="https://www.facebook.com/watch/?v=(#ENV{id})"
data-allowfullscreen="true"
data-width="[(#ENV{width,500})]">
</div><br>]
<div class="fb-like" data-layout="standard" data-action="like" data-share="true"></div>

1
modeles/tac_facebookcomment.html

@ -0,0 +1 @@
<div class="fb-comments" data-numposts="5" data-colorscheme="light" data-href="CURRENT_URI"></div>

1
modeles/tac_facebooklikebox.html

@ -0,0 +1 @@
<div class="fb-like-box" data-href="[(#ENV{page_url})]" data-width="[(#ENV{width})]" data-height="[(#ENV{height})]" data-colorscheme="light" data-show-faces="[(#ENV{faces})]" data-header="[(#ENV{header})]" data-stream="[(#ENV{posts})]" data-show-border="[(#ENV{border})]"></div>

1
modeles/tac_facebookpost.html

@ -0,0 +1 @@
<div class="tac_facebookpost" data-appId="[(#ENV{appId})]" data-url="[(#ENV{url})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_fculture.html

@ -0,0 +1 @@
<div class="fculture_embed" id="[(#ENV{id})]" height="[(#ENV{height})]" width="[(#ENV{width})]"></div>

1
modeles/tac_ferankpub.html

@ -0,0 +1 @@
<ins class="ferank-publicite" client="[(#ENV{id_client})]" style="display:inline-block;width:[(#ENV{width})]px;height:[(#ENV{height})]px" titre="[(#ENV{couleur_titre})]" texte="[(#ENV{couleur_texte})]"></ins>

6
modeles/tac_gagenda.html

@ -1,5 +1 @@
[<div class="gagenda_embed"
width="[(#ENV{width,500})]"
height="[(#ENV{height,450})]"
data="src(#ENV{id})">
</div>]
<div class="gagenda_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" data="[(#ENV{data})]"></div>

1
modeles/tac_gdocs.html

@ -0,0 +1 @@
<div class="gdocs_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" id="[(#ENV{id})]"></div>

1
modeles/tac_genially.html

@ -0,0 +1 @@
<div class="tac_genially" geniallyid="[(#ENV{geniallyid})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_gforms.html

@ -0,0 +1 @@
<div class="gforms_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" id="[(#ENV{id})]"></div>

1
modeles/tac_googleadwordsconversion.html

@ -0,0 +1 @@
<script type="text/javascript">tarteaucitron.user.adwordsconversionId = '[(#ENV{id})]';tarteaucitron.user.adwordsconversionLabel = '[(#ENV{label})]';tarteaucitron.user.adwordsconversionLanguage = '[(#ENV{language})]';tarteaucitron.user.adwordsconversionFormat = '[(#ENV{format})]';tarteaucitron.user.adwordsconversionColor = '[(#ENV{color})]';tarteaucitron.user.adwordsconversionValue = '[(#ENV{value})]';tarteaucitron.user.adwordsconversionCurrency = '[(#ENV{currency})]';tarteaucitron.user.adwordsconversionCustom1 = '[(#ENV{custom1})]';tarteaucitron.user.adwordsconversionCustom2 = '[(#ENV{custom2})]';</script>

1
modeles/tac_googlemaps.html

@ -0,0 +1 @@
<div class="googlemaps-canvas" zoom="[(#ENV{zoom})]" latitude="[(#ENV{latitude})]" longitude="[(#ENV{longitude})]" style="width: [(#ENV{width})]px; height: [(#ENV{height})]px;"></div><script>tarteaucitron.user.mapscallback = '[(#ENV{callback_function})]';tarteaucitron.user.googlemapsLibraries = '[(#ENV{LIBRARIES})]';</script>

1
modeles/tac_googlemapssearch.html

@ -0,0 +1 @@
<div class="googlemapssearch" data-search="[(#ENV{SEARCHWORDS})]" data-api-key="[(#ENV{YOUR_GOOGLE_MAP_API_KEY})]" width="[(#ENV{WIDTH})]" height="[(#ENV{HEIGHT})]" ></div>

1
modeles/tac_googlepartners.html

@ -0,0 +1 @@
<div class="g-partnersbadge" data-agency-id="[(#ENV{id})]"></div>

1
modeles/tac_gplus.html

@ -0,0 +1 @@
<div class="g-plusone" data-size="small" data-annotation="inline" data-width="300"></div>

1
modeles/tac_gplusbadge.html

@ -0,0 +1 @@
<div class="g-page" data-width="[(#ENV{width})]" data-href="//plus.google.com/u/0/[(#ENV{page_id})]" data-rel="publisher" data-showtagline="[(#ENV{description})]" data-showcoverphoto="[(#ENV{cover})]"></div>

1
modeles/tac_gsheets.html

@ -0,0 +1 @@
<div class="gsheets_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" id="[(#ENV{id})]" headers="[(#ENV{headers})]"></div>

1
modeles/tac_gslides.html

@ -0,0 +1 @@
<div class="gslides_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" id="[(#ENV{id})]" autostart="[(#ENV{autostart})]" loop="[(#ENV{loop})]" delay="[(#ENV{delay})]"></div>

1
modeles/tac_hcaptcha.html

@ -0,0 +1 @@
<div class="h-captcha"></div>

1
modeles/tac_helloasso.html

@ -0,0 +1 @@
<div class="tac_helloasso" data-url="[(#ENV{url})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_instagram.html

@ -0,0 +1 @@
<div class="instagram_post" postID="[(#ENV{postID})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_issuu.html

@ -0,0 +1 @@
<div class="issuu_player" issuuID="[(#ENV{your_issuu_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_linkedin.html

@ -0,0 +1 @@
<span class="tacLinkedin"></span><script type="IN/Share" data-counter="top"></script>

1
modeles/tac_maps_noapi.html

@ -0,0 +1 @@
<div class="googlemaps_embed" width="[(#ENV{width})]" height="[(#ENV{height})]" id="[(#ENV{id})]"></iframe>

1
modeles/tac_mixcloud.html

@ -0,0 +1 @@
<div class="mixcloud_embed" height="[(#ENV{height})]" width="[(#ENV{width})]" hidecover="[(#ENV{hidecover})]" mini="[(#ENV{mini})]" light="[(#ENV{light})]" id="[(#ENV{id})]"></div>

1
modeles/tac_outbrain.html

@ -0,0 +1 @@
<div class="OUTBRAIN" data-src="[(#ENV{PERMALINK})]" data-widget-id="[(#ENV{ID})]"></div>

1
modeles/tac_pinterest.html

@ -0,0 +1 @@
<span class="tacPinterest"></span><a href="//www.pinterest.com/pin/create/button/" data-pin-do="buttonBookmark" data-pin-color="white"></a>

1
modeles/tac_podcloud.html

@ -0,0 +1 @@
<div class="tac_podcloud" data-url="[(#ENV{url})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_prelinker.html

@ -0,0 +1 @@
<div class="prelinker-canvas" siteId="[(#ENV{siteId})]" bannerId="[(#ENV{bannerId})]" defaultLanguage="[(#ENV{defaultLanguage})]" tracker="[(#ENV{tracker})]"></div>

1
modeles/tac_prezi.html

@ -0,0 +1 @@
<div class="prezi-canvas" data-id="[(#ENV{slide_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_pubdirecte.html

@ -0,0 +1 @@
<div class="pubdirecte-canvas" pid="[(#ENV{id})]" ref="[(#ENV{ref})]"></div>

1
modeles/tac_recaptcha.html

@ -0,0 +1 @@
<div class="g-recaptcha" data-sitekey="[(#ENV{sitekey})]"></div>

1
modeles/tac_shareaholic.html

@ -0,0 +1 @@
<div class='shareaholic-canvas' data-app='share_buttons' data-app-id='[(#ENV{app_id})]'></div>

1
modeles/tac_shareasale.html

@ -0,0 +1 @@
<div class="shareasale-canvas" amount="[(#ENV{amount})]" tracking="[(#ENV{tracking})]" transtype="[(#ENV{transtype})]" persale="[(#ENV{persale})]" perlead="[(#ENV{perlead})]" perhit="[(#ENV{perhit})]" merchantID="[(#ENV{merchantID})]"></div>

1
modeles/tac_sharethis.html

@ -0,0 +1 @@
<span class="tacSharethis"></span>[(#ENV{services_list_spans})]

1
modeles/tac_slideshare.html

@ -0,0 +1 @@
<div class="slideshare-canvas" data-id="[(#ENV{slide_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_soundcloud.html

@ -0,0 +1 @@
<div class="soundcloud_player" data-playable-id="[(#ENV{track_or_playlist_id})]" data-playable-type="[(#ENV{type})]" data-height="[(#ENV{iframe_height})]" data-color="[(#ENV{accent_color})]" data-auto-play="[(#ENV{autoplay})]" data-hide-related="[(#ENV{hide_related})]" data-show-comments="[(#ENV{show_comment})]" data-show-user="[(#ENV{show_user})]" data-show-reposts="[(#ENV{show_repost})]" data-show-teaser="[(#ENV{show_teaser})]" data-visual="[(#ENV{visual})]" data-artwork="[(#ENV{artwork})]"></div>

1
modeles/tac_spotify.html

@ -0,0 +1 @@
<div class="spotify_player" spotifyID="[(#ENV{spotifyID})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_timelinejs.html

@ -0,0 +1 @@
<div class="timelinejs-canvas" spreadsheet_id="[(#ENV{spreadsheet_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]" lang="[(#ENV{lang_2_letter})]" font="[(#ENV{font})]" map="[(#ENV{map})]" start_at_end="[(#ENV{start_at_end})]" hash_bookmark="[(#ENV{hash_bookmark})]" start_at_slide="[(#ENV{start_at_slide})]" start_zoom="[(#ENV{start_zoom})]"></div>

1
modeles/tac_twenga.html

@ -0,0 +1 @@
<script type="text/javascript">tarteaucitron.user.twengaId = [(#ENV{id})];tarteaucitron.user.twengaLocale = '[(#ENV{locale})]';</script>

1
modeles/tac_twitter.html

@ -0,0 +1 @@
<span class="tacTwitter"></span><a href="https://twitter.com/share" class="twitter-share-button" data-via="[(#ENV{twitter_username})]" data-count="vertical" data-dnt="true"></a>

1
modeles/tac_twitterembed.html

@ -0,0 +1 @@
<div class="twitterembed-canvas" tweetid="[(#ENV{tweet_id})]" data-width="[(#ENV{width})]" theme="[(#ENV{theme})]" cards="[(#ENV{cards})]" conversation="[(#ENV{conversation})]" data-align="[(#ENV{align})]"></div>

1
modeles/tac_twittertimeline.html

@ -0,0 +1 @@
<span class="tacTwitterTimelines"></span><a class="twitter-timeline" href="[(#ENV{twitter_url})]" data-tweet-limit="[(#ENV{tweet-limit})]" data-dnt="[(#ENV{dnt})]" data-width="[(#ENV{width})]" data-height="[(#ENV{height})]" data-theme="[(#ENV{theme})]" data-link-color="[(#ENV{hex_link-color})]"></a>

6
modeles/tac_vimeo.html

@ -1,5 +1 @@
[<div class="vimeo_player"
videoID="(#ENV{id})"
width="[(#ENV{width,720})]"
height="[(#ENV{height,405})]">
</div><br>]
<div class="vimeo_player" videoID="[(#ENV{video_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]"></div>

1
modeles/tac_vshop.html

@ -0,0 +1 @@
<div class="vcashW" style="width: [(#ENV{width})]px; height: [(#ENV{height})]px;" data-key="[(#ENV{key})]" data-tracking="[(#ENV{zone})]" data-category="[(#ENV{category})]" data-keyword="[(#ENV{keyword})]" data-layout="[(#ENV{layout})]" data-theme="[(#ENV{theme})]" data-linkColor="[(#ENV{link_color})]" data-textColor="[(#ENV{text_color})]" data-backgroundColor="[(#ENV{background_color})]" data-borderColor="[(#ENV{border_color})]"></div>

1
modeles/tac_xandrconversion.html

@ -0,0 +1 @@
<div id="[(#ENV{uniqId})]" xandrconversionId="[(#ENV{xandrconversionId})]" xandrconversionSeg="[(#ENV{xandrconversionSeg})]" xandrconversionOrderId="[(#ENV{xandrconversionOrderId})]" xandrconversionValue="[(#ENV{xandrconversionValue})]" xandrconversionRedir="[(#ENV{xandrconversionRedir})]" xandrconversionOther="[(#ENV{xandrconversionOther})]"></div>

1
modeles/tac_xandrsegment.html

@ -0,0 +1 @@
<div id="[(#ENV{uniqId})]" xandrsegmentAdd="[(#ENV{xandrsegmentAdd})]" xandrsegmentAddCode="[(#ENV{xandrsegmentAddCode})]" xandrsegmentRemove="[(#ENV{xandrsegmentRemove})]" xandrsegmentRemoveCode="[(#ENV{xandrsegmentRemoveCode})]" xandrsegmentMember="[(#ENV{xandrsegmentMember})]" xandrsegmentRedir="[(#ENV{xandrsegmentRedir})]" xandrsegmentValue="[(#ENV{xandrsegmentValue})]" xandrsegmentOther="[(#ENV{xandrsegmentOther})]"></div>

16
modeles/tac_youtube.html

@ -1,15 +1 @@
[<div class="youtube_player"
style="margin:auto"
videoID="(#ENV{id})"
width="[(#ENV{width,720})]"
height="[(#ENV{height,405})]"
theme="theme [(#ENV{theme,dark})]"
rel="rel [(#ENV{rel,1})]"
controls="controls [(#ENV{controls,1})]"
showinfo="showinfo [(#ENV{showinfo,1})]"
autoplay="autoplay [(#ENV{autoplay,0})]"
mute="mute [(#ENV{mute,0})]"
srcdoc="srcdoc"
loop="loop [(#ENV{loop,0})]"
loading="loading [(#ENV{loading,1})]">
</div><br>]
<div class="youtube_player" videoID="[(#ENV{video_id})]" width="[(#ENV{width})]" height="[(#ENV{height})]" theme="[(#ENV{theme})]" rel="[(#ENV{rel})]" controls="[(#ENV{controls})]" showinfo="[(#ENV{showinfo})]" autoplay="[(#ENV{autoplay})]" mute="[(#ENV{mute})]" srcdoc="[(#ENV{srcdoc})]" loop="[(#ENV{loop})]" loading="[(#ENV{loading})]"></div>

54
tarteaucitron_pipelines.php

@ -26,7 +26,6 @@ include_spip('inc/tarteaucitron');
* @return mixed
*/
function tarteaucitron_insert_head($flux) {
if (tarteaucitron_actif()) {
$tarteaucitron = find_in_path('lib/tarteaucitron/tarteaucitron.js');
$tarteaucitron_config = recuperer_fond('javascript/tarteaucitron_config');
@ -56,8 +55,10 @@ function tarteaucitron_affichage_final($html) {
foreach($services_actifs as $service => $params) {
$codejs = $parsed_json->{$service}->{'JS'};
foreach($params as $param => $value) {
$codejs = str_replace($param,$value,$codejs);
if (is_array($params)) {
foreach($params as $param => $value) {
$codejs = preg_replace("#" . $param . "#",$value,$codejs);
}
}
$ajouter_services .= $codejs . "\n";
@ -81,22 +82,28 @@ function tarteaucitron_affichage_final($html) {
*/
function tarteaucitron_porte_plume_barre_pre_charger($barres){
$menu_items = array();
$services_actifs = array_filter(lire_config('tarteaucitron/services', array()));
foreach ($services_actifs as $service => $value) {
if ($modele=find_in_path('modeles/tac_' . $service . '.html')) {
$file = fopen($modele,"r");
$text = fgets($file);
if (($text!="<p>Placez le code HTML</p>") && (find_in_path('icones_barre/' . $service . '.png'))) {
$menu_items[] = array(
"id" => $service,
"name" => $service,
"className" => 'tac_' . $service,
"openWith" => "<tac_" . $service . "|id=",
'closeWith' => '[![' . _T('tarteaucitron:id_contenu') . ']!]>',
"display" => true
);
$services_actifs = lire_config('tarteaucitron/services', array());
$json_source = find_in_path('json/services.json');
$json = file_get_contents($json_source);
$parsed_json = json_decode($json);
foreach ($services_actifs as $service => $params) {
if (($modele=find_in_path('modeles/tac_' . $service . '.html')) && (find_in_path('icones_barre/' . $service . '.png'))) {
$params_modele = (!empty($parsed_json->{$service}->{'params_modele'})) ? $parsed_json->{$service}->{'params_modele'} : array();
$close = '';
foreach($params_modele as $param_modele) {
$close .= '|' . $param_modele . '=[![' . $param_modele . ' :]!]';
}
$menu_items[] = array(
"id" => $service,
"name" => $service,
"className" => 'tac_' . $service,
"openWith" => "<tac_" . $service,
'closeWith' => $close . '>',
"display" => true
);
}
}
@ -127,15 +134,10 @@ function tarteaucitron_porte_plume_barre_pre_charger($barres){
*/
function tarteaucitron_porte_plume_lien_classe_vers_icone($flux){
$icons = array('tac_drop' => 'tac.png');
$services_actifs = array_filter(lire_config('tarteaucitron/services', array()));
$services_actifs = lire_config('tarteaucitron/services', array());
foreach ($services_actifs as $service => $value) {
if ($modele=find_in_path('modeles/tac_' . $service . '.html')) {
$file = fopen($modele,"r");
$text = fgets($file);
if (($text!="<p>Placez le code HTML</p>") && (find_in_path('icones_barre/' . $service . '.png'))) {
$icons['tac_' . $service] = $service . '.png';
}
if (($modele=find_in_path('modeles/tac_' . $service . '.html')) && (find_in_path('icones_barre/' . $service . '.png'))) {
$icons['tac_' . $service] = $service . '.png';
}
}

Loading…
Cancel
Save