From 5df7d382c17ba2b3210b5e623990b27350438101 Mon Sep 17 00:00:00 2001
From: Jacques Pyrat <jacques@pyrat.net>
Date: Sat, 25 Jul 2020 14:59:39 +0200
Subject: [PATCH] =?UTF-8?q?Nouvelle=20option=20pas=20du=20tout=20recommend?=
 =?UTF-8?q?=C3=A9e=20:=20ouvrir=20les=20PDF=20dans=20un=20nouvel=20onglet?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 formulaires/configurer_soyezcreateurs.html | 1 +
 javascripts.js.html                        | 3 +++
 lang/soyezcreateursprive_fr.php            | 1 +
 3 files changed, 5 insertions(+)

diff --git a/formulaires/configurer_soyezcreateurs.html b/formulaires/configurer_soyezcreateurs.html
index 8e4e72c6..f62964bc 100755
--- a/formulaires/configurer_soyezcreateurs.html
+++ b/formulaires/configurer_soyezcreateurs.html
@@ -472,6 +472,7 @@ if (!function_exists('sc_ouinon_default')) {
 							listeravecarticles,<:soyezcreateursprive:cfg_affichagelistedocuments_listeravecarticles:>,
 							noicon,<:soyezcreateursprive:cfg_affichagelistedocuments_noicon:>,
 							masquerdocumentsvus,<:soyezcreateursprive:cfg_affichagelistedocuments_masquervus:>,
+							newtabpdf,<:soyezcreateursprive:cfg_affichagelistedocuments_newtabpdf:>,
 						},
 						defaut=enbas}
 					)]	
diff --git a/javascripts.js.html b/javascripts.js.html
index afbd200c..d2fa3c7f 100644
--- a/javascripts.js.html
+++ b/javascripts.js.html
@@ -450,6 +450,9 @@ jQuery(document).ready(function() {
 	jQuery(window).on('load',function() {
 		myInitLayout();
 	});
+	[(#VAL{newtabpdf}|in_any{#CONFIG{soyezcreateurs/affichagelistedocuments,#ARRAY{0,enbas}}}|oui)
+		jQuery("a\[href$='.pdf'\]").prop("target", "_blank").prop("rel", "noopener");
+	]
 });
 
 [(#CHEMIN{images/sc_javascript_perso.js.html}|?{'/* Complément personnalisé du JS */'})
diff --git a/lang/soyezcreateursprive_fr.php b/lang/soyezcreateursprive_fr.php
index 92774e84..0ebf19b5 100644
--- a/lang/soyezcreateursprive_fr.php
+++ b/lang/soyezcreateursprive_fr.php
@@ -33,6 +33,7 @@ $GLOBALS[$GLOBALS['idx_lang']] = array(
 	'cfg_affichagelistedocuments_label_bloc' => 'Zone d’affichage des blocs',
 	'cfg_affichagelistedocuments_listeravecarticles' => 'Lister les documents joints à un articles dans les listes d’articles (centrales)',
 	'cfg_affichagelistedocuments_masquervus' => 'Ne pas afficher les documents insérés dans le contenu',
+	'cfg_affichagelistedocuments_newtabpdf' => 'Afficher les PDF dans un nouvel onglet (non recommendé)',
 	'cfg_affichagelistedocuments_noicon' => 'Ne pas afficher l’icone du document dans les listes',
 	'cfg_affichagelistedocuments_nulpart' => 'Nulle part (décocher les autres choix !)',
 	'cfg_affichagelistedocuments_redirectsiunique' => 'Redirection sur le document si unique et pas de texte dans l’article',
-- 
GitLab