mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-12-22 13:45:02 +00:00
Forgot to actually commit the code.... oops :P
This commit is contained in:
parent
00dab816fb
commit
7fd3d452d4
1 changed files with 47 additions and 0 deletions
|
@ -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:
|
||||
});
|
||||
}
|
||||
]);
|
||||
|
||||
?>
|
Loading…
Reference in a new issue