The Red Matrix
|
Provides a DAV frontend for the webbrowser. More...
Public Member Functions | |
__construct (&$auth) | |
Constructor for RedBrowser class. More... | |
set_writeable () | |
generateDirectoryIndex ($path) | |
Creates the directory listing for the given path. More... | |
userReadableSize ($size) | |
Returns a human readable formatted string for filesizes. More... | |
htmlActionsPanel (DAV\INode $node, &$output) | |
Creates a form to add new folders and upload files. More... | |
Protected Member Functions | |
getAssetUrl ($assetName) | |
findAttachHash ($owner, $parentHash, $attachName) | |
Return the hash of an attachment. More... | |
findAttachIdByHash ($attachHash) | |
Returns an attachment's id for a given hash. More... | |
Private Attributes | |
$auth | |
Provides a DAV frontend for the webbrowser.
RedBrowser is a SabreDAV server-plugin to provide a view to the DAV storage for the webbrowser.
http://opensource.org/licenses/mit-license.php The MIT License (MIT)
RedMatrix\RedDAV\RedBrowser::__construct | ( | & | $auth | ) |
Constructor for RedBrowser class.
$enablePost will be activated through set_writeable() in a later stage. At the moment the write_storage permission is only valid for the whole folder. No file specific permissions yet.
Disable assets with $enableAssets = false. Should get some thumbnail views anyway.
RedBasicAuth | &$auth |
|
protected |
Return the hash of an attachment.
Given the owner, the parent folder and and attach name get the attachment hash.
int | $owner | The owner_id |
string | $hash | The parent's folder hash |
string | $attachName | The name of the attachment |
Referenced by RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex().
|
protected |
Returns an attachment's id for a given hash.
This id is used to access the attachment in filestorage/
string | $attachHash | The hash of an attachment |
Referenced by RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex().
RedMatrix\RedDAV\RedBrowser::generateDirectoryIndex | ( | $path | ) |
Creates the directory listing for the given path.
string | $path | which should be displayed |
|
protected |
This method takes a path/name of an asset and turns it into url suiteable for http access.
string | $assetName |
Referenced by RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex().
RedMatrix\RedDAV\RedBrowser::htmlActionsPanel | ( | DAV\INode | $node, |
& | $output | ||
) |
Creates a form to add new folders and upload files.
\Sabre\DAV\INode | $node | |
string | &$output |
RedMatrix\RedDAV\RedBrowser::set_writeable | ( | ) |
The DAV browser is instantiated after the auth module and directory classes but before we know the current directory and who the owner and observer are. So we add a pointer to the browser into the auth module and vice versa. Then when we've figured out what directory is actually being accessed, we call the following function to decide whether or not to show web elements which include writeable objects.
It only disable/enable the visible parts. Not the POST handler which handels the actual requests when uploading files or creating folders.
RedMatrix\RedDAV\RedBrowser::userReadableSize | ( | $size | ) |
Returns a human readable formatted string for filesizes.
Don't we need such a functionality in other places, too?
int | $size | filesize in bytes |
Referenced by RedMatrix\RedDAV\RedBrowser\generateDirectoryIndex().
|
private |
Referenced by RedMatrix\RedDAV\RedBrowser\__construct().