Class CMS_block

Description

Class CMS_block

represent a block of data inside a row. Abstract class, the following function _must_ be redefined in the subclasses :

  • getData()
  • getRawData()
  • delFromLocation()
  • writeToPersistence()

Located in /automne/classes/modules/standard/block.php (line 32)

CMS_grandFather
   |
   --CMS_block
Direct descendents
Class Description
 class CMS_block_flash Class CMS_block_flash
 class CMS_block_image Class CMS_block_image
 class CMS_block_file Class CMS_block_file
 class CMS_block_varchar Class CMS_block_varchar
 class CMS_block_link Class CMS_block_link
 class CMS_block_text Class CMS_block_text
 class CMS_block_cms_forms Class CMS_block_cms_forms
 class CMS_block_polymod Class CMS_block_polymod
Class Constant Summary
Method Summary
 CMS_block CMS_block ([ $id = 0], [integer $location = RESOURCE_LOCATION_USERSPACE], [boolean $public = false], integer $id,)
 boolean changeClientSpace (integer $pageID, integer $oldClientSpaceID, integer $newClientSpaceID, integer $rowID, integer $location, [boolean $public = false])
 boolean delFromLocation (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, [boolean $public = false])
 CMS_block duplicate ( &$destinationPage, [boolean $public = false], CMS_page $destinationPage,)
 string getAttribute (string $attribute)
 string getData (CMS_language &$language, CMS_page &$page, CMS_clientSpace &$clientSpace, CMS_row &$row, integer $visualizationMode)
 array(string=>mixed) getRawData (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, boolean $public)
 boolean initializeFromBasicAttributes (integer $blockID)
 boolean initializeFromID ( $blockID,  $rowID, string $blockID,, integer $rowID,)
 boolean initializeFromTag ( $attributes,  $tagInnerContent, string $tagDefinition)
 boolean writeToPersistence (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, boolean $public, array(mixed=>mixed) $data)
 string _getFolderName (integer $location, boolean $public)
 string _getHTMLForm ( $language, CMS_page &$page, CMS_clientSpace &$clientSpace, CMS_row &$row, integer $blockID, string $data, CMS_language &$language)
Methods
Constructor CMS_block (line 87)

Constructor, unset by default Only used for each sub class while getting all datas from database Useful for duplicate function for example

  • access: public
CMS_block CMS_block ([ $id = 0], [integer $location = RESOURCE_LOCATION_USERSPACE], [boolean $public = false], integer $id,)
  • integer $id,: DB ID of this block
  • integer $location: The location we want to get the block from
  • boolean $public: The needed precision for USERSPACE location
  • $id
changeClientSpace (line 276)

Change the clientspace of block from a location (public, archived, deleted, edited)

  • return: true on success, false on failure
  • access: public
boolean changeClientSpace (integer $pageID, integer $oldClientSpaceID, integer $newClientSpaceID, integer $rowID, integer $location, [boolean $public = false])
  • integer $pageID: The page which contains the client space, DB ID
  • integer $oldClientSpaceID: The old client space which contains the row, DB ID
  • integer $newClientSpaceID: The new client space which now contains the row, DB ID
  • integer $rowID: The row which contains the block, DB ID
  • integer $location: The location we want to completly remove the block from
  • boolean $public: The precision needed for USERSPACE location
delFromLocation (line 243)

Deletes the block from a location (public, archived, deleted, edited)

  • return: true on success, false on failure
  • access: public
boolean delFromLocation (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, [boolean $public = false])
  • integer $pageID: The page which contains the client space, DB ID
  • integer $clientSpaceID: The client space which contains the row, DB ID
  • integer $rowID: The row which contains the block, DB ID
  • integer $location: The location we want to completly remove the block from
  • boolean $public: The precision needed for USERSPACE location

Redefined in descendants as:
duplicate (line 423)

Duplicate this block, all datas rebnamed and saved Used to duplicate a CMS_page.

  • return: object
CMS_block duplicate ( &$destinationPage, [boolean $public = false], CMS_page $destinationPage,)
  • CMS_page $destinationPage,: the page receiving a copy of this block
  • boolean $public: The precision needed for USERSPACE location
  • &$destinationPage

Redefined in descendants as:
getAttribute (line 435)

Get the value of an attribute.

  • return: The attribute value
  • access: public
string getAttribute (string $attribute)
  • string $attribute: The attribute we want (its the key of the associative array)
getData (line 179)

Gets the data in HTML mode.

  • return: the HTML data
  • access: public
string getData (CMS_language &$language, CMS_page &$page, CMS_clientSpace &$clientSpace, CMS_row &$row, integer $visualizationMode)
  • CMS_language &$language: The language of the administration frontend
  • CMS_page &$page: The page which contains the client space
  • CMS_clientSpace &$clientSpace: The client space which contains the row
  • CMS_row &$row: The row which contains the block
  • integer $visualizationMode: The visualization mode used

Redefined in descendants as:
getRawData (line 198)

Gets the data in array mode.

  • return: The data indexed by data type (value, file, alt_tag, ...), or false on failure (table not found)
  • access: public
array(string=>mixed) getRawData (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, boolean $public)
  • integer $pageID: The page DB ID which contains the client space
  • integer $clientSpaceID: The client space DB ID which contains the row
  • integer $rowID: The row DB ID which contains the block
  • integer $location: The location of the page
  • boolean $public: The needed precision for USERSPACE location

Redefined in descendants as:
initializeFromBasicAttributes (line 99)

Pseudo-constructor, sets the base attributes.

initializes the block with the tag ID and repeat attributes.

  • return: true on success, false on failure.
  • access: public
boolean initializeFromBasicAttributes (integer $blockID)
  • integer $blockID: The ID attribute of the block tag
initializeFromID (line 152)

Pseudo-constructor, initializes the tag with its definition from tag and row id

  • return: true on success, false on failure.
  • access: public
boolean initializeFromID ( $blockID,  $rowID, string $blockID,, integer $rowID,)
  • string $blockID,: the block id to initialise
  • integer $rowID,: the row id which contain the block to load
  • $blockID
  • $rowID
initializeFromTag (line 118)

Pseudo-constructor, initializes the tag with its definition.

  • return: true on success, false on failure.
  • access: public
boolean initializeFromTag ( $attributes,  $tagInnerContent, string $tagDefinition)
  • string $tagDefinition: The tag definition, including the tag itself.
  • $attributes
  • $tagInnerContent
writeToPersistence (line 312)

Writes the block data into persistence (destroys previous and insert new)

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence (integer $pageID, integer $clientSpaceID, integer $rowID, integer $location, boolean $public, array(mixed=>mixed) $data)
  • integer $pageID: The page which contains the client space, DB ID
  • integer $clientSpaceID: The client space which contains the row, DB ID
  • integer $rowID: The row which contains the block, DB ID
  • integer $location: The location we want to completly remove the block from
  • boolean $public: The precision needed for USERSPACE location
  • array(mixed=>mixed) $data: The data indexed by data type (value, file, alt_tag, ...),

Redefined in descendants as:
_getFolderName (line 214)

Gets the folder name which depends of the page location

  • return: The folder name
  • access: public
string _getFolderName (integer $location, boolean $public)
  • integer $location: The location we want to completly remove the block from
  • boolean $public: The precision needed for USERSPACE location
_getHTMLForm (line 332)

Get the HTML form given the block HTML example data.

  • return: The HTML form which can send to the page that will modify the block
  • access: private
string _getHTMLForm ( $language, CMS_page &$page, CMS_clientSpace &$clientSpace, CMS_row &$row, integer $blockID, string $data, CMS_language &$language)
  • CMS_language &$language: The language of the administration frontend
  • CMS_page &$page: The page which contains the client space
  • CMS_clientSpace &$clientSpace: The client space which contains the row
  • CMS_row &$row: The row which contains the block
  • integer $blockID: The tag ID of the block
  • string $data: The data to show as example
  • $language

Redefined in descendants as:

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_BLOCK_CONTENT_ERROR = 1598 (line 37)

Messages

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:28:35 +0100 by phpDocumentor 1.4.3