PHP Class Horde_PageOutput, horde

Author: Michael Slusarz ([email protected])
显示文件 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$ajax boolean Output code necessary to perform AJAX operations?
$css Horde_Themes_Css Stylesheet object.
$debug boolean Activate debugging output.
$deferScripts boolean Defer loading of scripts until end of page?
$growler boolean Output code necessary to display growler notifications?
$hsl Horde_Script_List Script list.
$inlineScript array List of inline scripts.
$linkTags array List of LINK tags to output.
$metaTags array List of META tags to output.
$sidebar boolean Load the sidebar in this page?
$smartmobileInit array Smartmobile init code that needs to be output before jquery.mobile.js is loaded.
$topbar boolean Load the topbar in this page?

Protected Properties

Property Type Description
$_compress boolean Has PHP userspace page compression been started?
$_view integer View mode.

Public Methods

Method Description
__construct ( ) Constructor.
addInlineJsVars ( array $data, mixed $opts = [] ) : array Add inline javascript variable definitions to the output buffer.
addInlineScript ( mixed $script, boolean $onload = false, boolean $top = false ) Add inline javascript to the output buffer.
addLinkTag ( array $opts = [] ) Adds a LINK tag.
addMetaTag ( string $name, string $content, boolean $http_equiv = true ) Adds a META tag to the page output.
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.
addScriptPackage ( mixed $package ) : Horde_Script_Package Adds a javascript package to the browser output.
addStylesheet ( Horde_Themes_Element | string $file, string $url = null ) Adds an external stylesheet to the output.
addThemeStylesheet ( string $file ) Adds a themed stylesheet to the output.
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.
footer ( array $opts = [] ) Output page footer.
header ( array $opts = [] ) Output the page header.
includeFavicon ( ) Generate and output the favicon tag for the current application.
includeScriptFiles ( ) Outputs the necessary script tags, honoring configuration choices as to script caching.
includeStylesheetFiles ( array $opts = [], array $full = false ) Generate the stylesheet tags for the current application.
metaRefresh ( integer $time, string $url ) Adds a META refresh tag.
noDnsPrefetch ( ) Adds a META tag to disable DNS prefetching.
outputInlineScript ( boolean $raw = false ) Print pending inline javascript to the output buffer.
outputLinkTags ( ) Output LINK tags.
outputMetaTags ( ) Output META tags to page.
outputSmartmobileFiles ( ) Output files needed for smartmobile mode.
startCompression ( ) Activates output compression.

Protected Methods

Method Description
_addBasicScripts ( ) Add basic framework scripts to the output.

Method Details

__construct() public method

Constructor.
public __construct ( )

_addBasicScripts() protected method

Add basic framework scripts to the output.
protected _addBasicScripts ( )

addInlineJsVars() public method

Add inline javascript variable definitions to the output buffer.
public addInlineJsVars ( array $data, mixed $opts = [] ) : array
$data array 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.
$opts mixed 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
return array Returns the variable list of 'ret_vars' option is true.

addInlineScript() public method

Add inline javascript to the output buffer.
public addInlineScript ( mixed $script, boolean $onload = false, boolean $top = false )
$script mixed The script text to add (can be stored in an array).
$onload boolean Load the script after the page (DOM) has loaded?
$top boolean Add script to top of stack?

addLinkTag() public method

All attributes are HTML-encoded. Only pass raw, unencoded attribute values to avoid double escaping.
public addLinkTag ( array $opts = [] )
$opts array Non-default tag elements.

addMetaTag() public method

Adds a META tag to the page output.
public addMetaTag ( string $name, string $content, boolean $http_equiv = true )
$name string The name value.
$content string The content of the META tag.
$http_equiv boolean Output http-equiv instead of name?

addScriptFile() public method

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.
public addScriptFile ( mixed $file, string $app = null ) : Horde_Script_File
$file mixed Either a Horde_Script_File object, or the full javascript file name.
$app string If $file is a file name, this is the application where the file is located. Defaults to the current registry application.
return Horde_Script_File Script file object.

addScriptPackage() public method

Adds a javascript package to the browser output.
public addScriptPackage ( mixed $package ) : Horde_Script_Package
$package mixed Either a classname, basename of a Horde_Core_Script_Package class, or a Horde_Script_Package object.
return Horde_Script_Package Package object.

addStylesheet() public method

Adds an external stylesheet to the output.
public addStylesheet ( Horde_Themes_Element | string $file, string $url = null )
$file Horde_Themes_Element | string Either a Horde_Themes_Element object or the CSS filepath.
$url string If $file is a string, this must be a CSS URL.

addThemeStylesheet() public method

Adds a themed stylesheet to the output.
public addThemeStylesheet ( string $file )
$file string The stylesheet name.

disableCompression() public method

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.
public disableCompression ( )

header() public method

Output the page header.
public header ( array $opts = [] )
$opts array Options: - body_class: (string) - body_id: (string) - html_id: (string) - smartmobileinit: (string) (@deprecated; use $this->smartmobileInit instead) - stylesheet_opts: (array) - title: (string) - view: (integer)

includeFavicon() public method

Generate and output the favicon tag for the current application.
public includeFavicon ( )

includeScriptFiles() public method

Outputs the necessary script tags, honoring configuration choices as to script caching.
public includeScriptFiles ( )

includeStylesheetFiles() public method

Generate the stylesheet tags for the current application.
public includeStylesheetFiles ( array $opts = [], array $full = false )
$opts array Options to pass to Horde_Themes_Css::getStylesheetUrls().
$full array Return a full URL?

metaRefresh() public method

Adds a META refresh tag.
public metaRefresh ( integer $time, string $url )
$time integer Refresh time.
$url string Refresh URL

noDnsPrefetch() public method

See Horde Bug #8836.
public noDnsPrefetch ( )

outputInlineScript() public method

Print pending inline javascript to the output buffer.
public outputInlineScript ( boolean $raw = false )
$raw boolean Return the raw script (not wrapped in CDATA tags or observe wrappers)?

outputLinkTags() public method

Output LINK tags.
public outputLinkTags ( )

outputMetaTags() public method

Output META tags to page.
public outputMetaTags ( )

outputSmartmobileFiles() public method

Output files needed for smartmobile mode.
Deprecation:

startCompression() public method

Activates output compression.
public startCompression ( )

Property Details

$_compress protected_oe property

Has PHP userspace page compression been started?
protected bool $_compress
return boolean

$_view protected_oe property

View mode.
protected int $_view
return integer

$ajax public_oe property

Output code necessary to perform AJAX operations?
public bool $ajax
return boolean

$css public_oe property

Stylesheet object.
public Horde_Themes_Css $css
return Horde_Themes_Css

$debug public_oe property

Activate debugging output.
public bool $debug
return boolean

$deferScripts public_oe property

Defer loading of scripts until end of page?
public bool $deferScripts
return boolean

$growler public_oe property

Output code necessary to display growler notifications?
public bool $growler
return boolean

$hsl public_oe property

Script list.
public Horde_Script_List $hsl
return Horde_Script_List

$inlineScript public_oe property

List of inline scripts.
public array $inlineScript
return array

$linkTags public_oe property

List of LINK tags to output.
public array $linkTags
return array

$metaTags public_oe property

List of META tags to output.
public array $metaTags
return array

$sidebar public_oe property

Load the sidebar in this page?
public bool $sidebar
return boolean

$smartmobileInit public_oe property

Smartmobile init code that needs to be output before jquery.mobile.js is loaded.
Since: 2.12.0
public array $smartmobileInit
return array

$topbar public_oe property

Load the topbar in this page?
public bool $topbar
return boolean