Class Gollem

Description

Gollem Base Class.

Located in /lib/Gollem.php (line 38)


	
			
Method Summary
 string addInlineScript (string $script)
 string backendSelect ()
 boolean canAutoLogin ([string $key = null], [boolean $force = false])
 mixed changeDir ()
 mixed changePermissions (string $dir, string $name, string $permission)
 boolean checkAuthentication ([string $mode = null], [boolean $redirect = true])
 boolean checkPermissions (string $filter, [integer $permission = PERMS_READ], [string $backend = null])
 mixed copyFile (string $backend_f, string $dir, string $name, string $backend_t, string $newdir)
 mixed createFolder (string $dir, string $name)
 mixed deleteFile (string $dir, string $name)
 mixed deleteFolder (string $dir, string $name)
 string directoryNavLink (string $currdir, string $url)
 array displayColumns ()
 void expireCache (string $dir)
 string getAutologinID (string $backend)
 array &getBackends ([string $perms = 'all'])
 mixed getDir ()
 string getDisplayPath (string $path)
 string getHome ()
 mixed getMenu ([string $returnType = 'object'])
 string getRoot ()
 object The &getVFSOb (string $backend_key, [ $params = array()])
 array getVFSPath (string $fullpath)
 array listFolder (string $dir)
 void loadBackendList ()
 string logoutUrl ()
 void menu ()
 mixed moveFile (string $backend_f, string $dir, string $name, string $backend_t, string $newdir)
 string outputInlineScript ()
 string pathEncode (string $path)
 string realPath (string $path)
 mixed renameItem (string $oldDir, string $old, string $newDir,  $new)
 mixed setDir (string $dir)
 void status ()
 string stripAPIPath (string $path)
 string subdirectory (string $base, string $dir)
 boolean verifyDir (string $dir)
 mixed writeFile (string $dir, string $name, string $filename)
Methods
addInlineScript (line 1107)

Add inline javascript to the output buffer.

  • return: The javascript text to output, or empty if the page headers have not yet been sent.
  • since: Gollem 1.1
string addInlineScript (string $script)
  • string $script: The script text to add.
backendSelect (line 874)

Generate the backend selection list for use in the menu.

  • return: The backend selection list.
string backendSelect ()
canAutoLogin (line 83)

Can we log in without a login screen for the requested backend key?

  • return: True if autologin possible, false if not.
boolean canAutoLogin ([string $key = null], [boolean $force = false])
  • string $key: The backend key to check. Defaults to Gollem::getPreferredBackend().
  • boolean $force: If true, check the backend key even if there is more than one backend.
changeDir (line 124)

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

  • return: True on Success, PEAR_Error on failure.
mixed changeDir ()
changePermissions (line 528)

Change permissions on files using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed changePermissions (string $dir, string $name, string $permission)
  • string $dir: The directory name.
  • string $name: The filename to change permissions on.
  • string $permission: The permission mode to set.
checkAuthentication (line 50)

Check Gollem authentication and change to the currently active directory. Redirects to login page on authentication/session failure.

  • return: True on success, false on failure.
boolean checkAuthentication ([string $mode = null], [boolean $redirect = true])
  • string $mode: The authentication mode we are using.
  • boolean $redirect: Redirect to the logout page if authentication is unsuccessful?
checkPermissions (line 743)

Checks if a user has the specified permissions on the selected backend.

  • return: Returns true if the user has permission, false if they do not.
boolean checkPermissions (string $filter, [integer $permission = PERMS_READ], [string $backend = null])
  • string $filter: What are we checking for.
  • integer $permission: What permission to check for.
  • string $backend: The backend to check. If empty, check the current backend.
copyFile (line 586)

Copies a file using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed copyFile (string $backend_f, string $dir, string $name, string $backend_t, string $newdir)
  • 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.
createFolder (line 427)

Create a folder using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed createFolder (string $dir, string $name)
  • string $dir: The directory path.
  • string $name: The folder to create.
deleteFile (line 511)

Delete a file using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFile (string $dir, string $name)
  • string $dir: The directory name.
  • string $name: The filename to delete.
deleteFolder (line 490)

Delete a folder using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed deleteFolder (string $dir, string $name)
  • string $dir: The subdirectory name.
  • string $name: The folder name to delete.
directoryNavLink (line 769)

Produces a directory link used for navigation.

  • return: The directory navigation string.
string directoryNavLink (string $currdir, string $url)
  • string $currdir: The current directory string.
  • string $url: The URL to link to.
displayColumns (line 714)

Parse the 'columns' preference.

  • return: The list of columns to be displayed.
array displayColumns ()
expireCache (line 354)

Expire a folder cache entry.

  • since: Gollem 1.1
void expireCache (string $dir)
  • string $dir: The directory name.
getAutologinID (line 915)

Get the authentication ID to use for autologins based on the value of the 'hordeauth' parameter.

  • return: The ID string to use for logins.
string getAutologinID (string $backend)
  • string $backend: The backend to login to.
getBackends (line 1076)

Get a list of the available backends for permissions setup.

  • return: The requested backend list.
array &getBackends ([string $perms = 'all'])
  • string $perms: 'all' - Return all backends. 'perms' - Return backends which have perms set. 'noperms' - Return backends which have no perms set.
getDir (line 163)

Get the current directory of the Gollem session.

  • return: Current dir on success or null on failure.
mixed getDir ()
getDisplayPath (line 1055)

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

  • return: The display path.
string getDisplayPath (string $path)
  • string $path: The path to display.
getHome (line 153)

Get the home directory of the Gollem session.

  • return: The home directory.
string getHome ()
getMenu (line 807)

Build Gollem's list of menu items.

  • return: Either a Horde_Menu object or the rendered menu text.
mixed getMenu ([string $returnType = 'object'])
  • string $returnType: Either 'object' or 'string'.
getPreferredBackend (line 659)

Get the current preferred backend key.

  • return: The preferred backend key.
string getPreferredBackend ()
getRoot (line 143)

Get the root directory of the Gollem session.

  • return: The root directory.
string getRoot ()
getVFSOb (line 978)

Return a Horde_VFS object for the given backend.

  • return: Horde_VFS object requested.
object The &getVFSOb (string $backend_key, [ $params = array()])
  • string $backend_key: The backend_key VFS object to return.
  • $params
getVFSPath (line 1206)

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

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

  • return: Array of ($path, $name)
array getVFSPath (string $fullpath)
  • string $fullpath: Path to be split.
listFolder (line 293)

List the current folder.

  • return: The sorted list of files.
array listFolder (string $dir)
  • string $dir: The directory name.
loadBackendList (line 892)

Load the backends list into the global $gollem_backends variable.

void loadBackendList ()
logoutUrl (line 395)

Generate an URL to the logout screen that includes any known information, such as username, server, etc., that can be filled in on the login form.

  • return: The logout URL with parameters added.
string logoutUrl ()
menu (line 844)

Outputs Gollem's menu to the current output stream.

  • since: Gollem 1.0.2
void menu ()
moveFile (line 570)

Moves a file using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed moveFile (string $backend_f, string $dir, string $name, string $backend_t, string $newdir)
  • 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.
outputInlineScript (line 1133)

Print inline javascript to the output buffer.

  • return: The javascript text to output.
  • since: Gollem 1.1
string outputInlineScript ()
pathEncode (line 1191)

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 " ".

  • return: URL-encoded string with '/' preserved.
  • since: Gollem 1.1
string pathEncode (string $path)
  • string $path: Path to be urlencode()d.
realPath (line 939)

Returns the canonical path of the string. Like PHP's built-in realpath() except the directory need not exist on the local server.

Algorithim loosely based on code from the Perl File::Spec::Unix module (version 1.5).

TODO: Remove once Gollem requires a minimum version of Horde that containts Util::realPath().

  • return: The canonicalized file path.
string realPath (string $path)
  • string $path: A file path.
renameItem (line 477)

Rename files using the current Gollem session settings.

  • return: True on success or a PEAR_Error object on failure.
mixed renameItem (string $oldDir, string $old, string $newDir,  $new)
  • string $oldDir: Old directory name.
  • string $old: New file name.
  • string $newDir: New directory name.
  • $new
setDir (line 104)

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

  • return: True on Success, PEAR_Error on failure.
mixed setDir (string $dir)
  • string $dir: Directory name.
status (line 864)

Outputs Gollem's status/notification bar.

void status ()
stripAPIPath (line 1159)

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.

  • return: Cleaned path as described above.
string stripAPIPath (string $path)
  • string $path: Path as presented to Gollem API.
subdirectory (line 375)

Generate correct subdirectory links.

  • return: The correct subdirectoy string.
string subdirectory (string $base, string $dir)
  • string $base: The base directory.
  • string $dir: The directory string.
verifyDir (line 702)

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

  • return: True if the directory is below the root.
boolean verifyDir (string $dir)
  • string $dir: The directory to check.
writeFile (line 545)

Write an uploaded file to the VFS backend.

  • return: True on success or a PEAR_Error object on failure.
mixed writeFile (string $dir, string $name, string $filename)
  • string $dir: The directory name.
  • string $name: The filename to create.
  • string $filename: The local file containing the file data.

Documentation generated on Sun, 30 Jan 2011 05:24:44 +0000 by phpDocumentor 1.4.3