PHP Class Horde_Core_Block, horde

Copyright 2003-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Author: Mike Cochrane ([email protected])
Author: Jan Schneider ([email protected])
Author: Michael Slusarz ([email protected])
ファイルを表示 Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$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 boolean Is this block enabled?
$updateable boolean Whether this block has changing content.

Protected Properties

Property Type Description
$_app string Application that this block originated from.
$_name string Block name. Should be set in the constructor.
$_params array Block specific parameters.

Public Methods

Method Description
__construct ( string $app, array | boolean $params = [] ) Constructor.
getAjaxUpdate ( Horde_Variables $vars ) : 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.
getParamValues ( ) : array Returns a hash of block parameters and their configured values.
getParams ( ) : array Returns any settable parameters for this block.
getTitle ( ) : string Returns the text to go in the title of this block.
refreshContent ( Horde_Variables $vars ) : string Returns the content for this block in response to a user requested update from within the block.

Protected Methods

Method Description
_ajaxUpdate ( Horde_Variables $vars ) : string Returns this block's content for AJAX updates.
_ajaxUpdateUrl ( ) : Horde_Url Return the URL to use for AJAX update requests.
_call ( string $name, mixed $default, mixed $args = null ) : mixed Calls the application driver in the proper context.
_content ( ) : string Returns this block's content.
_params ( ) : array Returns the parameters needed by block.
_refreshContent ( Horde_Variables $vars ) : 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.

Method Details

__construct() public method

Constructor.
public __construct ( string $app, array | boolean $params = [] )
$app string The application name.
$params array | boolean Any parameters the block needs. If false, the default parameter will be used.

_ajaxUpdate() protected method

Returns this block's content for AJAX updates.
protected _ajaxUpdate ( Horde_Variables $vars ) : string
$vars Horde_Variables The form variables for the request.
return string The update content.

_ajaxUpdateUrl() protected method

Return the URL to use for AJAX update requests.
protected _ajaxUpdateUrl ( ) : Horde_Url
return Horde_Url The update URL.

_call() protected method

Calls the application driver in the proper context.
protected _call ( string $name, mixed $default, mixed $args = null ) : mixed
$name string string
$default mixed
$args mixed
return mixed

_content() abstract protected method

Returns this block's content.
abstract protected _content ( ) : string
return string The block's content.

_params() protected method

Returns the parameters needed by block.
protected _params ( ) : array
return array The block's parameters.

_refreshContent() protected method

Stub to be overridden by concrete block that supports user-initiated updating of content via ajax.
protected _refreshContent ( Horde_Variables $vars ) : string
$vars Horde_Variables
return string

_title() protected method

Returns the title to go in this block.
protected _title ( ) : string
return string The block title.

getAjaxUpdate() public method

The data to send on an AJAX update request.
public getAjaxUpdate ( Horde_Variables $vars ) : string
$vars Horde_Variables The form variables for the request.
return string Update data.

getApp() public method

Returns the application that this block belongs to.
public getApp ( ) : string
return string The application name.

getContent() public method

This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
public getContent ( ) : string
return string The block's content.

getName() public method

Return the block name.
public getName ( ) : string
return string The block name.

getParamValues() public method

Returns a hash of block parameters and their configured values.
public getParamValues ( ) : array
return array Parameter values.

getParams() public method

It does *not* reference $this->_params; that is for runtime parameters (the choices made from these options).
public getParams ( ) : array
return array The block's configurable parameters.

getTitle() public method

This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
public getTitle ( ) : string
return string The block's title.

refreshContent() public method

This function handles the changing of current application as needed so code is executed in the scope of the application the block originated from.
public refreshContent ( Horde_Variables $vars ) : string
$vars Horde_Variables
return string The block's content.

Property Details

$_app protected_oe property

Application that this block originated from.
protected string $_app
return string

$_name protected_oe property

Block name. Should be set in the constructor.
protected string $_name
return string

$_params protected_oe property

Block specific parameters.
protected array $_params
return array

$autoUpdateMethod public_oe property

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()
Since: 2.12.0
public string $autoUpdateMethod
return string

$enabled public_oe property

Is this block enabled?
public bool $enabled
return boolean

$updateable public_oe property

Whether this block has changing content.
public bool $updateable
return boolean