Constants

SORT_TYPE

SORT_TYPE

SORT_NAME

SORT_NAME

SORT_DATE

SORT_DATE

SORT_SIZE

SORT_SIZE

SORT_ASCEND

SORT_ASCEND

SORT_DESCEND

SORT_DESCEND

Properties

$backend

$backend : array

Configuration hash for the current backend.

Type

array

$_columns

$_columns : array

Cache for display columns.

Type

array

Methods

setDir()

setDir(string  $dir) 

Changes the current directory of the Gollem session to the supplied value.

Parameters

string $dir

Directory name.

Throws

\Gollem_Exception

changeDir()

changeDir() 

Changes the current directory of the Gollem session based on the 'dir' form field.

Throws

\Gollem_Exception

sortDate()

sortDate(  $a,   $b) 

Internal sorting function for 'date'.

Parameters

$a
$b

sortSize()

sortSize(  $a,   $b) 

Internal sorting function for 'size'.

Parameters

$a
$b

sortType()

sortType(  $a,   $b) 

Internal sorting function for 'type'.

Parameters

$a
$b

sortName()

sortName(  $a,   $b) 

Internal sorting function for 'name'.

Parameters

$a
$b

listFolder()

listFolder(string  $dir) : array

List the current folder.

Parameters

string $dir

The directory name.

Throws

\Gollem_Exception

Returns

array —

The sorted list of files.

expireCache()

expireCache(string  $dir) 

Expire a folder cache entry.

Parameters

string $dir

The directory name.

subdirectory()

subdirectory(string  $base, string  $dir) : string

Generate correct subdirectory links.

Parameters

string $base

The base directory.

string $dir

The directory string.

Returns

string —

The correct subdirectoy string.

createFolder()

createFolder(string  $dir, string  $name, \Horde_Vfs_Base  $gollem_vfs = null) 

Create a folder using the current Gollem session settings.

Parameters

string $dir

The directory path.

string $name

The folder to create.

\Horde_Vfs_Base $gollem_vfs

A VFS instance to use.

Throws

\Gollem_Exception

renameItem()

renameItem(string  $oldDir, string  $old, string  $newDir,   $new) 

Rename files using the current Gollem session settings.

Parameters

string $oldDir

Old directory name.

string $old

New file name.

string $newDir

New directory name.

$new

Throws

\Gollem_Exception

deleteFolder()

deleteFolder(string  $dir, string  $name) 

Delete a folder using the current Gollem session settings.

Parameters

string $dir

The subdirectory name.

string $name

The folder name to delete.

Throws

\Gollem_Exception

deleteFile()

deleteFile(string  $dir, string  $name) 

Delete a file using the current Gollem session settings.

Parameters

string $dir

The directory name.

string $name

The filename to delete.

Throws

\Gollem_Exception

changePermissions()

changePermissions(string  $dir, string  $name, string  $permission) 

Change permissions on files using the current Gollem session settings.

Parameters

string $dir

The directory name.

string $name

The filename to change permissions on.

string $permission

The permission mode to set.

Throws

\Gollem_Exception

writeFile()

writeFile(string  $dir, string  $name, string  $filename) 

Write an uploaded file to the VFS backend.

Parameters

string $dir

The directory name.

string $name

The filename to create.

string $filename

The local file containing the file data.

moveFile()

moveFile(string  $backend_f, string  $dir, string  $name, string  $backend_t, string  $newdir) 

Moves a file using the current Gollem session settings.

Parameters

string $backend_f

The backend to move the file from.

string $dir

The directory name of the original file.

string $name

The original filename.

string $backend_t

The backend to move the file to.

string $newdir

The directory to move the file to.

Throws

\Gollem_Exception

copyFile()

copyFile(string  $backend_f, string  $dir, string  $name, string  $backend_t, string  $newdir) 

Copies a file using the current Gollem session settings.

Parameters

string $backend_f

The backend to copy the file from.

string $dir

The directory name of the original file.

string $name

The original filename.

string $backend_t

The backend to copy the file to.

string $newdir

The directory to copy the file to.

Throws

\Gollem_Exception

verifyDir()

verifyDir(string  $dir) : boolean

This function verifies whether a given directory is below the root.

Parameters

string $dir

The directory to check.

Returns

boolean —

True if the directory is below the root.

getColumns()

getColumns(  $backend) : array

Parses the 'columns' preference.

Parameters

$backend

Returns

array —

The list of columns to be displayed.

checkPermissions()

checkPermissions(string  $filter, integer  $permission = \Horde_Perms::READ, string  $resource = null) : boolean

Checks if a user has the specified permissions on a resource.

Parameters

string $filter

What are we checking for. Either 'backend' or 'directory'.

integer $permission

The permission to check for. One of the Horde_Perms constants.

string $resource

The resource to check. If empty, check the current backend/directory.

Returns

boolean —

Returns true if the user has permission.

directoryNavLink()

directoryNavLink(string  $currdir, string  $url) : string

Produces a directory link used for navigation.

Parameters

string $currdir

The current directory string.

string $url

The URL to link to.

Returns

string —

The directory navigation string.

getDisplayPath()

getDisplayPath(string  $path) : string

Generate the display path (the path with any root information stripped out).

Parameters

string $path

The path to display.

Returns

string —

The display path.

stripAPIPath()

stripAPIPath(string  $path) : string

Cleans a path presented to Gollem's browse API call.

This will remove:

  • leading '/'
  • leading 'gollem'
  • trailing '/' The desired end result is the path including VFS backend.

Parameters

string $path

Path as presented to Gollem API.

Returns

string —

Cleaned path as described above.

pathEncode()

pathEncode(string  $path) : string

Convert a Gollem path into a URL encoded string, but keep '/'.

This allows for proper PATH_INFO path parsing. Special care is taken to handle "+" and " ".

Parameters

string $path

Path to be urlencode()d.

Returns

string —

URL-encoded string with '/' preserved.

getVFSPath()

getVFSPath(string  $fullpath) : array

Take a fully qualified and break off the file or directory name.

This pair is used for the input to many VFS library functions.

Parameters

string $fullpath

Path to be split.

Returns

array —

Array of ($path, $name)

_setLabel()

_setLabel() 

Set the lable to use for the current page.

_sortDirs()

_sortDirs(  $a,   $b) 

Internal helper to sort directories first if pref set.

Parameters

$a
$b

_getCacheID()

_getCacheID(string  $dir) 

Generate the Cache ID for a directory.

Parameters

string $dir

The directory name.

_copyFile()

_copyFile(  $mode,   $backend_f,   $dir,   $name,   $backend_t,   $newdir) 

Private function that copies/moves files.

Parameters

$mode
$backend_f
$dir
$name
$backend_t
$newdir

Throws

\Gollem_Exception