Horde_Core_Block_Layout_Manager
extends Horde_Core_Block_Layout
in package
implements
Countable
Provides manipulation of block layouts.
Tags
Table of Contents
Interfaces
- Countable
Properties
- $_blocks : array<string|int, mixed>
- A cache for the block objects.
- $_changedCol : int
- The new column of the last changed block.
- $_changedRow : int
- The new row of the last changed block.
- $_collection : Horde_Core_Block_Collection
- Our Horde_Core_Block_Collection instance.
- $_columns : int
- The maximum number of columns.
- $_currentBlock : array<string|int, mixed>
- The current block (array: [row, col]).
- $_editUrl : string
- Edit URL.
- $_layout : array<string|int, mixed>
- The current block layout.
- $_updated : bool
- Has the layout been updated since it was instantiated.
- $_viewUrl : string
- View URL.
Methods
- __construct() : mixed
- Constructor.
- addBlock() : mixed
- Adds an empty block at the specified position.
- addCol() : mixed
- Adds a new column to the layout.
- addRow() : mixed
- Adds a new row to the layout.
- colExists() : bool
- Does a column exist?
- columns() : int
- Returns the number of columns in the specified row of the current layout.
- count() : int
- Returns the number of blocks in the current layout.
- expandDown() : mixed
- Makes a block one row taller by moving the bottom down.
- expandLeft() : mixed
- Makes a block one column wider by moving the left side out.
- expandRight() : mixed
- Makes a block one column wider by moving the right side out.
- expandUp() : mixed
- Makes a block one row taller by moving the top up.
- getActionUrl() : Horde_Url
- Returns an URL triggering an action to a block.
- getBlock() : Horde_Core_Block
- Returns the block object at the specified position.
- getBlockAt() : array<string|int, mixed>
- Returns the coordinates of the block covering the specified field.
- getBlockInfo() : array<string|int, mixed>
- Returns a hash with some useful information about the specified block.
- getControl() : string
- Returns a control (linked arrow) for a certain action on the specified block.
- getCurrentBlock() : array<string|int, mixed>
- Get the current block row and column.
- getHeaderIcons() : string
- Returns the actions for the block header.
- getHeight() : int
- Get the height of the block at a given location.
- getWidth() : int
- Get the width of the block at a given location.
- handle() : mixed
- Process a modification to the current layout.
- isBlock() : bool
- Returns if the specified location is the top left field of a block.
- isChanged() : bool
- Returns if the specified block has been changed last.
- isCovered() : bool
- Returns if the field at the specified position is covered by another block.
- isEmpty() : bool
- Checks to see if a given location if being used by a block.
- isRemovable() : bool
- Returns whether the specified block may be removed.
- moveDown() : mixed
- Moves a block one row down.
- moveDownBelow() : bool
- Moves all blocks below a certain row one row down.
- moveLeft() : mixed
- Moves a block one column left.
- moveRight() : mixed
- Moves a block one column right.
- moveRightAfter() : bool
- Moves all blocks after a certain column one column right.
- moveUp() : mixed
- Moves a block one row up.
- removeBlock() : mixed
- Removes a block.
- removeColIfEmpty() : bool
- Removes a column if it's empty.
- removeRowIfEmpty() : bool
- Removes a row if it's empty.
- rowExists() : bool
- Does a row exist?
- rows() : int
- Returns the number of rows in the current layout.
- serialize() : TODO
- Serialize and return the current block layout.
- setBlockInfo() : mixed
- Sets a batch of information about the specified block.
- shrinkDown() : mixed
- Makes a block one row lower by moving the bottom up.
- shrinkLeft() : mixed
- Makes a block one column narrower by moving the left side in.
- shrinkRight() : mixed
- Makes a block one column narrower by moving the right side in.
- shrinkUp() : mixed
- Makes a block one row lower by moving the top down.
- unserialize() : mixed
- Resets the current layout to the value stored in the preferences.
- updated() : bool
- Has the layout been changed since it was instantiated?
Properties
$_blocks
A cache for the block objects.
protected
array<string|int, mixed>
$_blocks
= array()
$_changedCol
The new column of the last changed block.
protected
int
$_changedCol
= \null
$_changedRow
The new row of the last changed block.
protected
int
$_changedRow
= \null
$_collection
Our Horde_Core_Block_Collection instance.
protected
Horde_Core_Block_Collection
$_collection
$_columns
The maximum number of columns.
protected
int
$_columns
= 0
$_currentBlock
The current block (array: [row, col]).
protected
array<string|int, mixed>
$_currentBlock
= array(\null, \null)
$_editUrl
Edit URL.
protected
string
$_editUrl
$_layout
The current block layout.
protected
array<string|int, mixed>
$_layout
= array()
$_updated
Has the layout been updated since it was instantiated.
protected
bool
$_updated
= \false
$_viewUrl
View URL.
protected
string
$_viewUrl
Methods
__construct()
Constructor.
public
__construct(Horde_Core_Block_Collection $collection) : mixed
Parameters
- $collection : Horde_Core_Block_Collection
-
TODO
addBlock()
Adds an empty block at the specified position.
public
addBlock(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
addCol()
Adds a new column to the layout.
public
addCol(int $col) : mixed
Parameters
- $col : int
-
The number of the column to add
addRow()
Adds a new row to the layout.
public
addRow(int $row) : mixed
Parameters
- $row : int
-
The number of the row to add
colExists()
Does a column exist?
public
colExists(int $col) : bool
Parameters
- $col : int
-
The column to look for.
Return values
bool —True if the column exists.
columns()
Returns the number of columns in the specified row of the current layout.
public
columns(int $row) : int
Parameters
- $row : int
-
The row to return the number of columns from.
Tags
Return values
int —The number of columns.
count()
Returns the number of blocks in the current layout.
public
count() : int
Attributes
- #[ReturnTypeWillChange]
Return values
int —The number of blocks.
expandDown()
Makes a block one row taller by moving the bottom down.
public
expandDown(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
expandLeft()
Makes a block one column wider by moving the left side out.
public
expandLeft(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
expandRight()
Makes a block one column wider by moving the right side out.
public
expandRight(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
expandUp()
Makes a block one row taller by moving the top up.
public
expandUp(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
getActionUrl()
Returns an URL triggering an action to a block.
public
getActionUrl(string $action, int $row, int $col) : Horde_Url
Parameters
- $action : string
-
An action to trigger.
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
Horde_Url —An URL with all necessary parameters.
getBlock()
Returns the block object at the specified position.
public
getBlock(int $row, int $col) : Horde_Core_Block
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
Horde_Core_Block —The block from that position.
getBlockAt()
Returns the coordinates of the block covering the specified field.
public
getBlockAt(int $row, int $col) : array<string|int, mixed>
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
array<string|int, mixed> —The top-left row-column-coordinate of the block covering the specified field or null if the field is empty.
getBlockInfo()
Returns a hash with some useful information about the specified block.
public
getBlockInfo(int $row, int $col) : array<string|int, mixed>
Returned hash values: 'app': application name 'block': block name 'params': parameter hash
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
Return values
array<string|int, mixed> —The information hash.
getControl()
Returns a control (linked arrow) for a certain action on the specified block.
public
getControl(string $type, int $row, int $col) : string
Parameters
- $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 : int
-
A layout row.
- $col : int
-
A layout column.
Return values
string —A link containing an arrow representing the requested control.
getCurrentBlock()
Get the current block row and column.
public
getCurrentBlock() : array<string|int, mixed>
Return values
array<string|int, mixed> —[row, col]
getHeaderIcons()
Returns the actions for the block header.
public
getHeaderIcons(int $row, int $col, bool $edit[, mixed $url = null ]) : string
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
- $edit : bool
-
Whether to include the edit icon.
- $url : mixed = null
-
TODO
Return values
string —HTML code for the block action icons.
getHeight()
Get the height of the block at a given location.
public
getHeight(int $row, int $col) : int
This returns the height if there is a block at this location, otherwise returns 1.
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
int —The number of rows this block spans.
getWidth()
Get the width of the block at a given location.
public
getWidth(int $row, int $col) : int
This returns the width if there is a block at this location, otherwise returns 1.
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
int —The number of columns this block spans.
handle()
Process a modification to the current layout.
public
handle(string $action, int $row, int $col[, string $url = null ]) : mixed
Parameters
- $action : string
-
TODO
- $row : int
-
TODO
- $col : int
-
TODO
- $url : string = null
-
TODO
Tags
isBlock()
Returns if the specified location is the top left field of a block.
public
isBlock(int $row, int $col) : bool
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
bool —True if the specified position is a block, false if the field doesn't exist, is empty or covered.
isChanged()
Returns if the specified block has been changed last.
public
isChanged(int $row, int $col) : bool
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
bool —True if this block is the last one that was changed.
isCovered()
Returns if the field at the specified position is covered by another block.
public
isCovered(int $row, int $col) : bool
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
bool —True if the specified field is covered.
isEmpty()
Checks to see if a given location if being used by a block.
public
isEmpty(int $row, int $col) : bool
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
bool —True if the location is empty False is the location is being used.
isRemovable()
Returns whether the specified block may be removed.
public
isRemovable(int $row, int $col) : bool
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Return values
bool —True if this block may be removed.
moveDown()
Moves a block one row down.
public
moveDown(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
moveDownBelow()
Moves all blocks below a certain row one row down.
public
moveDownBelow(int $row) : bool
Parameters
- $row : int
-
A layout row.
Return values
bool —True if all rows could be moved down.
moveLeft()
Moves a block one column left.
public
moveLeft(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
moveRight()
Moves a block one column right.
public
moveRight(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
moveRightAfter()
Moves all blocks after a certain column one column right.
public
moveRightAfter(int $col) : bool
Parameters
- $col : int
-
A layout column.
Return values
bool —True if all columns could be moved right.
moveUp()
Moves a block one row up.
public
moveUp(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
Tags
removeBlock()
Removes a block.
public
removeBlock(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
removeColIfEmpty()
Removes a column if it's empty.
public
removeColIfEmpty(int $col) : bool
Parameters
- $col : int
-
The number of the column to to check
Return values
bool —True if the column is now removed. False if the column still exists.
removeRowIfEmpty()
Removes a row if it's empty.
public
removeRowIfEmpty(int $row) : bool
Parameters
- $row : int
-
The number of the row to to check
Return values
bool —True if the row is now removed. False if the row still exists.
rowExists()
Does a row exist?
public
rowExists(int $row) : bool
Parameters
- $row : int
-
The row to look for.
Return values
bool —True if the row exists.
rows()
Returns the number of rows in the current layout.
public
rows() : int
Return values
int —The number of rows.
serialize()
Serialize and return the current block layout.
public
serialize() : TODO
Return values
TODOsetBlockInfo()
Sets a batch of information about the specified block.
public
setBlockInfo(int $row, int $col[, array<string|int, mixed> $info = array() ]) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
- $info : array<string|int, mixed> = array()
-
A hash with information values. Possible elements are: 'app': application name 'block': block name 'params': parameter hash
Tags
shrinkDown()
Makes a block one row lower by moving the bottom up.
public
shrinkDown(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
shrinkLeft()
Makes a block one column narrower by moving the left side in.
public
shrinkLeft(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
shrinkRight()
Makes a block one column narrower by moving the right side in.
public
shrinkRight(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
shrinkUp()
Makes a block one row lower by moving the top down.
public
shrinkUp(int $row, int $col) : mixed
Parameters
- $row : int
-
A layout row.
- $col : int
-
A layout column.
unserialize()
Resets the current layout to the value stored in the preferences.
public
unserialize(mixed $data) : mixed
Parameters
- $data : mixed
updated()
Has the layout been changed since it was instantiated?
public
updated() : bool