From 7fd3d452d41053b93940cc88be9184804aec5a9a Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 18 Oct 2015 13:23:02 +0100 Subject: [PATCH] Forgot to actually commit the code.... oops :P --- modules/feature-upload.php | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/modules/feature-upload.php b/modules/feature-upload.php index e69de29..e9897af 100644 --- a/modules/feature-upload.php +++ b/modules/feature-upload.php @@ -0,0 +1,47 @@ + "Uploader", + "version" => "0.1", + "author" => "Starbeamrainbowlabs", + "description" => "Adds the ability to upload files to Pepperminty Wiki. Uploaded files act as pages and have the special 'File:' prefix.", + "id" => "feature-upload", + "code" => function() { + add_action("upload", function() { + global $settings; + + + switch($_SERVER["REQUEST_METHOD"]) + { + case "GET": + // Send upload page + break; + + case "PUT": + case "POST": + // Recieve file + + + + break; + } + }); + add_action("preview", function() { + global $settings; + + // todo render a preview here + + /* + * size (image outputs only, possibly width / height) + * 1-2048 (configurable) + * filetype + * either a mime type or 'native' + */ + }); + + page_renderer::register_part_preprocessor(function(&$parts) { + // Todo add the preview to the top o fthe page here, but onyl if the current action is view and we are on a page prefixed with file: + }); + } +]); + +?>