The Hubzilla
 All Classes Namespaces Files Functions Variables Pages
Zotlabs\Storage\Browser Class Reference

Provides a DAV frontend for the webbrowser. More...

Inheritance diagram for Zotlabs\Storage\Browser:
[legend]

Public Member Functions

 __construct (&$auth)
 Constructor for Browser class. More...
 
 set_writeable ()
 
 generateDirectoryIndex ($path)
 Creates the directory listing for the given path. More...
 
 htmlActionsPanel (DAV\INode $node, &$output, $path)
 Creates a form to add new folders and upload files. More...
 

Public Attributes

 $build_page = false
 

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

BasicAuth $auth
 

Detailed Description

Provides a DAV frontend for the webbrowser.

Browser is a SabreDAV server-plugin to provide a view to the DAV storage for the webbrowser.

\DAV\Browser\Plugin

License: http://opensource.org/licenses/mit-license.php The MIT License (MIT)

Constructor & Destructor Documentation

Zotlabs\Storage\Browser::__construct ( $auth)

Constructor for Browser 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.

Todo:
disable enablePost by default and only activate if permissions grant edit rights.

Disable assets with $enableAssets = false. Should get some thumbnail views anyway.

Parameters
BasicAuth&$auth

Member Function Documentation

Zotlabs\Storage\Browser::findAttachHash (   $owner,
  $parentHash,
  $attachName 
)
protected

Return the hash of an attachment.

Given the owner, the parent folder and and attach name get the attachment hash.

Parameters
int$ownerThe owner_id
string$parentHashThe parent's folder hash
string$attachNameThe name of the attachment
Returns
string
Zotlabs\Storage\Browser::findAttachIdByHash (   $attachHash)
protected

Returns an attachment's id for a given hash.

This id is used to access the attachment in filestorage/

Parameters
string$attachHashThe hash of an attachment
Returns
string
Zotlabs\Storage\Browser::generateDirectoryIndex (   $path)

Creates the directory listing for the given path.

Parameters
string$pathwhich should be displayed
Zotlabs\Storage\Browser::getAssetUrl (   $assetName)
protected

This method takes a path/name of an asset and turns it into url suiteable for http access.

Parameters
string$assetName
Returns
string
Zotlabs\Storage\Browser::htmlActionsPanel ( DAV\INode  $node,
$output,
  $path 
)

Creates a form to add new folders and upload files.

Parameters
\Sabre\DAV\INode$node
[in,out]string&$output
string$path
Zotlabs\Storage\Browser::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.

Fixme:
It only disable/enable the visible parts. Not the POST handler which handels the actual requests when uploading files or creating folders.
Todo:
Maybe this whole way of doing this can be solved with some $server->subscribeEvent().

Member Data Documentation

BasicAuth Zotlabs\Storage\Browser::$auth
private
See Also
set_writeable()
\Sabre\DAV\Auth\Backend\BackendInterface $auth
Zotlabs\Storage\Browser::$build_page = false

The documentation for this class was generated from the following file: