Horde_Core_Block_Collection
in package
implements
Serializable, JsonSerializable
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.
Tags
Table of Contents
Interfaces
- Serializable
- JsonSerializable
Properties
- $_apps : array<string|int, mixed>
- List of apps to load blocks from.
- $_blocks : array<string|int, mixed>
- A hash storing the information about all available blocks from all applications.
- $_layout : string
- Layout configuration preference name.
Methods
- __construct() : mixed
- Constructor.
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- _loadBlocks() : mixed
- Loads the blocks from all applications.
- getBlock() : Horde_Core_Block
- Gets a block object.
- getBlocksList() : array<string|int, mixed>
- Returns a pretty printed list of all available blocks.
- getBlocksWidget() : string
- Returns a select widget with all available blocks.
- getDefaultValue() : string
- Returns the default value of the specified parameter.
- getFixedBlocks() : string
- Returns a layout with all fixed blocks as per configuration.
- getLayout() : array<string|int, mixed>
- Return the layout configuration for this collection.
- getLayoutManager() : Horde_Core_Block_Layout_Manager
- Return the layout manager for this collection.
- getName() : string
- Returns the name of the specified block.
- getOptionRequired() : TODO
- Returns whether the option is required or not. Defaults to true.
- getOptionsWidget() : TODO
- Returns the widget necessary to configure this block.
- getOptionType() : TODO
- Returns the option type.
- getOptionValues() : TODO
- Returns the values for an option.
- getParamName() : string
- Returns the (clear text) name of the specified parameter.
- getParams() : array<string|int, mixed>
- Returns the parameter list of the specified block.
- isEditable() : bool
- Returns if the specified block is customizeable by the user.
- jsonSerialize() : mixed
- serialize() : mixed
- unserialize() : mixed
Properties
$_apps
List of apps to load blocks from.
protected
array<string|int, mixed>
$_apps
$_blocks
A hash storing the information about all available blocks from all applications.
protected
array<string|int, mixed>
$_blocks
$_layout
Layout configuration preference name.
protected
string
$_layout
Methods
__construct()
Constructor.
public
__construct(array<string|int, mixed> $apps, string $layout) : mixed
Parameters
- $apps : array<string|int, mixed>
-
The applications whose blocks to list.
- $layout : string
-
Layout configuration preference name.
__serialize()
public
__serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
_loadBlocks()
Loads the blocks from all applications.
public
_loadBlocks() : mixed
getBlock()
Gets a block object.
public
getBlock(string $app, string $name[, array<string|int, mixed> $params = null ]) : Horde_Core_Block
Parameters
- $app : string
-
Application name.
- $name : string
-
The Block's classname.
- $params : array<string|int, mixed> = null
-
Parameters. If null, the stored parameters will be used.
Tags
Return values
Horde_Core_Block —Block object.
getBlocksList()
Returns a pretty printed list of all available blocks.
public
getBlocksList() : array<string|int, mixed>
Return values
array<string|int, mixed> —A hash with block IDs as keys and application plus block block names as values.
getBlocksWidget()
Returns a select widget with all available blocks.
public
getBlocksWidget([string $cur_app = null ][, string $cur_block = null ][, bool $onchange = false ][, bool $readonly = false ]) : string
Parameters
- $cur_app : string = null
-
The block from this application gets selected.
- $cur_block : string = null
-
The block with this name gets selected.
- $onchange : bool = false
-
Include the onchange action
- $readonly : bool = false
-
Indicates if this block type is changeable.
Return values
string —The select tag with all available blocks.
getDefaultValue()
Returns the default value of the specified parameter.
public
getDefaultValue(string $app, string $block, string $param) : string
Parameters
- $app : string
-
An application name.
- $block : string
-
A block name.
- $param : string
-
A parameter name.
Return values
string —The default value of the specified parameter or null.
getFixedBlocks()
Returns a layout with all fixed blocks as per configuration.
public
getFixedBlocks() : string
Return values
string —A default serialized block layout.
getLayout()
Return the layout configuration for this collection.
public
getLayout() : array<string|int, mixed>
Return values
array<string|int, mixed> —The layout configuration.
getLayoutManager()
Return the layout manager for this collection.
public
getLayoutManager() : Horde_Core_Block_Layout_Manager
Return values
Horde_Core_Block_Layout_Manager —Layout manager object.
getName()
Returns the name of the specified block.
public
getName(string $app, string $block) : string
Parameters
- $app : string
-
An application name.
- $block : string
-
A block name.
Return values
string —The name of the specified block.
getOptionRequired()
Returns whether the option is required or not. Defaults to true.
public
getOptionRequired(mixed $app, mixed $block, mixed $param_id) : TODO
Parameters
- $app : mixed
-
TODO
- $block : mixed
-
TODO
- $param_id : mixed
-
TODO
Return values
TODOgetOptionsWidget()
Returns the widget necessary to configure this block.
public
getOptionsWidget(mixed $app, mixed $block, mixed $param_id[, mixed $val = null ]) : TODO
Parameters
- $app : mixed
-
TODO
- $block : mixed
-
TODO
- $param_id : mixed
-
TODO
- $val : mixed = null
-
TODO
Return values
TODOgetOptionType()
Returns the option type.
public
getOptionType(mixed $app, mixed $block, mixed $param_id) : TODO
Parameters
- $app : mixed
-
TODO
- $block : mixed
-
TODO
- $param_id : mixed
-
TODO
Return values
TODOgetOptionValues()
Returns the values for an option.
public
getOptionValues(mixed $app, mixed $block, mixed $param_id) : TODO
Parameters
- $app : mixed
-
TODO
- $block : mixed
-
TODO
- $param_id : mixed
-
TODO
Return values
TODOgetParamName()
Returns the (clear text) name of the specified parameter.
public
getParamName(string $app, string $block, string $param) : string
Parameters
- $app : string
-
An application name.
- $block : string
-
A block name.
- $param : string
-
A parameter name.
Return values
string —The name of the specified parameter.
getParams()
Returns the parameter list of the specified block.
public
getParams(string $app, string $block) : array<string|int, mixed>
Parameters
- $app : string
-
An application name.
- $block : string
-
A block name.
Return values
array<string|int, mixed> —An array with all parameter names.
isEditable()
Returns if the specified block is customizeable by the user.
public
isEditable(string $app, string $block) : bool
Parameters
- $app : string
-
An application name.
- $block : string
-
A block name.
Return values
bool —True is the block is customizeable.
jsonSerialize()
public
jsonSerialize() : mixed
serialize()
public
serialize() : mixed
unserialize()
public
unserialize(mixed $data) : mixed
Parameters
- $data : mixed