From 4f938049435efaf2bd06ea5169abe0f41cd5fcaf Mon Sep 17 00:00:00 2001 From: Theofilos Intzoglou Date: Wed, 16 Jul 2025 22:25:38 +0300 Subject: [PATCH 1/3] Fix title translations --- .../el-GR/el-GR.plg_attachments_attachments_for_content.sys.ini | 2 +- .../en-GB/en-GB.plg_attachments_attachments_for_content.sys.ini | 2 +- .../fr-FR/fr-FR.plg_attachments_attachments_for_content.sys.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/attachments_for_content/language/el-GR/el-GR.plg_attachments_attachments_for_content.sys.ini b/attachments_for_content/language/el-GR/el-GR.plg_attachments_attachments_for_content.sys.ini index 22d47c7f..98919e99 100644 --- a/attachments_for_content/language/el-GR/el-GR.plg_attachments_attachments_for_content.sys.ini +++ b/attachments_for_content/language/el-GR/el-GR.plg_attachments_attachments_for_content.sys.ini @@ -7,4 +7,4 @@ ; Greek translation ATTACH_ATTACHMENTS_FOR_CONTENT_PLUGIN_DESCRIPTION="Το πρόσθετο Συνημμένα για το Περιεχόμενο κάνει δυνατή την προσθήκη συνημμένων σε άρθρα καθώς και στις περιγραφές κατηγοριών." -PLG_ATTACHMENTS_FOR_CONTENT="Συνημμένα - Για Περιεχόμενο" +PLG_ATTACHMENTS_ATTACHMENTS_FOR_CONTENT="Συνημμένα - Για Περιεχόμενο" diff --git a/attachments_for_content/language/en-GB/en-GB.plg_attachments_attachments_for_content.sys.ini b/attachments_for_content/language/en-GB/en-GB.plg_attachments_attachments_for_content.sys.ini index bf8004b4..b2cfc423 100644 --- a/attachments_for_content/language/en-GB/en-GB.plg_attachments_attachments_for_content.sys.ini +++ b/attachments_for_content/language/en-GB/en-GB.plg_attachments_attachments_for_content.sys.ini @@ -7,4 +7,4 @@ ; English translation ATTACH_ATTACHMENTS_FOR_CONTENT_PLUGIN_DESCRIPTION="The Attachments for Content plugin enables adding attachments to content articles as well as category descriptions." -PLG_ATTACHMENTS_FOR_CONTENT="Attachments - For Content" +PLG_ATTACHMENTS_ATTACHMENTS_FOR_CONTENT="Attachments - For Content" diff --git a/attachments_for_content/language/fr-FR/fr-FR.plg_attachments_attachments_for_content.sys.ini b/attachments_for_content/language/fr-FR/fr-FR.plg_attachments_attachments_for_content.sys.ini index 349d92a3..69317a2d 100644 --- a/attachments_for_content/language/fr-FR/fr-FR.plg_attachments_attachments_for_content.sys.ini +++ b/attachments_for_content/language/fr-FR/fr-FR.plg_attachments_attachments_for_content.sys.ini @@ -7,4 +7,4 @@ ; French translation by: Marc-André Ladouceur (2.0), Pascal Adalian and Sylvain Faivre ATTACH_ATTACHMENTS_FOR_CONTENT_PLUGIN_DESCRIPTION="Ce plugin permet l'ajout de pièces-jointes au contenu des articles et à la description des catégories." -PLG_ATTACHMENTS_FOR_CONTENT="Pièces jointes - Pour contenu" +PLG_ATTACHMENTS_ATTACHMENTS_FOR_CONTENT="Pièces jointes - Pour contenu" From 886c3dd9a80f703abe03bd4b99107ecb41c93a76 Mon Sep 17 00:00:00 2001 From: Theofilos Intzoglou Date: Wed, 16 Jul 2025 23:36:41 +0300 Subject: [PATCH 2/3] Properly fix the model ids for adding, editing, deleting attachments Fixes #145 --- attachments_component/site/src/Helper/AttachmentsHelper.php | 2 +- attachments_component/site/tmpl/attachments/default.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/attachments_component/site/src/Helper/AttachmentsHelper.php b/attachments_component/site/src/Helper/AttachmentsHelper.php index c5af71de..02ce2375 100644 --- a/attachments_component/site/src/Helper/AttachmentsHelper.php +++ b/attachments_component/site/src/Helper/AttachmentsHelper.php @@ -2001,7 +2001,7 @@ public static function attachmentButtonsHTML($parent_type, $parent_id, $parent_e $a_class = 'modal-button mx-2'; $tooltip = $add_attachment_txt; - $randomId = base64_encode('add'); + $randomId = base64_encode('add' . $url); // Remove +,/,= from the $randomId $randomId = strtr($randomId, "+/=", "AAA"); $modalParams['title'] = $tooltip === null ? '' : htmlspecialchars($tooltip, ENT_QUOTES, 'UTF-8'); diff --git a/attachments_component/site/tmpl/attachments/default.php b/attachments_component/site/tmpl/attachments/default.php index c7d91db5..569dfbbb 100644 --- a/attachments_component/site/tmpl/attachments/default.php +++ b/attachments_component/site/tmpl/attachments/default.php @@ -241,7 +241,7 @@ $a_class = 'modal-button'; AttachmentsJavascript::setupModalJavascript(); - $randomId = base64_encode('show' . $actual_filename); + $randomId = base64_encode('show' . $attachment->id . $actual_filename); // Remove +,/,= from the $randomId $randomId = strtr($randomId, "+/=", "AAA"); $modalParams['title'] = $this->escape($tooltip); @@ -459,7 +459,7 @@ $update_url = str_replace('%d', (string)$attachment->id, $this->update_url); $tooltip = Text::_('ATTACH_UPDATE_THIS_FILE') . ' (' . $actual_filename . ')'; - $randomId = base64_encode('update' . $actual_filename); + $randomId = base64_encode('update' . $attachment->id . $actual_filename); // Remove +,/,= from the $randomId $randomId = strtr($randomId, "+/=", "AAA"); $modalParams['title'] = $this->escape($tooltip); @@ -493,7 +493,7 @@ $delete_url = str_replace('%d', (string)$attachment->id, $this->delete_url); $tooltip = Text::_('ATTACH_DELETE_THIS_FILE') . ' (' . $actual_filename . ')'; - $randomId = base64_encode('delete' . $actual_filename); + $randomId = base64_encode('delete' . $attachment->id . $actual_filename); // Remove +,/,= from the $randomId $randomId = strtr($randomId, "+/=", "AAA"); $modalParams['title'] = $this->escape($tooltip); From 8585526a42d29ef906cf17e2ddb0cca8269c5f74 Mon Sep 17 00:00:00 2001 From: Theofilos Intzoglou Date: Thu, 17 Jul 2025 13:41:08 +0300 Subject: [PATCH 3/3] Use parent_id as part of the modal-id --- attachments_component/site/src/Helper/AttachmentsHelper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/attachments_component/site/src/Helper/AttachmentsHelper.php b/attachments_component/site/src/Helper/AttachmentsHelper.php index 02ce2375..ddb8f05a 100644 --- a/attachments_component/site/src/Helper/AttachmentsHelper.php +++ b/attachments_component/site/src/Helper/AttachmentsHelper.php @@ -2001,7 +2001,7 @@ public static function attachmentButtonsHTML($parent_type, $parent_id, $parent_e $a_class = 'modal-button mx-2'; $tooltip = $add_attachment_txt; - $randomId = base64_encode('add' . $url); + $randomId = base64_encode('add' . $parent_id); // Remove +,/,= from the $randomId $randomId = strtr($randomId, "+/=", "AAA"); $modalParams['title'] = $tooltip === null ? '' : htmlspecialchars($tooltip, ENT_QUOTES, 'UTF-8');