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
Determines if output compression can be used.
boolean
allowOutputCompression
()
Returns a session-id-ified version of $uri, using the current application's webroot setting.
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:
- = only if needed, 1 = always, -1 =
never.
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.
Redirects to the main Horde login page on authentication failure.
void
authenticationFailureRedirect
()
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).
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.
Check if a token for a form is valid.
void
checkRequestToken
( $slug, $token)
Starts output compression, if requested.
void
compressOutput
()
Disable auto-loading of the horde.js script.
Needs to auto-load by default for BC.
void
disableAutoloadHordeJS
()
Returns a URL to be used for downloading, that takes into account any special browser quirks (i.e. IE's broken filename handling).
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.
Returns an external link passed through the dereferrer to strip session IDs from the referrer.
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.
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()?
Returns an un-used access key from the label given.
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
Returns the appropriate "accesskey" and "title" attributes for an HTML tag and the given label.
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?
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
()
Returns the driver parameters for the specified backend.
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.
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.
mixed
&getLogger
()
Return the driver and parameters for the current mailer configuration.
array
getMailerConfig
()
Get a token for protecting a form.
void
getRequestToken
( $slug)
Checks if link should be shown and return the necessary code.
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=)?
Return the list of base stylesheets to display.
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
Determines the location of the system temporary directory. If a specific setting cannot be found, it defaults to /tmp.
string
getTempDir
()
Creates a temporary filename for the lifetime of the script, and (optionally) registers it to be deleted at request shutdown.
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?
Returns the VFS driver parameters for the specified backend.
array
getVFSConfig
(string $name)
-
string
$name: The VFS system name (e.g. 'images', 'documents') being used.
Returns the specified permission for the current user.
mixed
hasPermission
(string $permission)
-
string
$permission: A permission, currently only 'max_blocks'.
Highlights an access key in a label.
string
highlightAccessKey
(string $label, string $accessKey)
-
string
$label: The label to highlight the access key in.
-
string
$accessKey: The access key to highlight.
Constructs a correctly-pathed link to an image.
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.
Includes javascript files that were needed before any headers were sent.
void
includeScriptFiles
()
Returns a label element including an access key for usage in conjuction with a form field. User preferences regarding access keys are respected.
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.
Returns an anchor tag with the relevant parameters
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.
Uses DOM Tooltips to display the 'title' attribute for Horde::link() calls.
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.
Provide a list of script files to be included in the current page.
void
listScriptFiles
()
Loads global and vhost specific configuration files.
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.
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
Returns a session-id-ified version of $SCRIPT_NAME resp. $PHP_SELF.
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?
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
()
boolean
showService
(string $type, [boolean $override = false])
-
string
$type: The type of link.
-
boolean
$override: Override Horde settings?
Add a signature + timestamp to a query string and return the signed query string.
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.
Strips an access key from a label.
For multibyte charset strings the access key gets removed completely, otherwise only the underscore gets removed.
string
stripAccessKey
(string $label)
-
string
$label: The label containing an access key.
Returns the <link> tags for the 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
Returns a session-id-ified version of $uri.
If a full URL is requested, all parameter separators get converted to "&", otherwise to "&".
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:
- = only if needed, 1 = always, -1 =
never.
-
boolean
$force_ssl: Ignore $conf['use_ssl'] and force creation of a SSL URL?
Verify a signature and timestamp on a query string.
boolean
verifySignedQueryString
(string $data, [integer $now = null])
-
string
$data: The signed query string.
-
integer
$now: The current time (can override for testing).
Returns the Web server being used.
PHP string list built from the PHP 'configure' script.
string
webServerID
()
Returns an anchor sequence with the relevant parameters for a widget with accesskey and text.
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).