PHP Class Horde_Core_Block_Layout_Manager, horde

Author: Mike Cochrane ([email protected])
Author: Jan Schneider ([email protected])
Inheritance: extends Horde_Core_Block_Layout, implements Countable
Datei anzeigen Open project: horde/horde

Protected Properties

Property Type Description
$_blocks array A cache for the block objects.
$_changedCol integer The new column of the last changed block.
$_changedRow integer The new row of the last changed block.
$_collection Horde_Core_Block_Collection Our Horde_Core_Block_Collection instance.
$_columns integer The maximum number of columns.
$_currentBlock array The current block (array: [row, col]).
$_layout array The current block layout.
$_updated boolean Has the layout been updated since it was instantiated.

Public Methods

Method Description
__construct ( Horde_Core_Block_Collection $collection ) Constructor.
addBlock ( integer $row, integer $col ) Adds an empty block at the specified position.
addCol ( integer $col ) Adds a new column to the layout.
addRow ( integer $row ) Adds a new row to the layout.
colExists ( integer $col ) : boolean Does a column exist?
columns ( integer $row ) : integer Returns the number of columns in the specified row of the current layout.
count ( ) : integer Returns the number of blocks in the current layout.
expandDown ( integer $row, integer $col ) Makes a block one row taller by moving the bottom down.
expandLeft ( integer $row, integer $col ) Makes a block one column wider by moving the left side out.
expandRight ( integer $row, integer $col ) Makes a block one column wider by moving the right side out.
expandUp ( integer $row, integer $col ) Makes a block one row taller by moving the top up.
getBlock ( integer $row, integer $col ) : Horde_Core_Block Returns the block object at the specified position.
getBlockAt ( integer $row, integer $col ) : array Returns the coordinates of the block covering the specified field.
getBlockInfo ( integer $row, integer $col ) : array Returns a hash with some useful information about the specified block.
getControl ( string $type, integer $row, integer $col ) : string Returns a control (linked arrow) for a certain action on the specified block.
getCurrentBlock ( ) : array Get the current block row and column.
getHeight ( integer $row, integer $col ) : integer Get the height of the block at a given location.
getWidth ( integer $row, integer $col ) : integer Get the width of the block at a given location.
handle ( string $action, integer $row, integer $col, string $url = null ) Process a modification to the current layout.
isBlock ( integer $row, integer $col ) : boolean Returns if the specified location is the top left field of a block.
isChanged ( integer $row, integer $col ) : boolean Returns if the specified block has been changed last.
isCovered ( integer $row, integer $col ) : boolean Returns if the field at the specified position is covered by another block.
isEmpty ( integer $row, integer $col ) : boolean Checks to see if a given location if being used by a block.
moveDown ( integer $row, integer $col ) Moves a block one row down.
moveDownBelow ( integer $row ) : boolean Moves all blocks below a certain row one row down.
moveLeft ( integer $row, integer $col ) Moves a block one column left.
moveRight ( integer $row, integer $col ) Moves a block one column right.
moveRightAfter ( integer $col ) : boolean Moves all blocks after a certain column one column right.
moveUp ( integer $row, integer $col ) Moves a block one row up.
removeBlock ( integer $row, integer $col ) Removes a block.
removeColIfEmpty ( integer $col ) : boolean Removes a column if it's empty.
removeRowIfEmpty ( integer $row ) : boolean Removes a row if it's empty.
rowExists ( integer $row ) : boolean Does a row exist?
rows ( ) : integer Returns the number of rows in the current layout.
serialize ( ) : TODO Serialize and return the current block layout.
setBlockInfo ( integer $row, integer $col, array $info = [] ) Sets a batch of information about the specified block.
shrinkDown ( integer $row, integer $col ) Makes a block one row lower by moving the bottom up.
shrinkLeft ( integer $row, integer $col ) Makes a block one column narrower by moving the left side in.
shrinkRight ( integer $row, integer $col ) Makes a block one column narrower by moving the right side in.
shrinkUp ( integer $row, integer $col ) Makes a block one row lower by moving the top down.
unserialize ( $data ) Resets the current layout to the value stored in the preferences.
updated ( ) : boolean Has the layout been changed since it was instantiated?

Method Details

__construct() public method

Constructor.
public __construct ( Horde_Core_Block_Collection $collection )
$collection Horde_Core_Block_Collection TODO

addBlock() public method

Adds an empty block at the specified position.
public addBlock ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

addCol() public method

Adds a new column to the layout.
public addCol ( integer $col )
$col integer The number of the column to add

addRow() public method

Adds a new row to the layout.
public addRow ( integer $row )
$row integer The number of the row to add

colExists() public method

Does a column exist?
public colExists ( integer $col ) : boolean
$col integer The column to look for.
return boolean True if the column exists.

columns() public method

Returns the number of columns in the specified row of the current layout.
public columns ( integer $row ) : integer
$row integer The row to return the number of columns from.
return integer The number of columns.

count() public method

Returns the number of blocks in the current layout.
public count ( ) : integer
return integer The number of blocks.

expandDown() public method

Makes a block one row taller by moving the bottom down.
public expandDown ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

expandLeft() public method

Makes a block one column wider by moving the left side out.
public expandLeft ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

expandRight() public method

Makes a block one column wider by moving the right side out.
public expandRight ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

expandUp() public method

Makes a block one row taller by moving the top up.
public expandUp ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

getBlock() public method

Returns the block object at the specified position.
public getBlock ( integer $row, integer $col ) : Horde_Core_Block
$row integer A layout row.
$col integer A layout column.
return Horde_Core_Block The block from that position.

getBlockAt() public method

Returns the coordinates of the block covering the specified field.
public getBlockAt ( integer $row, integer $col ) : array
$row integer A layout row.
$col integer A layout column.
return array The top-left row-column-coordinate of the block covering the specified field or null if the field is empty.

getBlockInfo() public method

Returned hash values: 'app': application name 'block': block name 'params': parameter hash
public getBlockInfo ( integer $row, integer $col ) : array
$row integer A layout row.
$col integer A layout column.
return array The information hash.

getControl() public method

Returns a control (linked arrow) for a certain action on the specified block.
public getControl ( string $type, integer $row, integer $col ) : string
$type string A control type in the form "modification/direction". Possible values for modification: expand, shrink, move. Possible values for direction: up, down, left, right.
$row integer A layout row.
$col integer A layout column.
return string A link containing an arrow representing the requested control.

getCurrentBlock() public method

Get the current block row and column.
public getCurrentBlock ( ) : array
return array [row, col]

getHeight() public method

This returns the height if there is a block at this location, otherwise returns 1.
public getHeight ( integer $row, integer $col ) : integer
$row integer A layout row.
$col integer A layout column.
return integer The number of rows this block spans.

getWidth() public method

This returns the width if there is a block at this location, otherwise returns 1.
public getWidth ( integer $row, integer $col ) : integer
$row integer A layout row.
$col integer A layout column.
return integer The number of columns this block spans.

handle() public method

Process a modification to the current layout.
public handle ( string $action, integer $row, integer $col, string $url = null )
$action string TODO
$row integer TODO
$col integer TODO
$url string TODO

isBlock() public method

Returns if the specified location is the top left field of a block.
public isBlock ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
return boolean True if the specified position is a block, false if the field doesn't exist, is empty or covered.

isChanged() public method

Returns if the specified block has been changed last.
public isChanged ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
return boolean True if this block is the last one that was changed.

isCovered() public method

Returns if the field at the specified position is covered by another block.
public isCovered ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
return boolean True if the specified field is covered.

isEmpty() public method

Checks to see if a given location if being used by a block.
public isEmpty ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
return boolean True if the location is empty False is the location is being used.

moveDown() public method

Moves a block one row down.
public moveDown ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

moveDownBelow() public method

Moves all blocks below a certain row one row down.
public moveDownBelow ( integer $row ) : boolean
$row integer A layout row.
return boolean True if all rows could be moved down.

moveLeft() public method

Moves a block one column left.
public moveLeft ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

moveRight() public method

Moves a block one column right.
public moveRight ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

moveRightAfter() public method

Moves all blocks after a certain column one column right.
public moveRightAfter ( integer $col ) : boolean
$col integer A layout column.
return boolean True if all columns could be moved right.

moveUp() public method

Moves a block one row up.
public moveUp ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

removeBlock() public method

Removes a block.
public removeBlock ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

removeColIfEmpty() public method

Removes a column if it's empty.
public removeColIfEmpty ( integer $col ) : boolean
$col integer The number of the column to to check
return boolean True if the column is now removed. False if the column still exists.

removeRowIfEmpty() public method

Removes a row if it's empty.
public removeRowIfEmpty ( integer $row ) : boolean
$row integer The number of the row to to check
return boolean True if the row is now removed. False if the row still exists.

rowExists() public method

Does a row exist?
public rowExists ( integer $row ) : boolean
$row integer The row to look for.
return boolean True if the row exists.

rows() public method

Returns the number of rows in the current layout.
public rows ( ) : integer
return integer The number of rows.

serialize() public method

Serialize and return the current block layout.
public serialize ( ) : TODO
return TODO

setBlockInfo() public method

Sets a batch of information about the specified block.
public setBlockInfo ( integer $row, integer $col, array $info = [] )
$row integer A layout row.
$col integer A layout column.
$info array A hash with information values. Possible elements are: 'app': application name 'block': block name 'params': parameter hash

shrinkDown() public method

Makes a block one row lower by moving the bottom up.
public shrinkDown ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

shrinkLeft() public method

Makes a block one column narrower by moving the left side in.
public shrinkLeft ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

shrinkRight() public method

Makes a block one column narrower by moving the right side in.
public shrinkRight ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

shrinkUp() public method

Makes a block one row lower by moving the top down.
public shrinkUp ( integer $row, integer $col )
$row integer A layout row.
$col integer A layout column.

unserialize() public method

Resets the current layout to the value stored in the preferences.
public unserialize ( $data )

updated() public method

Has the layout been changed since it was instantiated?
public updated ( ) : boolean
return boolean

Property Details

$_blocks protected_oe property

A cache for the block objects.
protected array $_blocks
return array

$_changedCol protected_oe property

The new column of the last changed block.
protected int $_changedCol
return integer

$_changedRow protected_oe property

The new row of the last changed block.
protected int $_changedRow
return integer

$_collection protected_oe property

Our Horde_Core_Block_Collection instance.
protected Horde_Core_Block_Collection $_collection
return Horde_Core_Block_Collection

$_columns protected_oe property

The maximum number of columns.
protected int $_columns
return integer

$_currentBlock protected_oe property

The current block (array: [row, col]).
protected array $_currentBlock
return array

$_layout protected_oe property

The current block layout.
protected array $_layout
return array

$_updated protected_oe property

Has the layout been updated since it was instantiated.
protected bool $_updated
return boolean