\Gollem_Api

Gollem external API interface.

This file defines Gollem's external API interface. Other applications can interact with Gollem through this API.

Copyright 2010-2017 Horde LLC (http://www.horde.org/)

See the enclosed file LICENSE for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Summary

Methods
Properties
Constants
browse()
put()
mkcol()
move()
path_delete()
getViewLink()
selectlistLink()
selectlistResults()
returnFromSelectlist()
setSelectlist()
No public properties found
No constants found
_getBackend()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

browse()

browse(string  $path = '', array  $properties = array('name', 'icon', 'browseable')) : array

Browses through the VFS tree.

Each VFS backend is listed as a directory at the top level. No modify operations are allowed outside any VFS area.

Parameters

string $path

The level of the tree to browse.

array $properties

The item properties to return. Defaults to 'name', 'icon', and 'browseable'.

Throws

\Gollem_Exception

Returns

array —

The contents of $path.

put()

put(string  $path, string  $content, string  $content_type) 

Accepts a file for storage into the VFS.

Parameters

string $path

Path to store file.

string $content

Contents of file.

string $content_type

MIME type of file.

Throws

\Gollem_Exception

mkcol()

mkcol(string  $path) 

Creates a directory ("collection" in WebDAV-speak) within the VFS

Parameters

string $path

Path of directory to create

Throws

\Gollem_Exception

move()

move(string  $path, string  $dest) 

Renames a file or directory

Parameters

string $path

Path to source object to be renamed

string $dest

Path to new name

path_delete()

path_delete(string  $path) 

Removes a file or folder from the VFS

Parameters

string $path

Path of file or folder to delete

getViewLink()

getViewLink(string  $dir, string  $file, string  $backend_key = '') : \Horde_Url

Returns a link to the gollem file preview interface

Parameters

string $dir

File absolute path

string $file

File basename

string $backend_key

Backend key. Defaults to Gollem_Auth::getPreferredBackend().

Returns

\Horde_Url —

The URL object.

selectlistLink()

selectlistLink(string  $link_text, string  $link_style, string  $formid, boolean  $icon = false, string  $selectid = '') : string

Creates a link to the gollem file selection window.

The file section window will return a cache ID value which should be used (along with the selectListResults and returnFromSelectList functions below) to obtain the data from a list of selected files.

There MUST be a form field named 'selectlist_selectid' in the calling form. This field will be populated with the selection ID when the user completes file selection.

There MUST be a form parameter named 'actionID' in the calling form. This form will be populated with the value 'selectlist_process' when the user completes file selection. The calling form will be submitted after the window closes (i.e. the calling form must process the 'selectlist_process' actionID).

Parameters

string $link_text

The text to use in the link.

string $link_style

The style to use for the link.

string $formid

The formid of the calling script.

boolean $icon

Create the link with an icon instead of text?

string $selectid

Selection ID.

Returns

string —

The URL string.

selectlistResults()

selectlistResults(string  $selectid) 

Returns the list of files selected by the user for a given selection ID.

Parameters

string $selectid

The selection ID.

returnFromSelectlist()

returnFromSelectlist(string  $selectid, integer  $index) : string

Returns the data for a given selection ID and index.

Parameters

string $selectid

The selection ID.

integer $index

The index of the file data to return.

Returns

string —

The file data.

setSelectlist()

setSelectlist(string  $selectid = '', array  $files = array()) : string

Sets the files selected for a given selection ID.

Parameters

string $selectid

The selection ID to use.

array $files

An array with each file entry stored in its own array, with the key as the directory name and the value as the filename.

Returns

string —

The selection ID.

_getBackend()

_getBackend(  $path) 

Parameters

$path

Throws

\Gollem_Exception