diff --git a/admin/manage_knowledgebase.php b/admin/manage_knowledgebase.php index 481fddd9..9235952a 100644 --- a/admin/manage_knowledgebase.php +++ b/admin/manage_knowledgebase.php @@ -435,7 +435,6 @@ if (!isset($_SESSION['hide']['new_article']))
-
@@ -1139,14 +1138,26 @@ function save_article() require_once(HESK_PATH . 'inc/posting_functions.inc.php'); require_once(HESK_PATH . 'inc/attachments.inc.php'); $attachments = array(); - for ($i=1;$i<=3;$i++) - { - $att = hesk_uploadFile($i, false); - if ( ! empty($att)) - { - $attachments[$i] = $att; + $use_legacy_attachments = hesk_POST('use-legacy-attachments', 0); + + if ($use_legacy_attachments) { + for ($i=1;$i<=3;$i++) { + $att = hesk_uploadFile($i, false); + if ( ! empty($att)) { + $attachments[$i] = $att; + } + } + } else { + // The user used the new drag-and-drop system. + $temp_attachment_ids = hesk_POST_array('attachment-ids'); + foreach ($temp_attachment_ids as $temp_attachment_id) { + // Simply get the temp info and move it to the attachments table + $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); + $attachments[] = $temp_attachment; + mfh_deleteTemporaryAttachment($temp_attachment_id); } } + $myattachments=''; /* Any errors? */ @@ -1478,17 +1489,27 @@ function edit_article() } ?> -
-
- +
+
+ +
'; + } + ?> +
+
+
- - +
+ + +