Loading src/UnicaenAutoform/View/Helper/partial/input/plus_custom.phtml +16 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,16 @@ $array = "[" . implode(",", $temp) . "]"; </div> <script> function encodeHTMLEntitiesManual(str) { const map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', // Apostrophe }; return str.replace(/[&<>"']/g, match => map[match]); } function initTinymce() { tinymce.remove(); Loading Loading @@ -69,7 +79,7 @@ $array = "[" . implode(",", $temp) . "]"; $(function () { let optionsText = '<?php echo $champ->getOptions(); ?>'; let fields = readOptions(optionsText); let reponses = '<?php echo $reponse; ?>'; let reponses = "<?php echo str_replace(["'",'"'],["\'", '\"'],$reponse); ?>"; let dictionnary = []; let blob = reponses.split('|'); Loading @@ -80,8 +90,8 @@ $array = "[" . implode(",", $temp) . "]"; readOptions(optionsText); let sid = <?php echo $champ->getId(); ?>; console.log("Init du champ : " + sid); console.log(dictionnary); // console.log("Init du champ : " + sid); // console.log(dictionnary); if (dictionnary !== ['']) { for (let i = 0; i < dictionnary.length; i++) { if (dictionnary[i][0] !== "") { Loading Loading @@ -118,6 +128,8 @@ $array = "[" . implode(",", $temp) . "]"; return maximum; } function ajouter_PlusCustom(sid, fields, responses) { // console.log(fields); let id = sid; Loading @@ -138,8 +150,7 @@ $array = "[" . implode(",", $temp) . "]"; texte += "<label for='" + inputId + "'> " + label + ":</label>"; let temp_reponse = (responses !== undefined && responses[i] !== undefined) ? responses[i] : ''; // console.log(temp_reponse); let temp_reponse = (responses !== undefined && responses[i] !== undefined) ? encodeHTMLEntitiesManual(responses[i]) : ''; switch (type) { case "texte court" : Loading Loading
src/UnicaenAutoform/View/Helper/partial/input/plus_custom.phtml +16 −5 Original line number Diff line number Diff line Loading @@ -32,6 +32,16 @@ $array = "[" . implode(",", $temp) . "]"; </div> <script> function encodeHTMLEntitiesManual(str) { const map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''', // Apostrophe }; return str.replace(/[&<>"']/g, match => map[match]); } function initTinymce() { tinymce.remove(); Loading Loading @@ -69,7 +79,7 @@ $array = "[" . implode(",", $temp) . "]"; $(function () { let optionsText = '<?php echo $champ->getOptions(); ?>'; let fields = readOptions(optionsText); let reponses = '<?php echo $reponse; ?>'; let reponses = "<?php echo str_replace(["'",'"'],["\'", '\"'],$reponse); ?>"; let dictionnary = []; let blob = reponses.split('|'); Loading @@ -80,8 +90,8 @@ $array = "[" . implode(",", $temp) . "]"; readOptions(optionsText); let sid = <?php echo $champ->getId(); ?>; console.log("Init du champ : " + sid); console.log(dictionnary); // console.log("Init du champ : " + sid); // console.log(dictionnary); if (dictionnary !== ['']) { for (let i = 0; i < dictionnary.length; i++) { if (dictionnary[i][0] !== "") { Loading Loading @@ -118,6 +128,8 @@ $array = "[" . implode(",", $temp) . "]"; return maximum; } function ajouter_PlusCustom(sid, fields, responses) { // console.log(fields); let id = sid; Loading @@ -138,8 +150,7 @@ $array = "[" . implode(",", $temp) . "]"; texte += "<label for='" + inputId + "'> " + label + ":</label>"; let temp_reponse = (responses !== undefined && responses[i] !== undefined) ? responses[i] : ''; // console.log(temp_reponse); let temp_reponse = (responses !== undefined && responses[i] !== undefined) ? encodeHTMLEntitiesManual(responses[i]) : ''; switch (type) { case "texte court" : Loading