Skip to content

Commit

Permalink
fix: quote issue in javascript code
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Feb 5, 2019
1 parent 341abf6 commit a91cc11
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/scripts.js.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function(event) {
var link = '';
link += '<li id="menu7">';
link += '<a href="' + rootDoc + '/plugins/formcreator/front/formlist.php" class="itemP">';
link += "<?php echo _n('Form', 'Forms', 2, 'formcreator'); ?>";
link += "<?php echo Toolbox::addslashes_deep(_n('Form', 'Forms', 2, 'formcreator')); ?>";
link += '</a>';
link += '</li>';

Expand Down Expand Up @@ -307,7 +307,7 @@ function showTiles(tiles, defaultForms) {
tiles = sortFormAndFaqItems(tiles, sortByName);
html = '';
if (defaultForms) {
html += '<p><?php echo __('No form found. Please choose a form below instead', 'formcreator')?></p>'
html += '<p><?php echo Toolbox::addslashes_deep(__('No form found. Please choose a form below instead', 'formcreator'))?></p>'
}
html += buildTiles(tiles);

Expand All @@ -327,7 +327,7 @@ function (response) {
}
).fail(
function () {
html = '<p><?php echo __('An error occured while querying forms', 'formcreator')?></p>'
html = '<p><?php echo Toolbox::addslashes_deep(__('An error occured while querying forms', 'formcreator'))?></p>'
$('#plugin_formcreator_wizard_forms').empty();
$('#plugin_formcreator_wizard_forms').prepend(html);
$('#plugin_formcreator_formlist').masonry({
Expand Down Expand Up @@ -365,7 +365,7 @@ function buildTiles(list) {

if (list.length == 0) {
html = '<p id="plugin_formcreator_formlist">'
+ "<?php echo __('No form yet in this category', 'formcreator') ?>"
+ "<?php echo Toolbox::addslashes_deep(__('No form yet in this category', 'formcreator')) ?>"
+ '</p>';
} else {
var items = [];
Expand Down Expand Up @@ -463,7 +463,7 @@ function moveQuestion(token, question_id, action) {
}

function deleteQuestion(items_id, token, question_id) {
if(confirm("<?php echo __('Are you sure you want to delete this question?', 'formcreator'); ?> ")) {
if(confirm("<?php echo Toolbox::addslashes_deep(__('Are you sure you want to delete this question?', 'formcreator')); ?> ")) {
jQuery.ajax({
url: urlFrontQuestion,
type: "POST",
Expand Down Expand Up @@ -524,7 +524,7 @@ function duplicateSection(items_id, token, section_id) {
}

function deleteSection(items_id, token, section_id) {
if(confirm("<?php echo __('Are you sure you want to delete this section?', 'formcreator'); ?> ")) {
if(confirm("<?php echo Toolbox::addslashes_deep(__('Are you sure you want to delete this section?', 'formcreator')); ?> ")) {
jQuery.ajax({
url: urlFrontSection,
type: "POST",
Expand Down Expand Up @@ -561,7 +561,7 @@ function addTarget(items_id, token) {
}

function deleteTarget(items_id, token, target_id) {
if(confirm("<?php echo __('Are you sure you want to delete this destination:', 'formcreator'); ?> ")) {
if(confirm("<?php echo Toolbox::addslashes_deep(__('Are you sure you want to delete this destination:', 'formcreator')); ?> ")) {
jQuery.ajax({
url: rootDoc + '/plugins/formcreator/front/target.form.php',
type: "POST",
Expand Down

0 comments on commit a91cc11

Please sign in to comment.