Class Horde

Description

The Horde:: class provides the functionality shared by all Horde applications.

Located in /Horde/Horde.php (line 28)


	
			
Method Summary
 void addScriptFile (string $file, [string $app = null], [boolean $direct = false], [boolean $full = false])
 string applicationUrl (string $uri, [boolean $full = false], [integer $append_session = 0])
 void assertDriverConfig (array $params, string $driver, array $fields, [string $name = null], [string $file = 'conf.php'], [string $variable = '$conf'])
 mixed callHook (string $hook, [array $args = array()], [string $app = 'horde'], [mixed $error = 'PEAR_Error'])
 void checkRequestToken ( $slug,  $token)
 void compressOutput ()
 string downloadUrl (string $filename, [array $params = array()], [string $url = null])
 string externalUrl (string $url, [boolean $tag = false])
 void fatal (mixed $error, integer $file, integer $line, [boolean $log = true])
 string getAccessKey (string $label, [boolean $nocheck = false], [ $shutdown = false])
 string getAccessKeyAndTitle (string $label, [boolean $nocheck = false])
 void getCleanSession ()
 array getDriverConfig (mixed $backend, [string $type = 'sql'])
 mixed &getLogger ()
 array getMailerConfig ()
 void getRequestToken ( $slug)
 string getServiceLink (string $type, string $app, [boolean $override = false], [boolean $referrer = true])
 array getStylesheets ([ $apps = null], [mixed $theme = ''], [boolean $inherit = true], string|array $app)
 string getTempDir ()
 string getTempFile ([string $prefix = 'Horde'], [boolean $delete = true], [string $dir = ''], [boolean $secure = false])
 array getVFSConfig (string $name)
 mixed hasPermission (string $permission)
 string highlightAccessKey (string $label, string $accessKey)
 string img (string $src, [string $alt = ''], [mixed $attr = ''], [string $dir = null])
 string label (string $for, string $label, [string $ak = null])
 string link ([string $url = ''], [string $title = ''], [string $class = ''], [string $target = ''], [string $onclick = ''], [string $title2 = ''], [string $accesskey = ''], [array $attributes = array()], [boolean $escape = true])
 string linkTooltip (string $url, [string $status = ''], [string $class = ''], [string $target = ''], [string $onclick = ''], [string $title = ''], [string $accesskey = ''], [array $attributes = array()])
 void listScriptFiles ()
 mixed loadConfiguration (string $config_file, [string|array $var_names = null], [string $app = null], [boolean $show_output = false])
 void logMessage (mixed $message, string $file, integer $line, [integer $priority = PEAR_LOG_INFO])
 string selfUrl ([boolean $script_params = false], [boolean $nocache = true], [boolean $full = false], [boolean $force_ssl = false])
 boolean showService (string $type, [boolean $override = false])
 string signQueryString (string $queryString, [integer $now = null])
 string stripAccessKey (string $label)
 string stylesheetLink ([ $apps = null], [mixed $theme = ''], [boolean $inherit = true], string|array $app)
 string url (string $uri, [boolean $full = false], [integer $append_session = 0], [boolean $force_ssl = false])
 boolean verifySignedQueryString (string $data, [integer $now = null])
 string webServerID ()
 string widget (string $url, [string $title = ''], [string $class = 'widget'], [string $target = ''], [string $onclick = ''], [string $title2 = ''], [boolean $nocheck = false])
Methods
addScriptFile (line 274)

Adds the javascript code to the output (if output has already started) or to the list of script files to include via includeScriptFiles().

void addScriptFile (string $file, [string $app = null], [boolean $direct = false], [boolean $full = false])
  • string $file: The full javascript file name.
  • string $app: The application name. Defaults to the current application.
  • boolean $direct: Include the file directly without passing it through javascript.php
  • boolean $full: Output a full URL
allowOutputCompression (line 1305)

Determines if output compression can be used.

  • return: True if output compression can be used, false if not.
boolean allowOutputCompression ()
applicationUrl (line 861)

Returns a session-id-ified version of $uri, using the current application's webroot setting.

  • return: The url with the session id appended.
string applicationUrl (string $uri, [boolean $full = false], [integer $append_session = 0])
  • string $uri: The URI to be modified.
  • boolean $full: Generate a full (http://server/path/) URL.
  • integer $append_session:
    1. = only if needed, 1 = always, -1 = never.
assertDriverConfig (line 716)

Checks if all necessary parameters for a driver configuration are set and throws a fatal error with a detailed explanation how to fix this, if something is missing.

void assertDriverConfig (array $params, string $driver, array $fields, [string $name = null], [string $file = 'conf.php'], [string $variable = '$conf'])
  • array $params: The configuration array with all parameters.
  • string $driver: The key name (in the configuration array) of the driver.
  • array $fields: An array with mandatory parameter names for this driver.
  • string $name: The clear text name of the driver. If not specified, the application name will be used.
  • string $file: The configuration file that should contain these settings.
  • string $variable: The name of the configuration variable.
authenticationFailureRedirect (line 1678)

Redirects to the main Horde login page on authentication failure.

void authenticationFailureRedirect ()
callHook (line 1711)

Provides a standardised function to call a Horde hook, checking whether a hook config file exists and whether the function itself exists. If these two conditions are not satisfied it will return the specified value (by default a PEAR error).

  • return: Either the results of the hook or PEAR error on failure.
mixed callHook (string $hook, [array $args = array()], [string $app = 'horde'], [mixed $error = 'PEAR_Error'])
  • string $hook: The function to call.
  • array $args: An array of any arguments to pass to the hook function.
  • string $app: If specified look for hooks in the config directory of this app.
  • mixed $error: What to return if $app/config/hooks.php or $hook does not exist. If this is the string 'PEAR_Error' a PEAR error object is returned instead, detailing the failure.
checkRequestToken (line 333)

Check if a token for a form is valid.

  • since: Horde 3.2
void checkRequestToken ( $slug,  $token)
  • $slug
  • $token
compressOutput (line 1277)

Starts output compression, if requested.

void compressOutput ()
disableAutoloadHordeJS (line 309)

Disable auto-loading of the horde.js script.

Needs to auto-load by default for BC.

  • todo: Remove for Horde 4
  • since: Horde 3.2
void disableAutoloadHordeJS ()
downloadUrl (line 922)

Returns a URL to be used for downloading, that takes into account any special browser quirks (i.e. IE's broken filename handling).

  • return: The download URL.
string downloadUrl (string $filename, [array $params = array()], [string $url = null])
  • string $filename: The filename of the download data.
  • array $params: Any additional parameters needed.
  • string $url: The URL to alter. If none passed in, will use the file 'view.php' located in the current module's base directory.
externalUrl (line 888)

Returns an external link passed through the dereferrer to strip session IDs from the referrer.

  • return: The link to the dereferrer script.
string externalUrl (string $url, [boolean $tag = false])
  • string $url: The external URL to link to.
  • boolean $tag: If true, a complete <a> tag is returned, only the url otherwise.
fatal (line 190)

Aborts with a fatal error, displaying debug information to the user.

void fatal (mixed $error, integer $file, integer $line, [boolean $log = true])
  • mixed $error: A PEAR_Error object with debug information or an error message.
  • integer $file: The file in which the error occured.
  • integer $line: The line on which the error occured.
  • boolean $log: Log this message via Horde::logMessage()?
getAccessKey (line 1529)

Returns an un-used access key from the label given.

  • return: A single lower case character access key or empty string if none can be found
string getAccessKey (string $label, [boolean $nocheck = false], [ $shutdown = false])
  • string $label: The label to choose an access key from.
  • boolean $nocheck: Don't check if the access key already has been used?
  • $shutdown
getAccessKeyAndTitle (line 1640)

Returns the appropriate "accesskey" and "title" attributes for an HTML tag and the given label.

  • return: The title, and if appropriate, the accesskey attributes for the element.
string getAccessKeyAndTitle (string $label, [boolean $nocheck = false])
  • string $label: The title of an HTML element
  • boolean $nocheck: Don't check if the access key already has been used?
getCleanSession (line 144)

Destroys any existing session on login and make sure to use a new session ID, to avoid session fixation issues. Should be called before checking a login.

void getCleanSession ()
getDriverConfig (line 626)

Returns the driver parameters for the specified backend.

  • return: The connection parameters.
array getDriverConfig (mixed $backend, [string $type = 'sql'])
  • mixed $backend: The backend system (e.g. 'prefs', 'categories', 'contacts') being used. The used configuration array will be $conf[$backend]. If an array gets passed, it will be $conf[$key1][$key2].
  • string $type: The type of driver.
getLogger (line 105)

Get an instantiated instance of the configured logger, if enabled.

New as of Horde 3.2: getLogger() will fatally exit if a Log object can not be instantiated - there is no need to check the return for a PEAR_Error anymore.

  • return: Log object on success, false if disabled.
mixed &getLogger ()
getMailerConfig (line 687)

Return the driver and parameters for the current mailer configuration.

  • return: Array with driver name and parameter hash.
  • since: Horde 3.3.5
array getMailerConfig ()
getRequestToken (line 320)

Get a token for protecting a form.

  • since: Horde 3.2
void getRequestToken ( $slug)
  • $slug
getServiceLink (line 422)

Checks if link should be shown and return the necessary code.

  • return: The HTML to create the link.
string getServiceLink (string $type, string $app, [boolean $override = false], [boolean $referrer = true])
  • string $type: Type of link to display
  • string $app: The name of the current Horde application.
  • boolean $override: Override Horde settings?
  • boolean $referrer: Include the current page as the referrer (url=)?
getStylesheets (line 1393)

Return the list of base stylesheets to display.

  • since: Horde 3.2
array getStylesheets ([ $apps = null], [mixed $theme = ''], [boolean $inherit = true], string|array $app)
  • string|array $app: The Horde application(s).
  • mixed $theme: The theme to use; specify an empty value to retrieve the theme from user preferences, and false for no theme.
  • boolean $inherit: Inherit Horde-wide CSS?
  • $apps
getTempDir (line 1231)

Determines the location of the system temporary directory. If a specific setting cannot be found, it defaults to /tmp.

  • return: A directory name that can be used for temp files. Returns false if one could not be found.
string getTempDir ()
getTempFile (line 1264)

Creates a temporary filename for the lifetime of the script, and (optionally) registers it to be deleted at request shutdown.

  • return: Returns the full path-name to the temporary file or false if a temporary file could not be created.
string getTempFile ([string $prefix = 'Horde'], [boolean $delete = true], [string $dir = ''], [boolean $secure = false])
  • string $prefix: Prefix to make the temporary name more recognizable.
  • boolean $delete: Delete the file at the end of the request?
  • string $dir: Directory to create the temporary file in.
  • boolean $secure: If deleting file, should we securely delete the file?
getVFSConfig (line 659)

Returns the VFS driver parameters for the specified backend.

  • return: A hash with the VFS parameters; the VFS driver in 'type' and the connection parameters in 'params'.
array getVFSConfig (string $name)
  • string $name: The VFS system name (e.g. 'images', 'documents') being used.
hasPermission (line 1751)

Returns the specified permission for the current user.

  • return: The value of the specified permission.
  • since: Horde 3.1
mixed hasPermission (string $permission)
  • string $permission: A permission, currently only 'max_blocks'.
highlightAccessKey (line 1610)

Highlights an access key in a label.

  • return: The HTML version of the label with the access key highlighted.
string highlightAccessKey (string $label, string $accessKey)
  • string $label: The label to highlight the access key in.
  • string $accessKey: The access key to highlight.
img (line 1172)

Constructs a correctly-pathed link to an image.

  • return: The full image tag.
string img (string $src, [string $alt = ''], [mixed $attr = ''], [string $dir = null])
  • string $src: The image file.
  • string $alt: Text describing the image.
  • mixed $attr: Any additional attributes for the image tag. Can be a pre-built string or an array of key/value pairs that will be assembled and html-encoded.
  • string $dir: The root graphics directory.
includeScriptFiles (line 283)

Includes javascript files that were needed before any headers were sent.

void includeScriptFiles ()
label (line 1662)

Returns a label element including an access key for usage in conjuction with a form field. User preferences regarding access keys are respected.

  • return: The html code for the label element.
string label (string $for, string $label, [string $ak = null])
  • string $for: The form field's id attribute.
  • string $label: The label text.
  • string $ak: The access key to use. If null a new access key will be generated.
link (line 1003)

Returns an anchor tag with the relevant parameters

  • return: The full <a href> tag.
string link ([string $url = ''], [string $title = ''], [string $class = ''], [string $target = ''], [string $onclick = ''], [string $title2 = ''], [string $accesskey = ''], [array $attributes = array()], [boolean $escape = true])
  • string $url: The full URL to be linked to.
  • string $title: The link title/description.
  • string $class: The CSS class of the link.
  • string $target: The window target to point to.
  • string $onclick: JavaScript action for the 'onclick' event.
  • string $title2: The link title (tooltip) (deprecated - just use $title).
  • string $accesskey: The access key to use.
  • array $attributes: Any other name/value pairs to add to the <a> tag.
  • boolean $escape: Whether to escape special characters in the title attribute.
linkTooltip (line 1069)

Uses DOM Tooltips to display the 'title' attribute for Horde::link() calls.

  • return: The full <a href> tag.
string linkTooltip (string $url, [string $status = ''], [string $class = ''], [string $target = ''], [string $onclick = ''], [string $title = ''], [string $accesskey = ''], [array $attributes = array()])
  • string $url: The full URL to be linked to
  • string $status: The JavaScript mouse-over string
  • string $class: The CSS class of the link
  • string $target: The window target to point to.
  • string $onclick: JavaScript action for the 'onclick' event.
  • string $title: The link title (tooltip).
  • string $accesskey: The access key to use.
  • array $attributes: Any other name/value pairs to add to the <a> tag.
listScriptFiles (line 296)

Provide a list of script files to be included in the current page.

  • since: Horde 3.2
void listScriptFiles ()
loadConfiguration (line 503)

Loads global and vhost specific configuration files.

  • return: The value of $var_names, in a compact()'ed array if $var_names is an array.
  • since: Horde 3.2
mixed loadConfiguration (string $config_file, [string|array $var_names = null], [string $app = null], [boolean $show_output = false])
  • string $config_file: The name of the configuration file.
  • string|array $var_names: The name(s) of the variable(s) that is/are defined in the configuration file.
  • string $app: The application. Defaults to the current application.
  • boolean $show_output: If true, the contents of the requested config file are simply output instead of loaded into a variable.
logMessage (line 50)

Logs a message to the global Horde log backend.

void logMessage (mixed $message, string $file, integer $line, [integer $priority = PEAR_LOG_INFO])
  • mixed $message: Either a string or a PEAR_Error object.
  • string $file: What file was the log function called from (e.g. __FILE__)?
  • integer $line: What line was the log function called from (e.g. __LINE__)?
  • integer $priority: The priority of the message. One of:
     PEAR_LOG_EMERG
     PEAR_LOG_ALERT
     PEAR_LOG_CRIT
     PEAR_LOG_ERR
     PEAR_LOG_WARNING
     PEAR_LOG_NOTICE
     PEAR_LOG_INFO
     PEAR_LOG_DEBUG
selfUrl (line 1128)

Returns a session-id-ified version of $SCRIPT_NAME resp. $PHP_SELF.

  • return: The requested URI.
string selfUrl ([boolean $script_params = false], [boolean $nocache = true], [boolean $full = false], [boolean $force_ssl = false])
  • boolean $script_params: Include script parameters like QUERY_STRING and PATH_INFO?
  • boolean $nocache: Include a nocache parameter in the URL?
  • boolean $full: Return a full URL?
  • boolean $force_ssl: Ignore $conf['use_ssl'] and force creation of a SSL URL?
setupSessionHandler (line 1475)

Sets a custom session handler up, if there is one.

If the global variable 'session_cache_limiter' is defined, its value will override the cache limiter setting found in the configuration file.

void setupSessionHandler ()
showService (line 462)
  • return: True if the link is to be shown.
boolean showService (string $type, [boolean $override = false])
  • string $type: The type of link.
  • boolean $override: Override Horde settings?
signQueryString (line 358)

Add a signature + timestamp to a query string and return the signed query string.

  • return: The signed query string.
  • since: Horde 3.3
string signQueryString (string $queryString, [integer $now = null])
  • string $queryString: The query string to sign.
  • integer $now: The timestamp at which to sign. Leave blank for generating signatures; specify when testing.
stripAccessKey (line 1589)

Strips an access key from a label.

For multibyte charset strings the access key gets removed completely, otherwise only the underscore gets removed.

  • return: The label with the access key being stripped.
string stripAccessKey (string $label)
  • string $label: The label containing an access key.
stylesheetLink (line 1368)

Returns the <link> tags for the CSS stylesheets.

  • return: <link> tags for CSS stylesheets.
string stylesheetLink ([ $apps = null], [mixed $theme = ''], [boolean $inherit = true], string|array $app)
  • string|array $app: The Horde application(s).
  • mixed $theme: The theme to use; specify an empty value to retrieve the theme from user preferences, and false for no theme.
  • boolean $inherit: Inherit Horde-wide CSS?
  • $apps
url (line 764)

Returns a session-id-ified version of $uri.

If a full URL is requested, all parameter separators get converted to "&", otherwise to "&amp;".

  • return: The URL with the session id appended (if needed).
string url (string $uri, [boolean $full = false], [integer $append_session = 0], [boolean $force_ssl = false])
  • string $uri: The URI to be modified.
  • boolean $full: Generate a full (http://server/path/) URL.
  • integer $append_session:
    1. = only if needed, 1 = always, -1 = never.
  • boolean $force_ssl: Ignore $conf['use_ssl'] and force creation of a SSL URL?
verifySignedQueryString (line 384)

Verify a signature and timestamp on a query string.

  • return: Whether or not the string was valid.
  • since: Horde 3.3
boolean verifySignedQueryString (string $data, [integer $now = null])
  • string $data: The signed query string.
  • integer $now: The current time (can override for testing).
webServerID (line 1345)

Returns the Web server being used.

PHP string list built from the PHP 'configure' script.

  • return: A web server identification string.
     'aolserver' = AOL Server
     'apache1'   = Apache 1.x
     'apache2'   = Apache 2.x
     'caudium'   = Caudium
     'cgi'       = Unknown server - PHP built as CGI program
     'cli'       = Command Line Interface build
     'embed'     = Embedded PHP
     'isapi'     = Zeus ISAPI
     'milter'    = Milter
     'nsapi'     = NSAPI
     'phttpd'    = PHTTPD
     'pi3web'    = Pi3Web
     'roxen'     = Roxen/Pike
     'servlet'   = Servlet
     'thttpd'    = thttpd
     'tux'       = Tux
     'webjames'  = Webjames
string webServerID ()
widget (line 1104)

Returns an anchor sequence with the relevant parameters for a widget with accesskey and text.

  • return: The full <a href>Title</a> sequence.
  • access: public
string widget (string $url, [string $title = ''], [string $class = 'widget'], [string $target = ''], [string $onclick = ''], [string $title2 = ''], [boolean $nocheck = false])
  • string $url: The full URL to be linked to.
  • string $title: The link title/description.
  • string $class: The CSS class of the link
  • string $target: The window target to point to.
  • string $onclick: JavaScript action for the 'onclick' event.
  • string $title2: The link title (tooltip) (deprecated - just use $title).
  • boolean $nocheck: Don't check if the access key already has been used. Defaults to false (= check).

Documentation generated on Sun, 30 Jan 2011 05:18:08 +0000 by phpDocumentor 1.4.3