diff --git a/module/blog/view/comment/comment.js.php b/module/blog/view/comment/comment.js.php index 132fbead..200182b3 100755 --- a/module/blog/view/comment/comment.js.php +++ b/module/blog/view/comment/comment.js.php @@ -10,18 +10,31 @@ * @link http://zwiicms.com/ */ + /** * Confirmation de suppression */ $(".blogCommentDelete").on("click", function() { var _this = $(this); - return core.confirm("Êtes-vous sûr de vouloir supprimer ce commentaire ?", function() { + var nom = "getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; + return core.confirm("Êtes-vous sûr de vouloir supprimer le commentaire de l'article " + nom + " ?", function() { $(location).attr("href", _this.attr("href")); }); }); + +/** + * Confirmation de suppression en masse + */ $(".blogCommentDeleteAll").on("click", function() { var _this = $(this); - return core.confirm("Êtes-vous sûr de vouloir supprimer les "+ getData(['module',$this->getUrl(0), $this->getUrl(2), 'comment']));?>+" commentaires de l'article sélectionné ?", function() { + var nombre = "getData(['module', $this->getUrl(0), $this->getUrl(2), 'comment' ])); ?>"; + var nom = "getData(['module', $this->getUrl(0), $this->getUrl(2), 'title' ]); ?>"; + if( nombre === "1"){ + var message = "Êtes-vous sûr de vouloir supprimer le commentaire de l'article " + nom + " ?"; + } else{ + var message = "Êtes-vous sûr de vouloir supprimer les " + nombre + " commentaires de l'article " + nom + " ?"; + } + return core.confirm(message, function() { $(location).attr("href", _this.attr("href")); }); });