\Horde_Core_Block_Collection

This class provides an API to the blocks (applets) framework.

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.

Summary

Methods
Properties
Constants
__construct()
getLayout()
getLayoutManager()
getBlock()
getBlocksList()
getFixedBlocks()
getBlocksWidget()
getOptionType()
getOptionRequired()
getOptionValues()
getOptionsWidget()
getName()
getParams()
getParamName()
getDefaultValue()
isEditable()
_loadBlocks()
serialize()
unserialize()
No public properties found
No constants found
No protected methods found
$_apps
$_blocks
$_layout
N/A
No private methods found
No private properties found
N/A

Properties

$_apps

$_apps : array

List of apps to load blocks from.

Type

array

$_blocks

$_blocks : array

A hash storing the information about all available blocks from all applications.

Type

array

$_layout

$_layout : string

Layout configuration preference name.

Type

string

Methods

__construct()

__construct(array  $apps, string  $layout) 

Constructor.

Parameters

array $apps

The applications whose blocks to list.

string $layout

Layout configuration preference name.

getLayout()

getLayout() : array

Return the layout configuration for this collection.

Returns

array —

The layout configuration.

getLayoutManager()

getLayoutManager() : \Horde_Core_Block_Layout_Manager

Return the layout manager for this collection.

Returns

\Horde_Core_Block_Layout_Manager

Layout manager object.

getBlock()

getBlock(string  $app, string  $name, array  $params = null) : \Horde_Core_Block

Gets a block object.

Parameters

string $app

Application name.

string $name

The Block's classname.

array $params

Parameters. If null, the stored parameters will be used.

Throws

\Horde_Exception

Returns

\Horde_Core_Block

Block object.

getBlocksList()

getBlocksList() : array

Returns a pretty printed list of all available blocks.

Returns

array —

A hash with block IDs as keys and application plus block block names as values.

getFixedBlocks()

getFixedBlocks() : string

Returns a layout with all fixed blocks as per configuration.

Returns

string —

A default serialized block layout.

getBlocksWidget()

getBlocksWidget(string  $cur_app = null, string  $cur_block = null, boolean  $onchange = false, boolean  $readonly = false) : string

Returns a select widget with all available blocks.

Parameters

string $cur_app

The block from this application gets selected.

string $cur_block

The block with this name gets selected.

boolean $onchange

Include the onchange action

boolean $readonly

Indicates if this block type is changeable.

Returns

string —

The select tag with all available blocks.

getOptionType()

getOptionType(  $app,   $block,   $param_id) : \TODO

Returns the option type.

Parameters

$app

TODO

$block

TODO

$param_id

TODO

Returns

\TODO

getOptionRequired()

getOptionRequired(  $app,   $block,   $param_id) : \TODO

Returns whether the option is required or not. Defaults to true.

Parameters

$app

TODO

$block

TODO

$param_id

TODO

Returns

\TODO

getOptionValues()

getOptionValues(  $app,   $block,   $param_id) : \TODO

Returns the values for an option.

Parameters

$app

TODO

$block

TODO

$param_id

TODO

Returns

\TODO

getOptionsWidget()

getOptionsWidget(  $app,   $block,   $param_id,   $val = null) : \TODO

Returns the widget necessary to configure this block.

Parameters

$app

TODO

$block

TODO

$param_id

TODO

$val

TODO

Returns

\TODO

getName()

getName(string  $app, string  $block) : string

Returns the name of the specified block.

Parameters

string $app

An application name.

string $block

A block name.

Returns

string —

The name of the specified block.

getParams()

getParams(string  $app, string  $block) : array

Returns the parameter list of the specified block.

Parameters

string $app

An application name.

string $block

A block name.

Returns

array —

An array with all parameter names.

getParamName()

getParamName(string  $app, string  $block, string  $param) : string

Returns the (clear text) name of the specified parameter.

Parameters

string $app

An application name.

string $block

A block name.

string $param

A parameter name.

Returns

string —

The name of the specified parameter.

getDefaultValue()

getDefaultValue(string  $app, string  $block, string  $param) : string

Returns the default value of the specified parameter.

Parameters

string $app

An application name.

string $block

A block name.

string $param

A parameter name.

Returns

string —

The default value of the specified parameter or null.

isEditable()

isEditable(string  $app, string  $block) : boolean

Returns if the specified block is customizeable by the user.

Parameters

string $app

An application name.

string $block

A block name.

Returns

boolean —

True is the block is customizeable.

_loadBlocks()

_loadBlocks() 

Loads the blocks from all applications.

serialize()

serialize() 

unserialize()

unserialize(  $data) 

Parameters

$data