Class Horde_Block_Layout_Manager

Description

The Horde_Block_Layout_Manager class allows manipulation of Horde_Block layouts.

$Horde: framework/Block/Block/Layout/Manager.php,v 1.4.2.12 2009/01/06 15:22:53 jan Exp $

Copyright 2003-2009 The Horde Project (http://www.horde.org/)

See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Located in /Block/Block/Layout/Manager.php (line 22)

Horde_Block_Layout
   |
   --Horde_Block_Layout_Manager
Variable Summary
Method Summary
 static Horde_Block_Layout_Manager &singleton (string $name, Horde_Block_Collection &$collection, [string $data = ''])
 Horde_Block_Layout_Manager Horde_Block_Layout_Manager ( &$collection, [array $layout = array()], Horde_Block_Collection $collection)
 void addBlock (integer $row, integer $col)
 void addCol (integer $col)
 void addRow (integer $row)
 boolean colExists (integer $col)
 integer columns (integer $row)
 integer count ()
 void expandDown (integer $row, integer $col)
 void expandLeft (integer $row, integer $col)
 void expandRight (integer $row, integer $col)
 void expandUp (integer $row, integer $col)
 Horde_Block &getBlock (integer $row, integer $col)
 array getBlockAt (integer $row, integer $col)
 array getBlockInfo (integer $row, integer $col)
 string getControl (string $type, integer $row, integer $col)
 array getCurrentBlock ()
 integer getHeight (integer $row, integer $col)
 integer getWidth (integer $row, integer $col)
 void handle (string $action, integer $row, integer $col, [string $url = null])
 boolean isBlock (integer $row, integer $col)
 boolean isChanged (integer $row, integer $col)
 boolean isCovered (integer $row, integer $col)
 boolean isEmpty (integer $row, integer $col)
 void moveDown (integer $row, integer $col)
 boolean moveDownBelow (integer $row)
 void moveLeft (integer $row, integer $col)
 void moveRight (integer $row, integer $col)
 boolean moveRightAfter (integer $col)
 void moveUp (integer $row, integer $col)
 void removeBlock (integer $row, integer $col)
 boolean removeColIfEmpty (integer $col)
 boolean removeRowIfEmpty (integer $row)
 boolean rowExists (integer $row)
 integer rows ()
 void serialize ()
 void setBlockInfo (integer $row, integer $col, [array $info = array()])
 void shrinkDown (integer $row, integer $col)
 void shrinkLeft (integer $row, integer $col)
 void shrinkRight (integer $row, integer $col)
 void shrinkUp (integer $row, integer $col)
 void unserialize ( $data)
 boolean updated ()
Variables
array $_blocks = array() (line 43)

A cache for the block objects.

integer $_changed_col = null (line 78)

The new column of the last changed block.

integer $_changed_row = null (line 71)

The new row of the last changed block.

Horde_Block_Collection $_collection (line 29)

Our Horde_Block_Collection instance.

integer $_columns = 0 (line 50)

The maximum number of columns.

array $_currentBlock = array(null, null) (line 64)

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

array $_layout = array() (line 36)

The current block layout.

boolean $_updated = false (line 57)

Has the layout been updated since it was instantiated.

Inherited Variables

Inherited from Horde_Block_Layout

Horde_Block_Layout::$_editUrl
Horde_Block_Layout::$_viewUrl
Methods
static singleton (line 182)

Returns a single instance of the Horde_Block_Layout_Manager class.

  • return: The Horde_Block_Layout_Manager instance.
static Horde_Block_Layout_Manager &singleton (string $name, Horde_Block_Collection &$collection, [string $data = ''])
Constructor Horde_Block_Layout_Manager (line 86)

Constructor.

Horde_Block_Layout_Manager Horde_Block_Layout_Manager ( &$collection, [array $layout = array()], Horde_Block_Collection $collection)
addBlock (line 691)

Adds an empty block at the specified position.

void addBlock (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
addCol (line 724)

Adds a new column to the layout.

void addCol (integer $col)
  • integer $col: The number of the column to add
addRow (line 712)

Adds a new row to the layout.

void addRow (integer $row)
  • integer $row: The number of the row to add
colExists (line 636)

Does a column exist?

  • return: True if the column exists
boolean colExists (integer $col)
  • integer $col: The column to look for
columns (line 476)

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

  • return: The number of columns.
integer columns (integer $row)
  • integer $row: The row to return the number of columns from.
count (line 440)

Returns the number of blocks in the current layout.

  • return: The number of blocks.
  • since: Horde 3.1
integer count ()
expandDown (line 1167)

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

void expandDown (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
expandLeft (line 1204)

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

void expandLeft (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
expandRight (line 1236)

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

void expandRight (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
expandUp (line 1135)

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

void expandUp (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
getBlock (line 327)

Returns the Horde_Block at the specified position.

  • return: The block from that position or a PEAR_Error if something went wrong.
Horde_Block &getBlock (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
getBlockAt (line 349)

Returns the coordinates of the block covering the specified field.

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

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

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

  • return: The information hash.
array getBlockInfo (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
getControl (line 555)

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

  • return: A link containing an arrow representing the requested control.
string getControl (string $type, integer $row, integer $col)
  • 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.
getCurrentBlock (line 313)

Get the current block row and column.

  • return: [row, col]
array getCurrentBlock ()
getHeight (line 673)

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.

  • return: The number of rows this block spans
integer getHeight (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
getWidth (line 651)

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.

  • return: The number of columns this block spans
integer getWidth (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
handle (line 199)

Process a modification to the current layout.

void handle (string $action, integer $row, integer $col, [string $url = null])
  • string $action
  • integer $row
  • integer $col
  • string $url
isBlock (line 522)

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

  • return: True if the specified position is a block, false if the field doesn't exist, is empty or covered.
boolean isBlock (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
isChanged (line 536)

Returns if the specified block has been changed last.

  • return: True if this block is the last one that was changed.
boolean isChanged (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
isCovered (line 507)

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

  • return: True if the specified field is covered.
boolean isCovered (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
isEmpty (line 493)

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

  • return: True if the location is empty False is the location is being used.
boolean isEmpty (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
moveDown (line 891)

Moves a block one row down.

void moveDown (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
moveDownBelow (line 954)

Moves all blocks below a certain row one row down.

  • return: True if all rows could be moved down.
boolean moveDownBelow (integer $row)
  • integer $row: A layout row.
moveLeft (line 981)

Moves a block one column left.

void moveLeft (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
moveRight (line 1045)

Moves a block one column right.

void moveRight (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
moveRightAfter (line 1108)

Moves all blocks after a certain column one column right.

  • return: True if all columns could be moved right.
boolean moveRightAfter (integer $col)
  • integer $col: A layout column.
moveUp (line 830)

Moves a block one row up.

void moveUp (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
removeBlock (line 738)

Removes a block.

void removeBlock (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
removeColIfEmpty (line 804)

Removes a column if it's empty.

  • return: True if the column is now removed. False if the column still exists.
boolean removeColIfEmpty (integer $col)
  • integer $col: The number of the column to to check
removeRowIfEmpty (line 779)

Removes a row if it's empty.

  • return: True if the row is now removed. False if the row still exists.
boolean removeRowIfEmpty (integer $row)
  • integer $row: The number of the row to to check
rowExists (line 624)

Does a row exist?

  • return: True if the row exists
boolean rowExists (integer $row)
  • integer $row: The row to look for
rows (line 463)

Returns the number of rows in the current layout.

  • return: The number of rows.
integer rows ()
serialize (line 158)

Serialize and return the current block layout.

void serialize ()
setBlockInfo (line 413)

Sets a batch of information about the specified block.

void setBlockInfo (integer $row, integer $col, [array $info = array()])
  • 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
shrinkDown (line 1294)

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

void shrinkDown (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
shrinkLeft (line 1319)

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

void shrinkLeft (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
shrinkRight (line 1340)

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

void shrinkRight (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
shrinkUp (line 1273)

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

void shrinkUp (integer $row, integer $col)
  • integer $row: A layout row.
  • integer $col: A layout column.
unserialize (line 166)

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

void unserialize ( $data)
  • $data
updated (line 303)

Has the layout been changed since it was instantiated?

boolean updated ()

Inherited Methods

Inherited From Horde_Block_Layout

 Horde_Block_Layout::getActionUrl()
 Horde_Block_Layout::getHeaderIcons()
 Horde_Block_Layout::isRemovable()

Documentation generated on Sun, 30 Jan 2011 05:19:27 +0000 by phpDocumentor 1.4.3