1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-29 06:23:01 +00:00

Forgot to actually commit the code.... oops :P

This commit is contained in:
Starbeamrainbowlabs 2015-10-18 13:23:02 +01:00
parent 00dab816fb
commit 7fd3d452d4

View file

@ -0,0 +1,47 @@
<?php
register_module([
"name" => "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:
});
}
]);
?>