Horde_Core_Block
in package
An abstract class representing a single block in the portal/block display.
Copyright 2003-2017 Horde LLC (http://www.horde.org/)
See the enclosed file LICENSE for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Tags
Table of Contents
Properties
- $autoUpdateMethod : string
- The method to use to render the block when Horde_Ajax_Application_Handler#blockAutoUpdate is called instead of the default of Horde_Core_Block#getContent By default, we call _content()
- $enabled : bool
- Is this block enabled?
- $updateable : bool
- Whether this block has changing content.
- $_app : string
- Application that this block originated from.
- $_name : string
- Block name. Should be set in the constructor.
- $_params : array<string|int, mixed>
- Block specific parameters.
Methods
- __construct() : mixed
- Constructor.
- getAjaxUpdate() : string
- The data to send on an AJAX update request.
- getApp() : string
- Returns the application that this block belongs to.
- getContent() : string
- Returns the content for this block.
- getName() : string
- Return the block name.
- getParams() : array<string|int, mixed>
- Returns any settable parameters for this block.
- getParamValues() : array<string|int, mixed>
- Returns a hash of block parameters and their configured values.
- getTitle() : string
- Returns the text to go in the title of this block.
- refreshContent() : string
- Returns the content for this block in response to a user requested update from within the block.
- _ajaxUpdate() : string
- Returns this block's content for AJAX updates.
- _ajaxUpdateUrl() : Horde_Url
- Return the URL to use for AJAX update requests.
- _call() : mixed
- Calls the application driver in the proper context.
- _content() : string
- Returns this block's content.
- _params() : array<string|int, mixed>
- Returns the parameters needed by block.
- _refreshContent() : string
- Stub to be overridden by concrete block that supports user-initiated updating of content via ajax.
- _title() : string
- Returns the title to go in this block.
Properties
$autoUpdateMethod
The method to use to render the block when Horde_Ajax_Application_Handler#blockAutoUpdate is called instead of the default of Horde_Core_Block#getContent By default, we call _content()
public
string
$autoUpdateMethod
Tags
$enabled
Is this block enabled?
public
bool
$enabled
= \true
$updateable
Whether this block has changing content.
public
bool
$updateable
= \false
$_app
Application that this block originated from.
protected
string
$_app
$_name
Block name. Should be set in the constructor.
protected
string
$_name
= ''
$_params
Block specific parameters.
protected
array<string|int, mixed>
$_params
= array()
Methods
__construct()
Constructor.
public
__construct(string $app[, array<string|int, mixed>|bool $params = array() ]) : mixed
Parameters
- $app : string
-
The application name.
- $params : array<string|int, mixed>|bool = array()
-
Any parameters the block needs. If false, the default parameter will be used.
getAjaxUpdate()
The data to send on an AJAX update request.
public
getAjaxUpdate(Horde_Variables $vars) : string
Parameters
- $vars : Horde_Variables
-
The form variables for the request.
Return values
string —Update data.
getApp()
Returns the application that this block belongs to.
public
getApp() : string
Return values
string —The application name.
getContent()
Returns the content for this block.
public
getContent() : string
This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
Return values
string —The block's content.
getName()
Return the block name.
public
getName() : string
Return values
string —The block name.
getParams()
Returns any settable parameters for this block.
public
getParams() : array<string|int, mixed>
It does not reference $this->_params; that is for runtime parameters (the choices made from these options).
Return values
array<string|int, mixed> —The block's configurable parameters.
getParamValues()
Returns a hash of block parameters and their configured values.
public
getParamValues() : array<string|int, mixed>
Return values
array<string|int, mixed> —Parameter values.
getTitle()
Returns the text to go in the title of this block.
public
getTitle() : string
This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
Return values
string —The block's title.
refreshContent()
Returns the content for this block in response to a user requested update from within the block.
public
refreshContent(Horde_Variables $vars) : string
This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
Parameters
- $vars : Horde_Variables
Return values
string —The block's content.
_ajaxUpdate()
Returns this block's content for AJAX updates.
protected
_ajaxUpdate(Horde_Variables $vars) : string
Parameters
- $vars : Horde_Variables
-
The form variables for the request.
Return values
string —The update content.
_ajaxUpdateUrl()
Return the URL to use for AJAX update requests.
protected
_ajaxUpdateUrl() : Horde_Url
Return values
Horde_Url —The update URL.
_call()
Calls the application driver in the proper context.
protected
_call(string $name, mixed $default[, mixed $args = null ]) : mixed
Parameters
- $name : string
-
string
- $default : mixed
- $args : mixed = null
_content()
Returns this block's content.
protected
abstract _content() : string
Return values
string —The block's content.
_params()
Returns the parameters needed by block.
protected
_params() : array<string|int, mixed>
Return values
array<string|int, mixed> —The block's parameters.
_refreshContent()
Stub to be overridden by concrete block that supports user-initiated updating of content via ajax.
protected
_refreshContent(Horde_Variables $vars) : string
Parameters
- $vars : Horde_Variables
Tags
Return values
string_title()
Returns the title to go in this block.
protected
_title() : string
Return values
string —The block title.