From fe9ca30c5e3061e1f8a7def634392d9fc267790e Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 7 Mar 2024 10:38:08 +0000 Subject: list attachments in the original order --- include/text.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include/text.php') diff --git a/include/text.php b/include/text.php index aa9650a25..3582b430c 100644 --- a/include/text.php +++ b/include/text.php @@ -1541,15 +1541,16 @@ function theme_attachments(&$item) { $url = z_root() . '/magic?f=&owa=1&hash=' . $item['author_xchan'] . '&bdest=' . bin2hex($r['href'] . '/' . $revision); } - //$s .= '' . $icon . ''; - if (isset($label) && isset($url) && isset($icon) && isset($title)) - $attaches[] = array('label' => $label, 'url' => $url, 'icon' => $icon, 'title' => $title); + if (isset($label) && isset($url) && isset($icon) && isset($title)) { + array_unshift($attaches, ['label' => $label, 'url' => $url, 'icon' => $icon, 'title' => $title]); + } } - if (count($attaches) > 0) + if ($attaches) { $s = replace_macros(get_markup_template('item_attach.tpl'), [ '$attaches' => $attaches ]); + } } return $s; -- cgit v1.2.3