SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Pagenode

Represents a page in a page tree

Variables

NameVisibilityDescription
$data 
$filtered_children 
$parent 
$real_children 

Functions

NameVisibilityDescription
__constructpublicCreates a node, with the specified data
__getpublicGeneric field getter for unknown properties - used for TreeNode->children
__setpublicGeneric field getter for unknown properties - used for TreeNode->children
filterChildrenpublicFilter the children of this node, removing any children which don't match the specified TreenodeMatcher.
findAllNodespublicFinds all nodes which match the specified matcher.
findAncestorspublicFinds all ancestors of a specific node, including the node, not including the root node of the tree
findNodepublicFinds a node by looking at this node
findNodeValuepublicFinds a node by looking at this node
getAllChildrenpublicReturns an array of all children nodes, including sub-children
getBannerpublicReturns the filename to use for the banner image.
getChildrenpublic 
getFriendlyUrlpublicReturns the friendly url for a node
getFriendlyUrlNoprefixpublicReturns the friendly url for a node - but don't include a directory prefix
getNavigationNamepublicReturns the name that should be used to represent this node when rendering navigation elements
getUrlNamepublicReturns the name of this page only, when constructing a URL
isOrphanpublicIs this node an orphan?
isRootpublicReturns true if this node is the root node
loadTreepublic (static)Not valid
offsetExistspublicArrayAccess function for checking if a specified key exists
offsetGetpublicArrayAccess function for getting a value by its key
offsetSetpublicArrayAccess function for setting a value by its key
offsetUnsetpublicArrayAccess function for unsetting a value
removeFilterpublicRemoves the currently active filter

public __construct (from Treenode)

void $Treenode->__construct ( [ array $data ] );

Creates a node, with the specified data

public __get (from Treenode)

unknown $Treenode->__get ( string &$field );

Generic field getter for unknown properties - used for TreeNode->children

Be aware that data gotten through this getter is BY REFERENCE
For by-value data retrival, use the array-access functions.

public __set (from Treenode)

void $Treenode->__set ( string $field , mixed $value );

Generic field getter for unknown properties - used for TreeNode->children

public filterChildren (from Treenode)

void $Treenode->filterChildren ( TreenodeMatcher $matcher );

Filter the children of this node, removing any children which don't match the specified TreenodeMatcher.
The nodes are not actually removed, matching nodes are just added to a filtered children list
Which is returned instead of the original children list.

public findAllNodes (from Treenode)

static[] $Treenode->findAllNodes ( TreenodeMatcher $matcher );

Finds all nodes which match the specified matcher.

public findAncestors (from Treenode)

static[] $Treenode->findAncestors ( );

Finds all ancestors of a specific node, including the node, not including the root node of the tree
The array is in order from top to bottom, so $ancestors[0] is the top-parent, and $ancestors[len-1] is the node.

        A
   B         C
 D   E     F   G
H I

NODE    RESULT ARRAY
 H       B D H
 D       B D
 B       B
 A       (empty)

public findNode (from Treenode)

static $Treenode->findNode ( TreenodeMatcher $matcher );

Finds a node by looking at this node
If that does not match, looking at each of this nodes children in turn.
If that does not match, return null

public findNodeValue (from Treenode)

TreeNode $Treenode->findNodeValue ( mixed $key , mixed $value );

Finds a node by looking at this node
If that does not match, looking at each of this nodes children in turn.
If that does not match, return null

public getAllChildren (from Treenode)

unknown $Treenode->getAllChildren ( [ mixed $exclude_id [, mixed $indent_str [, mixed $indent ]]] );

Returns an array of all children nodes, including sub-children

The array will be id => name.
This function requires the table to have a column named 'name'.
The name field will be indented according to the depth.
If specified, the exclude_id argument will be used to
exclude nodes (and their children) according to id.

public getBanner

string|null $Pagenode->getBanner ( );

Returns the filename to use for the banner image.
Returns NULL if no banner has been defined for this page and a generic banner should be used instead.

public getChildren (from Treenode)

static[] $Treenode->getChildren ( );

This function does not have a description

public getFriendlyUrl

string $Pagenode->getFriendlyUrl ( );

Returns the friendly url for a node

public getFriendlyUrlNoprefix

string $Pagenode->getFriendlyUrlNoprefix ( );

Returns the friendly url for a node - but don't include a directory prefix

public getNavigationName

string $Pagenode->getNavigationName ( );

Returns the name that should be used to represent this node when rendering navigation elements
on the front-end

public getUrlName

string $Pagenode->getUrlName ( );

Returns the name of this page only, when constructing a URL

public isOrphan (from Treenode)

bool $Treenode->isOrphan ( );

Is this node an orphan?
Orphans are at the top of the tree, and they don't have any children.

public isRoot (from Treenode)

unknown $Treenode->isRoot ( );

Returns true if this node is the root node

public loadTree

void Pagenode::loadTree ( mixed $table [, array $where [, mixed $order ]] );

Not valid

public offsetExists (from Treenode)

unknown $Treenode->offsetExists ( mixed $offset );

ArrayAccess function for checking if a specified key exists

public offsetGet (from Treenode)

unknown $Treenode->offsetGet ( mixed $offset );

ArrayAccess function for getting a value by its key

public offsetSet (from Treenode)

void $Treenode->offsetSet ( mixed $offset , mixed $value );

ArrayAccess function for setting a value by its key

public offsetUnset (from Treenode)

void $Treenode->offsetUnset ( mixed $offset );

ArrayAccess function for unsetting a value

public removeFilter (from Treenode)

void $Treenode->removeFilter ( );

Removes the currently active filter