Properties

$_editUrl

$_editUrl : string

Edit URL.

Type

string

$_viewUrl

$_viewUrl : string

View URL.

Type

string

$_blocks

$_blocks : array

A cache for the block objects.

Type

array

$_columns

$_columns : integer

The maximum number of columns.

Type

integer

$_layout

$_layout : array

The current block layout.

Type

array

$_updated

$_updated : boolean

Has the layout been updated since it was instantiated.

Type

boolean

$_currentBlock

$_currentBlock : array

The current block (array: [row, col]).

Type

array

$_changedRow

$_changedRow : integer

The new row of the last changed block.

Type

integer

$_changedCol

$_changedCol : integer

The new column of the last changed block.

Type

integer

Methods

isRemovable()

isRemovable(integer  $row, integer  $col) : boolean

Returns whether the specified block may be removed.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

boolean —

True if this block may be removed.

getActionUrl()

getActionUrl(string  $action, integer  $row, integer  $col) : \Horde_Url

Returns an URL triggering an action to a block.

Parameters

string $action

An action to trigger.

integer $row

A layout row.

integer $col

A layout column.

Returns

\Horde_Url —

An URL with all necessary parameters.

getHeaderIcons()

getHeaderIcons(integer  $row, integer  $col, boolean  $edit,   $url = null) : string

Returns the actions for the block header.

Parameters

integer $row

A layout row.

integer $col

A layout column.

boolean $edit

Whether to include the edit icon.

$url

TODO

Returns

string —

HTML code for the block action icons.

serialize()

serialize() : \TODO

Serialize and return the current block layout.

Returns

\TODO

unserialize()

unserialize(  $data) 

Resets the current layout to the value stored in the preferences.

Parameters

$data

handle()

handle(string  $action, integer  $row, integer  $col, string  $url = null) 

Process a modification to the current layout.

Parameters

string $action

TODO

integer $row

TODO

integer $col

TODO

string $url

TODO

Throws

\Horde_Exception

updated()

updated() : boolean

Has the layout been changed since it was instantiated?

Returns

boolean

getCurrentBlock()

getCurrentBlock() : array

Get the current block row and column.

Returns

array —

[row, col]

getBlock()

getBlock(integer  $row, integer  $col) : \Horde_Core_Block

Returns the block object at the specified position.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

\Horde_Core_Block

The block from that position.

getBlockAt()

getBlockAt(integer  $row, integer  $col) : array

Returns the coordinates of the block covering the specified field.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

array —

The top-left row-column-coordinate of the block covering the specified field or null if the field is empty.

getBlockInfo()

getBlockInfo(integer  $row, integer  $col) : array

Returns a hash with some useful information about the specified block.

Returned hash values: 'app': application name 'block': block name 'params': parameter hash

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

Returns

array —

The information hash.

setBlockInfo()

setBlockInfo(integer  $row, integer  $col, array  $info = array()) 

Sets a batch of information about the specified block.

Parameters

integer $row

A layout row.

integer $col

A layout column.

array $info

A hash with information values. Possible elements are: 'app': application name 'block': block name 'params': parameter hash

Throws

\Horde_Exception

rows()

rows() : integer

Returns the number of rows in the current layout.

Returns

integer —

The number of rows.

columns()

columns(integer  $row) : integer

Returns the number of columns in the specified row of the current layout.

Parameters

integer $row

The row to return the number of columns from.

Throws

\Horde_Exception

Returns

integer —

The number of columns.

isEmpty()

isEmpty(integer  $row, integer  $col) : boolean

Checks to see if a given location if being used by a block.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

boolean —

True if the location is empty False is the location is being used.

isCovered()

isCovered(integer  $row, integer  $col) : boolean

Returns if the field at the specified position is covered by another block.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

boolean —

True if the specified field is covered.

isBlock()

isBlock(integer  $row, integer  $col) : boolean

Returns if the specified location is the top left field of a block.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

boolean —

True if the specified position is a block, false if the field doesn't exist, is empty or covered.

isChanged()

isChanged(integer  $row, integer  $col) : boolean

Returns if the specified block has been changed last.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

boolean —

True if this block is the last one that was changed.

getControl()

getControl(string  $type, integer  $row, integer  $col) : string

Returns a control (linked arrow) for a certain action on the specified block.

Parameters

string $type

A control type in the form "modification/direction". Possible values for modification: expand, shrink, move. Possible values for direction: up, down, left, right.

integer $row

A layout row.

integer $col

A layout column.

Returns

string —

A link containing an arrow representing the requested control.

rowExists()

rowExists(integer  $row) : boolean

Does a row exist?

Parameters

integer $row

The row to look for.

Returns

boolean —

True if the row exists.

colExists()

colExists(integer  $col) : boolean

Does a column exist?

Parameters

integer $col

The column to look for.

Returns

boolean —

True if the column exists.

getWidth()

getWidth(integer  $row, integer  $col) : integer

Get the width of the block at a given location.

This returns the width if there is a block at this location, otherwise returns 1.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

integer —

The number of columns this block spans.

getHeight()

getHeight(integer  $row, integer  $col) : integer

Get the height of the block at a given location.

This returns the height if there is a block at this location, otherwise returns 1.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Returns

integer —

The number of rows this block spans.

addBlock()

addBlock(integer  $row, integer  $col) 

Adds an empty block at the specified position.

Parameters

integer $row

A layout row.

integer $col

A layout column.

addRow()

addRow(integer  $row) 

Adds a new row to the layout.

Parameters

integer $row

The number of the row to add

addCol()

addCol(integer  $col) 

Adds a new column to the layout.

Parameters

integer $col

The number of the column to add

removeBlock()

removeBlock(integer  $row, integer  $col) 

Removes a block.

Parameters

integer $row

A layout row.

integer $col

A layout column.

removeRowIfEmpty()

removeRowIfEmpty(integer  $row) : boolean

Removes a row if it's empty.

Parameters

integer $row

The number of the row to to check

Returns

boolean —

True if the row is now removed. False if the row still exists.

removeColIfEmpty()

removeColIfEmpty(integer  $col) : boolean

Removes a column if it's empty.

Parameters

integer $col

The number of the column to to check

Returns

boolean —

True if the column is now removed. False if the column still exists.

moveUp()

moveUp(integer  $row, integer  $col) 

Moves a block one row up.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

moveDown()

moveDown(integer  $row, integer  $col) 

Moves a block one row down.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

moveDownBelow()

moveDownBelow(integer  $row) : boolean

Moves all blocks below a certain row one row down.

Parameters

integer $row

A layout row.

Returns

boolean —

True if all rows could be moved down.

moveLeft()

moveLeft(integer  $row, integer  $col) 

Moves a block one column left.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

moveRight()

moveRight(integer  $row, integer  $col) 

Moves a block one column right.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

moveRightAfter()

moveRightAfter(integer  $col) : boolean

Moves all blocks after a certain column one column right.

Parameters

integer $col

A layout column.

Returns

boolean —

True if all columns could be moved right.

expandUp()

expandUp(integer  $row, integer  $col) 

Makes a block one row taller by moving the top up.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

expandDown()

expandDown(integer  $row, integer  $col) 

Makes a block one row taller by moving the bottom down.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

expandLeft()

expandLeft(integer  $row, integer  $col) 

Makes a block one column wider by moving the left side out.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

expandRight()

expandRight(integer  $row, integer  $col) 

Makes a block one column wider by moving the right side out.

Parameters

integer $row

A layout row.

integer $col

A layout column.

Throws

\Horde_Exception

shrinkUp()

shrinkUp(integer  $row, integer  $col) 

Makes a block one row lower by moving the top down.

Parameters

integer $row

A layout row.

integer $col

A layout column.

shrinkDown()

shrinkDown(integer  $row, integer  $col) 

Makes a block one row lower by moving the bottom up.

Parameters

integer $row

A layout row.

integer $col

A layout column.

shrinkLeft()

shrinkLeft(integer  $row, integer  $col) 

Makes a block one column narrower by moving the left side in.

Parameters

integer $row

A layout row.

integer $col

A layout column.

shrinkRight()

shrinkRight(integer  $row, integer  $col) 

Makes a block one column narrower by moving the right side in.

Parameters

integer $row

A layout row.

integer $col

A layout column.

count()

count() : integer

Returns the number of blocks in the current layout.

Returns

integer —

The number of blocks.