diff --git a/attachments_component/admin/language/el-GR/el-GR.com_attachments.ini b/attachments_component/admin/language/el-GR/el-GR.com_attachments.ini
index 376c6510..7f3868a7 100644
--- a/attachments_component/admin/language/el-GR/el-GR.com_attachments.ini
+++ b/attachments_component/admin/language/el-GR/el-GR.com_attachments.ini
@@ -382,3 +382,6 @@ COM_ATTACHMENTS_N_ITEMS_PUBLISHED="%d συνημμένα δημοσιεύθηκ
COM_ATTACHMENTS_N_ITEMS_PUBLISHED_1="Το συνημμένο δημοσιεύτηκε με επιτυχία"
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED="%d συνημμένα έγιναν μη δημοσιευμένα με επιτυχία"
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED_1="Το συνημμένο έγινε μη δημοσιευμένο με επιτυχία"
+
+ATTACH_HIDE_BRACKETS_IF_EMPTY="Απόκρυψε τις αγκύλες όταν είναι κενές"
+ATTACH_HIDE_BRACKETS_IF_EMPTY_DESCRIPTION="Απόκρυψε τις αγκύλες όταν δεν υπάρχει τιμή στην 'περιγραφή' ή στα οριζόμενα πεδία από το χρήστη"
diff --git a/attachments_component/admin/language/en-GB/en-GB.com_attachments.ini b/attachments_component/admin/language/en-GB/en-GB.com_attachments.ini
index a2241596..df354ec5 100644
--- a/attachments_component/admin/language/en-GB/en-GB.com_attachments.ini
+++ b/attachments_component/admin/language/en-GB/en-GB.com_attachments.ini
@@ -382,3 +382,6 @@ COM_ATTACHMENTS_N_ITEMS_PUBLISHED="%d Attachments successfully published"
COM_ATTACHMENTS_N_ITEMS_PUBLISHED_1="Attachment successfully published"
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED="%d Attachments successfully unpublished"
COM_ATTACHMENTS_N_ITEMS_UNPUBLISHED_1="Attachment successfully unpublished"
+
+ATTACH_HIDE_BRACKETS_IF_EMPTY="Hide brackets when empty"
+ATTACH_HIDE_BRACKETS_IF_EMPTY_DESCRIPTION="Hide brackets when there is no value in 'description' or user defined fields"
diff --git a/attachments_component/site/tmpl/attachments/default.php b/attachments_component/site/tmpl/attachments/default.php
index 5f895f11..38a9f982 100644
--- a/attachments_component/site/tmpl/attachments/default.php
+++ b/attachments_component/site/tmpl/attachments/default.php
@@ -276,43 +276,74 @@
// Add description (maybe)
if ( $this->show_description ) {
$description = htmlspecialchars(stripslashes($attachment->description));
- if ( StringHelper::strlen($description) == 0)
+
+ $is_empty = 0;
+ if ( StringHelper::strlen($description) == 0) {
$description = ' ';
+ $is_empty = 1;
+ }
+
if ( $this->show_column_titles )
$html .= "| $description | ";
- else
- $html .= "[$description] | ";
+ else {
+ if ($is_empty && $this->params->get('hide_brackets_if_empty'))
+ $html .= " | ";
+ else
+ $html .= "[$description] | ";
}
-
+ }
// Show the USER DEFINED FIELDs (maybe)
if ( $this->show_user_field_1 ) {
$user_field = stripslashes($attachment->user_field_1);
- if ( StringHelper::strlen($user_field) == 0 )
+ $is_empty = 0;
+ if ( StringHelper::strlen($user_field) == 0 ) {
$user_field = ' ';
+ $is_empty = 1;
+ }
+
if ( $this->show_column_titles )
$html .= "" . $user_field . " | ";
- else
- $html .= "[" . $user_field . "] | ";
+ else {
+ if ($is_empty && $this->params->get('hide_brackets_if_empty'))
+ $html .= " | ";
+ else
+ $html .= "[" . $user_field . "] | ";
}
+ }
if ( $this->show_user_field_2 ) {
$user_field = stripslashes($attachment->user_field_2);
- if ( StringHelper::strlen($user_field) == 0 )
+ $is_empty = 0;
+ if ( StringHelper::strlen($user_field) == 0 ) {
$user_field = ' ';
+ $is_empty = 1;
+ }
+
if ( $this->show_column_titles )
$html .= "" . $user_field . " | ";
- else
- $html .= "[" . $user_field . "] | ";
+ else {
+ if ($is_empty && $this->params->get('hide_brackets_if_empty'))
+ $html .= " | ";
+ else
+ $html .= "[" . $user_field . "] | ";
}
+ }
if ( $this->show_user_field_3 ) {
$user_field = stripslashes($attachment->user_field_3);
- if ( StringHelper::strlen($user_field) == 0 )
+ $is_empty = 0;
+ if ( StringHelper::strlen($user_field) == 0 ) {
$user_field = ' ';
+ $is_empty = 1;
+ }
+
if ( $this->show_column_titles )
$html .= "" . $user_field . " | ";
- else
- $html .= "[" . $user_field . "] | ";
+ else {
+ if ($is_empty && $this->params->get('hide_brackets_if_empty'))
+ $html .= " | ";
+ else
+ $html .= "[" . $user_field . "] | ";
}
-
+ }
// Add the creator's username (if requested)
if ( $this->show_creator_name ) {
$html .= "{$attachment->creator_name} | ";