Properties

$ajax

$ajax : boolean

Output code necessary to perform AJAX operations?

Type

boolean

$deferScripts

$deferScripts : boolean

Defer loading of scripts until end of page?

Type

boolean

$growler

$growler : boolean

Output code necessary to display growler notifications?

Type

boolean

$inlineScript

$inlineScript : array

List of inline scripts.

Type

array

$linkTags

$linkTags : array

List of LINK tags to output.

Type

array

$metaTags

$metaTags : array

List of META tags to output.

Type

array

$sidebar

$sidebar : boolean

Load the sidebar in this page?

Type

boolean

$smartmobileInit

$smartmobileInit : array

Smartmobile init code that needs to be output before jquery.mobile.js is loaded.

Type

array

$topbar

$topbar : boolean

Load the topbar in this page?

Type

boolean

$_compress

$_compress : boolean

Has PHP userspace page compression been started?

Type

boolean

$_view

$_view : integer

View mode.

Type

integer

Methods

__construct()

__construct() 

Constructor.

addScriptFile()

addScriptFile(mixed  $file, string  $app = null) : \Horde_Script_File

Adds a single javascript script to the output (if output has already started), or to the list of script files to include in the output.

Parameters

mixed $file

Either a Horde_Script_File object, or the full javascript file name.

string $app

If $file is a file name, this is the application where the file is located. Defaults to the current registry application.

Returns

\Horde_Script_File

Script file object.

addScriptPackage()

addScriptPackage(mixed  $package) : \Horde_Script_Package

Adds a javascript package to the browser output.

Parameters

mixed $package

Either a classname, basename of a Horde_Core_Script_Package class, or a Horde_Script_Package object.

Throws

\Horde_Exception

Returns

\Horde_Script_Package

Package object.

includeScriptFiles()

includeScriptFiles(boolean  $full = false) 

Outputs the necessary script tags, honoring configuration choices as to script caching.

Parameters

boolean $full

Return a full URL?

Throws

\Horde_Exception

addInlineScript()

addInlineScript(string|array  $script, boolean|string  $onload = false, boolean  $top = false) 

Add inline javascript to the output buffer.

Parameters

string|array $script

The script text(s) to add.

boolean|string $onload

Load the script after the page (DOM) has loaded? If a string (either 'prototype' or 'jquery'), that JS framework's method is used. Defaults to Prototype. @since Horde_Core 2.28.0

boolean $top

Add script to top of stack?

addInlineJsVars()

addInlineJsVars(array  $data, mixed  $opts = array()) : array

Add inline javascript variable definitions to the output buffer.

Parameters

array $data

Keys are the variable names, values are the data to JSON encode. If the key begins with a '-', the data will be added to the output as-is.

mixed $opts

If boolean true, equivalent to setting the 'onload' option to true. Other options:

  • onload: (boolean) Wrap the definition in an onload handler? DEFAULT: false
  • ret_vars: (boolean) If true, will return the list of variable definitions instead of outputting to page. DEFAULT: false
  • top: (boolean) Add definitions to top of stack? DEFAULT: false

Returns

array —

Returns the variable list of 'ret_vars' option is true.

outputInlineScript()

outputInlineScript(boolean  $raw = false) 

Print pending inline javascript to the output buffer.

Parameters

boolean $raw

Return the raw script (not wrapped in CDATA tags or observe wrappers)?

includeFavicon()

includeFavicon() 

Generate and output the favicon tag for the current application.

addMetaTag()

addMetaTag(string  $name, string  $content, boolean  $http_equiv = true) 

Adds a META tag to the page output.

Parameters

string $name

The name value.

string $content

The content of the META tag.

boolean $http_equiv

Output http-equiv instead of name?

metaRefresh()

metaRefresh(integer  $time, string  $url) 

Adds a META refresh tag.

Parameters

integer $time

Refresh time.

string $url

Refresh URL

noDnsPrefetch()

noDnsPrefetch() 

Adds a META tag to disable DNS prefetching.

See Horde Bug #8836.

outputMetaTags()

outputMetaTags() 

Output META tags to page.

addLinkTag()

addLinkTag(array  $opts = array()) 

Adds a LINK tag.

All attributes are HTML-encoded. Only pass raw, unencoded attribute values to avoid double escaping.

Parameters

array $opts

Non-default tag elements.

outputLinkTags()

outputLinkTags() 

Output LINK tags.

addStylesheet()

addStylesheet(\Horde_Themes_Element|string  $file, string  $url = null) 

Adds an external stylesheet to the output.

Parameters

\Horde_Themes_Element|string $file

Either a Horde_Themes_Element object or the CSS filepath.

string $url

If $file is a string, this must be a CSS URL.

addThemeStylesheet()

addThemeStylesheet(string  $file) 

Adds a themed stylesheet to the output.

Parameters

string $file

The stylesheet name.

includeStylesheetFiles()

includeStylesheetFiles(array  $opts = array(), boolean  $full = false) 

Generate the stylesheet tags for the current application.

Parameters

array $opts

Options to pass to Horde_Themes_Css::getStylesheetUrls().

boolean $full

Return a full URL? @since Horde_Core 2.28.0

startCompression()

startCompression() 

Activates output compression.

disableCompression()

disableCompression() 

Disables output compression. If successful, throws out all data currently in the output buffer. Must be called before any data is sent to the browser.

header()

header(array  $opts = array()) 

Output the page header.

Parameters

array $opts

Options:

  • body_class: (string)
  • body_id: (string)
  • html_id: (string)
  • smartmobileinit: (string) (@deprecated; use $this->smartmobileInit instead)
  • stylesheet_opts: (array)
  • title: (string)
  • view: (integer)

outputSmartmobileFiles()

outputSmartmobileFiles() 

Output files needed for smartmobile mode.

footer()

footer(array  $opts = array()) 

Output page footer.

Parameters

array $opts

Options:

  • NONE currently

_addBasicScripts()

_addBasicScripts() 

Add basic framework scripts to the output.