From 7f74792c2f82aee3cd98bd6304ced55894b43683 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 4 Jan 2015 17:08:51 +0100 Subject: Improve history api for multipastes Signed-off-by: Florian Pritz --- application/controllers/file.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'application/controllers/file.php') diff --git a/application/controllers/file.php b/application/controllers/file.php index ac2c4b4ca..5451836de 100644 --- a/application/controllers/file.php +++ b/application/controllers/file.php @@ -640,6 +640,22 @@ class File extends MY_Controller { $lengths[$length_key] = mb_strlen($value); } + foreach ($history["multipaste_items"] as $key => $item) { + $size = 0; + foreach ($item["items"] as $i) { + $size += $i["filesize"]; + } + + $history["items"][] = array( + "id" => $item["url_id"], + "filename" => count($item["items"])." file(s)", + "mimetype" => "", + "date" => $item["date"], + "hash" => "", + "filesize" => $size, + ); + } + $order = is_cli_client() ? "ASC" : "DESC"; uasort($history["items"], function($a, $b) use ($order) { -- cgit v1.2.3-24-g4f1b