PHP Класс Horde_Core_Block_Layout_Manager, horde

Автор: Mike Cochrane ([email protected])
Автор: Jan Schneider ([email protected])
Наследование: extends Horde_Core_Block_Layout, implements Countable
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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?

Описание методов

__construct() публичный Метод

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

addBlock() публичный Метод

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() публичный Метод

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

addRow() публичный Метод

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

colExists() публичный Метод

Does a column exist?
public colExists ( integer $col ) : boolean
$col integer The column to look for.
Результат boolean True if the column exists.

columns() публичный Метод

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.
Результат integer The number of columns.

count() публичный Метод

Returns the number of blocks in the current layout.
public count ( ) : integer
Результат integer The number of blocks.

expandDown() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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.
Результат Horde_Core_Block The block from that position.

getBlockAt() публичный Метод

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.
Результат array The top-left row-column-coordinate of the block covering the specified field or null if the field is empty.

getBlockInfo() публичный Метод

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.
Результат array The information hash.

getControl() публичный Метод

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.
Результат string A link containing an arrow representing the requested control.

getCurrentBlock() публичный Метод

Get the current block row and column.
public getCurrentBlock ( ) : array
Результат array [row, col]

getHeight() публичный Метод

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.
Результат integer The number of rows this block spans.

getWidth() публичный Метод

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.
Результат integer The number of columns this block spans.

handle() публичный Метод

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() публичный Метод

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.
Результат boolean 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 ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
Результат boolean 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 ( integer $row, integer $col ) : boolean
$row integer A layout row.
$col integer A layout column.
Результат boolean True if the specified field is covered.

isEmpty() публичный Метод

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.
Результат boolean True if the location is empty False is the location is being used.

moveDown() публичный Метод

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

moveDownBelow() публичный Метод

Moves all blocks below a certain row one row down.
public moveDownBelow ( integer $row ) : boolean
$row integer A layout row.
Результат boolean True if all rows could be moved down.

moveLeft() публичный Метод

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

moveRight() публичный Метод

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

moveRightAfter() публичный Метод

Moves all blocks after a certain column one column right.
public moveRightAfter ( integer $col ) : boolean
$col integer A layout column.
Результат boolean True if all columns could be moved right.

moveUp() публичный Метод

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

removeBlock() публичный Метод

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

removeColIfEmpty() публичный Метод

Removes a column if it's empty.
public removeColIfEmpty ( integer $col ) : boolean
$col integer The number of the column to to check
Результат boolean True if the column is now removed. False if the column still exists.

removeRowIfEmpty() публичный Метод

Removes a row if it's empty.
public removeRowIfEmpty ( integer $row ) : boolean
$row integer The number of the row to to check
Результат boolean True if the row is now removed. False if the row still exists.

rowExists() публичный Метод

Does a row exist?
public rowExists ( integer $row ) : boolean
$row integer The row to look for.
Результат boolean True if the row exists.

rows() публичный Метод

Returns the number of rows in the current layout.
public rows ( ) : integer
Результат integer The number of rows.

serialize() публичный Метод

Serialize and return the current block layout.
public serialize ( ) : TODO
Результат TODO

setBlockInfo() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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

updated() публичный Метод

Has the layout been changed since it was instantiated?
public updated ( ) : boolean
Результат boolean

Описание свойств

$_blocks защищенное свойство

A cache for the block objects.
protected array $_blocks
Результат array

$_changedCol защищенное свойство

The new column of the last changed block.
protected int $_changedCol
Результат integer

$_changedRow защищенное свойство

The new row of the last changed block.
protected int $_changedRow
Результат integer

$_collection защищенное свойство

Our Horde_Core_Block_Collection instance.
protected Horde_Core_Block_Collection $_collection
Результат Horde_Core_Block_Collection

$_columns защищенное свойство

The maximum number of columns.
protected int $_columns
Результат integer

$_currentBlock защищенное свойство

The current block (array: [row, col]).
protected array $_currentBlock
Результат array

$_layout защищенное свойство

The current block layout.
protected array $_layout
Результат array

$_updated защищенное свойство

Has the layout been updated since it was instantiated.
protected bool $_updated
Результат boolean