blueshoes php application framework and cms            applications_cms
[ class tree: applications_cms ] [ index: applications_cms ] [ all elements ]

Class: Bs_Block

Source Location: /applications/cms/Bs_Block.class.php

Class Overview

Bs_Object
   |
   --Bs_XAtom
      |
      --Bs_Block

Block Class


Author(s):

Version:

  • 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:34 $

Copyright:

  • blueshoes.org

Variables

Methods


Inherited Variables

Inherited Methods

Class: Bs_XAtom

Bs_XAtom::Bs_XAtom()
Constructor.
Bs_XAtom::datetimeInRange()
Tells if this element is ALIVE.
Bs_XAtom::getFailedReason()
Tells what went wrong.
Bs_XAtom::init()
Init this object using UID (Unified ID).
Bs_XAtom::isAlive()
Tells if something (page, node, block, whatever) with the given properties is alive or not.
Bs_XAtom::matchBrowser()
tells if the current user browser (manufacturer and version) matches.
Bs_XAtom::matchFeature()
tells if the current user browser features match.
Bs_XAtom::matchPlugin()
tells if the current user browser plugins match.
Bs_XAtom::normalizeRef()
Normalize the references to the varius elements and return an hash
Bs_XAtom::normalizeVersion()
Normalize a version string and return it See info in header of this file.
Bs_XAtom::persist()
Use the XStorage to persist any XAtom
Bs_XAtom::reset()
Reset the whole object
Bs_XAtom::toXml()
Generate a XML output of the element (Node, Page, Layout, Block ...)
Bs_XAtom::_basicInit()
Init some very basic setup stuff that is directly related to the UID
Bs_XAtom::_normalizeContainer()
This may have to be done if the input is from a soucre that is written by human.

Class: Bs_Object

Bs_Object::Bs_Object()
Bs_Object::getErrors()
Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack.
Bs_Object::getLastError()
Basic error handling: Get last error string from the global Bs_Error-error stack.
Bs_Object::getLastErrors()
Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors().
Bs_Object::persist()
Persists this object by serializing it and saving it to a file with unique name.
Bs_Object::setError()
Basic error handling: Push an error string on the global Bs_Error-error stack.
Bs_Object::toHtml()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::toString()
Dumps the content of this object to a string using PHP's var_dump().
Bs_Object::unpersist()
Fetches an object that was persisted with persist()

Class Details

[line 28]
Block Class

dependencies: Bs_XAtom, Bs_HtmlTable (when needed),




Tags:

copyright:  blueshoes.org
pattern:  singleton: (pseudostatic)
access:  public
version:  4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:34 $
author:  Sam Blum <at blueshoes dot org>, andrej arn <andrej at blueshoes dot org>


[ Top ]


Class Variables

$emptyDesignProp = array(
            'name'         => 'default',             'data'         => '',                    'rendered'     => '',                )

[line 79]


Type:   mixed


[ Top ]

$emptyPartProp = array(
            'name'          => 'default',             'access'        => 'public',              'mime'          => 'text',                'cruncher'      => '',                    'crunchdelay'   => NULL,                  'data'          => '',                    'rendered'      => '',                    'renderedTime'  => NULL,            )

[line 69]


Type:   mixed


[ Top ]

$_dataContainer = array(        'block'         => array(
        'name'         => '',               'version'      => '',               'access'       => 'public',         'cacheExpire'  => '',               'part'         => array(),'design'=>array(),),)

[line 53]

STRUCTURE DETAILS:

PART Hash: $part[<part Name>] = array( 'name' => 'default', // <- the part name 'access' => 'public', // <- "public"|"private"|"protected" 'mime' => 'text', // <- e.g. "cdata"|"html"|"xml"|"xhtml"|"image"|"php" ... 'cruncher' => '', // <- "toXhtml;php;..." a csv-list of crunchers. Not sure about XSLT needs a xsl-file 'crunchdelay' => NULL, // <- how long to wait in [min] to start the next crunch. -1=never, 0=always, '' or NULL = 1x 'data' => '', // <- the content of the block part. Depends on mime. May be a string (cdata, xml) or a hash (image) 'rendered' => '', // <- the rendered block part. 'renderedTime' => NULL, // <- Last Unix time the block was rendered (is equal to the last crunch time) ); DESIGN Hash: $design[<design Name>] = array( 'name' => 'default', // <- the design name 'data' => '', // <- the content of the block design. 'rendered' => '', // <- the rendered design . );



Type:   mixed


[ Top ]



Class Methods


constructor Bs_Block [line 89]

Bs_Block Bs_Block( object $node)

Constructor.



Parameters:

object   $node  

[ Top ]

method determineBlock [line 135]

object initialized determineBlock( object &$parentNode, hash $refAttr)

Determines the right Block.

If we have to determine an XAtom element, that always means we haven't got the UID (Unified ID) to init it directly. We expect to receive the parent Node as parameter and a so called refAttr (reference attribute hash) of following min. structure: $refAttr = array( // <- Ref attrbute array of the found BloceboRef / BlockRef 'ref' => array(), // <- A ref stucture to an element ( see XATOM->normalizeRef() ) 'parentUni' =>'', // <- parent Node UNI 'coreName' =>'' // <- core name of element (No version, no extention) ), 'version' => '', // <- version-mask of the block 'mime' => '', // <- (optional) the block mime-type 'source' => '', // <- "file" | "db" ),

NOTE: Bs_Layout::determineLayout() and Bs_Block::determineBlock() are currently (7.12.2001) identical in what they do. So changes here may also have to be made there.




Tags:

return:  Block.
throws:  FALSE on error
access:  public


Parameters:

object   $parentNode   The parent Node of where the Bolck is expected to be.
hash   $refAttr   See above

[ Top ]

method getRendered [line 373]

void getRendered( mixed $partName)



[ Top ]

method init [line 104]

bool init( mixed $UID)

Init this object using UID (Unified ID).



Overrides Bs_XAtom::init() (Init this object using UID (Unified ID).)

Parameters:

mixed   $UID   (see Bs_XAtom->init().)

[ Top ]

method render [line 220]

bool render( [string $partName = 'default'], [array $sandwichProp = null])

Render and set 'rendered'-buffer of this block.



Parameters:

string   $partName   The part name if block is a multipart-block.
array   $sandwichProp   (see Bs_Layout->_dataContainer)

[ Top ]

method _isItTimeToRender [line 388]

void _isItTimeToRender( mixed &$partProp)

Check if we have to do the rendering/crunching at all.

When do we render: if 'cruncherdelay' == 0 then always, >0 after 'cruncherdelay'-minutes ELSE 1x

In detail: a) If the 'rendered'-buffer is empty and no 'renderedTime' was set. Then we never did render and have to do it at least 1x b) If 'cruncherdelay' === 0 always rerender/recrunch c) If 'cruncherdelay' > 0 then rerender/recrunch after 'cruncherdelay'-minutes .




[ Top ]


Documentation generated on Mon, 29 Dec 2003 21:08:05 +0100 by phpDocumentor 1.2.3