Class: Bs_XAtom
Source Location: /applications/cms/Bs_XAtom.class.php
Bs_Object
|
--Bs_XAtom
XAtom Class (Abstaract Class)
Author(s):
Version:
- 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:34 $
Copyright:
|
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Class Variables
Class Methods
constructor Bs_XAtom [line 146]
Bs_XAtom Bs_XAtom(
mixed
$__file__)
|
|
Constructor.
method datetimeInRange [line 492]
int datetimeInRange(
[string
$startDatetime = NULL], [string
$endDatetime = NULL], [string
$now = NULL])
|
|
Tells if this element is ALIVE. That means if 'now-time' is between the start- and end-time of of this object. See $_atomContainer['alive']['startDatetime']; $_atomContainer['alive']['endDatetime']; above. The check may also be done with a time passed as 3rd parameter instead of using current gmt time. Everything in gmt. RETURN : start end ----------------|------------------------|-------------- -1 | 0 ] +1 now < start == -1 | ] end <= now == +1 NOTE I: If you pass at least the 2 first parameters, you may use this function static ($this is then not used). NOTE II: A valid datetime looks like "yyyy-mm-dd hh:mm:ss" and everything else gives wrong results. if for example startDatetime is empty or "0000-00-00 00:00:00" this means "there is none", thus "it is already active". The same applies for endDatetime "never expires". In a stupid situation it would even be possible that the datetime is too young AND too old. But this case is not detected. E.g. start:2005, end:1999, now:2001 you would get a -1 (expired) here.
Tags:
Parameters:
method getFailedReason [line 337]
array getFailedReason(
[mixed
$verbose = FALSE])
|
|
Tells what went wrong. see error-documents-howto.doc the vector has 3 elements. element 0 is the standard http error code, element 1 is the bs additional code, element 2 is for for additional information, if used at all. it is an array (hash or vector) and it may be empty. example: array(410, 1, array('datetime')); would mean that the page expired on 'datetime' and thus is gone.
Tags:
method init [line 173]
Init this object using UID (Unified ID). param $UID: The UID is either numeric (ID of Db), a string or an array (hash). for string and array see the codingGuidelinex.txt for details.
Overridden in child classes as:
- Bs_Block::init()
- Init this object using UID (Unified ID).
- Bs_Layout::init()
- Init this object using UID (Unified ID).
- Bs_Node::init()
- Init this object using UID (Unified ID).
- Bs_Page::init()
- Init this object using UID (Unified ID).
Parameters:
method isAlive [line 524]
Tells if something (page, node, block, whatever) with the given properties is alive or not. For alive it must be valid and 'now' must be between start- and end-time
Tags:
method matchBrowser [line 562]
bool matchBrowser(
[mixed
$browserString = NULL])
|
|
tells if the current user browser (manufacturer and version) matches. param $browserString looks like "ie4+;ns4+;op5+;ie4.5-6" it is a semicolon separated list. examples of junks: +---------+----------------------------+ | EXAMPLE | MEANING | +---------+----------------------------+ | ie4 | exactly ie4 is allowed | | ie4.5+ | ie4.5 and above is allowed | | ie4.5-6 | ie4.5 up to ie6 is allowed | +---------+----------------------------+ on the first match TRUE is returned, so just one junk has to match. instead of passing such a semicolon-separated list, you may aswell pass just one browser as string (eg 'ie4+') or a vector with such strings. if your string or array is empty, TRUE is returned.
Tags:
Parameters:
method matchFeature [line 663]
bool matchFeature(
[mixed
$featureString = NULL])
|
|
tells if the current user browser features match. param $featureString looks like "javaScriptEnabled;cookiesSession" it is a semicolon separated list. all features have to match to get a TRUE return value. if at least one does not match, you get FALSE. if none fails but 1-n cannot be checked then you get NULL. the following features are detectable: (see Bs_Browscap.class.php) - cookiesSession - frames
- cookiesPermanent - iFrames
- javaScript - tables
- javaScriptEnabled - fileUpload
- javaApplets - png
- javaAppletsEnabled - tableBgImage
- metaRefresh - xml
instead of passing such a semicolon-separated list, you may aswell pass just one feature as string (eg 'javaScriptEnabled') or a vector with such strings. if your string or array is empty, TRUE is returned.
Tags:
Parameters:
method matchPlugin [line 721]
bool matchPlugin(
[mixed
$pluginString = NULL])
|
|
tells if the current user browser plugins match. param $pluginString looks like "flash;pdf" it is a semicolon separated list. all plugins have to match to get a TRUE return value. if at least one does not match, you get FALSE. if none fails but 1-n cannot be checked then you get NULL. the following plugins are detectable: instead of passing such a semicolon-separated list, you may aswell pass just one feature as string (eg 'flash') or a vector with such strings. if your string or array is empty, TRUE is returned.
Tags:
Parameters:
method normalizeRef [line 424]
hash normalizeRef(
mixed
$parentUni, string
$refString)
|
|
Normalize the references to the varius elements and return an hash This little, but importent function expects a parentUni and an reference string to an an element (such as Page, Layout, ...). The parentUni gives us the absolute node-position (e.g. /node1/node2/) where as the ref-string may point relatively to it position (e.g. ../../aaa/bbb/element_one) into an other node. The information taken together will give us the abs parentUni and core name of the referenced element. We then return hash with the found info. Sampels: node-UID + refstring => coreName + parentUni --------------------+-------------------------++--------------+--------------- /aaa/bbb/ccc/' | ../../xxx/element_one || element_one | /aaa/xxx/ /aaa/bbb/ccc/' | /xxx/element_one || element_one | /xxx/ Return array ( 'parentUni' => '/aaa/xxx/', 'coreName' => 'element_one' ); NOTE: There is a situation where we throw FALSE. That is when no '/'
Tags:
Parameters:
method normalizeVersion [line 382]
Normalize normalizeVersion(
mixed
$versionMask)
|
|
Normalize a version string and return it See info in header of this file. Accepts wildcads. NULL or '' -> x.x.x 1.* . 4 -> 1.x.5 1, X -> 1.x.x 2 , . 23 -> 2.x.23
Tags:
method persist [line 347]
Use the XStorage to persist any XAtom huh, no return? no params (new version etc)? :/ --andrej
Overrides Bs_Object::persist() (Persists this object by serializing it and saving it to a file with unique name.)
method reset [line 299]
Reset the whole object But keep the UID and prform a basic init
method toXml [line 777]
string. toXml(
[bool
$htmlOut = FALSE])
|
|
Generate a XML output of the element (Node, Page, Layout, Block ...)
Tags:
Parameters:
method _basicInit [line 220]
void _basicInit(
mixed
$UID)
|
|
Init some very basic setup stuff that is directly related to the UID Set is parentUni coreName version level <- tree level of the node. E.g. root has level 0, root/foo/bar has level 2 ... USE: After a reset or during an Init.
Tags:
Parameters:
method _normalizeContainer [line 359]
void _normalizeContainer(
)
|
|
This may have to be done if the input is from a soucre that is written by human.
|
|