\Horde_Deprecated

Contains deprecated methods from the Horde:: class. To be removed in Horde_Core v3.0+.

Summary

Methods
Properties
Constants
sendHTTPResponse()
prepareResponse()
img()
fullSrcImg()
base64ImgData()
callHook()
hookExists()
loadConfiguration()
initMap()
redirect()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

sendHTTPResponse()

sendHTTPResponse(mixed  $data, string  $ct) 

Send response data to browser.

Parameters

mixed $data

The data to serialize and send to the browser.

string $ct

The content-type to send the data with. Either 'json', 'js-json', 'html', 'plain', and 'xml'.

prepareResponse()

prepareResponse(mixed  $data = null, boolean  $notify = false) : object

Returns a response object with added notification information.

Parameters

mixed $data

The 'response' data.

boolean $notify

If true, adds notification info to object.

Returns

object —

The Horde JSON response. It has the following properties:

  • msgs: (array) [OPTIONAL] List of notification messages.
  • response: (mixed) The response data for the request.

img()

img(mixed  $src, string  $alt = '', mixed  $attr = '') : string

Constructs a correctly-pathed tag to an image.

Parameters

mixed $src

The image file (either a string or a Horde_Themes_Image object).

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.

Returns

string —

The full image tag.

fullSrcImg()

fullSrcImg(  $src, array  $opts = array()) 

Same as img(), but returns a full source url for the image.

Useful for when the image may be part of embedded Horde content on an external site.

Parameters

$src
array $opts

base64ImgData()

base64ImgData(mixed  $in, integer  $limit = null) : string

Generate RFC 2397-compliant image data strings.

Parameters

mixed $in

URI or Horde_Themes_Image object containing image data.

integer $limit

Sets a hard size limit for image data; if exceeded, will not string encode.

Returns

string —

The string to use in the image 'src' attribute; either the image data if the browser supports, or the URI if not.

callHook()

callHook(string  $hook, array  $args = array(), string  $app = 'horde') : mixed

Call a Horde hook, handling all of the necessary lookups and parsing of the hook code.

WARNING: Throwing exceptions is expensive, so use callHook() with care and cache the results if you going to use the results more than once.

Parameters

string $hook

The function to call.

array $args

An array of any arguments to pass to the hook function.

string $app

The hook application.

Throws

\Horde_Exception

Thrown on error from hook code.

\Horde_Exception_HookNotSet

Thrown if hook is not active.

Returns

mixed —

The results of the hook.

hookExists()

hookExists(string  $hook, string  $app = 'horde') : boolean

Returns whether a hook exists.

Use this if you have to call a hook many times and expect the hook to not exist.

Parameters

string $hook

The function to call.

string $app

The hook application.

Returns

boolean —

True if the hook exists.

loadConfiguration()

loadConfiguration(string  $config_file, string|array  $var_names = null, string  $app = null, boolean  $show_output = false) : mixed

Loads global and vhost specific configuration files.

Parameters

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.

Throws

\Horde_Exception

Returns

mixed —

The value of $var_names, in a compact()'ed array if $var_names is an array.

initMap()

initMap(array  $params = array()) 

Initialize a HordeMap.

Parameters

array $params

redirect()

redirect(string  $url) 

Utility function to send redirect headers to browser, handling any browser quirks.

Parameters

string $url

The URL to redirect to.