Lightnote CMS - web 2.0 content management system

Page

Variables
$id = 0
Type
integer
$exists = false

True if page exists

Type
bool
$hidden
Type
bool
$hiddenInMenu
Type
bool
$lang = ""

Page language

Type
string
$name = ""
Type
mixed
$template = ""

Name of page template

Type
string
$translationId = 0

Id of page translation

Type
int
Methods
Page Page( int $pageId, $lang, [ $forceInit = true])

Constuctor

Parameters:
int $pageId - page id (0 for root page)
string $lang - language code
bool $forceInit - indicates whether to initialize page parameters
Page AddSubPage( string $name, [array $config = null])

Adds subpage

Parameters:
string $name - name of subpage
array $config - associative array with configuration params Following configuration parameters are possible: hidden - 0 = visible, 1 = hidden in menu, 2 = hidden (default)
void ClearCache( )

Clean ups page cache.

void GetCacheId( )

Returns id of page cache for futher use by smarty template caching.

array[] GetContent( [ $config = null])

Returns 2 dimensional array with page content ARRAY[COLUMN][ROW] = Content object

Parameters:
$config -
array GetData( )

Returns associative array with page parameters

string GetFriendlyName( )

Returns browser friendly name for web pages (right now works only with latein alphabet)

string GetHeaderHtml( )

Returns html code of page header, this code doesn't include tags and should be inserted between them.

Page GetParentPage( )

Returns the parent page of current page, if page doesn't exists, returns null

array GetParentPages( )

Returns indexed array with parent pages.

array[string GetProperties( )

Returns associative array with all page properties.

string GetProperty( string $propertyName)

Returns page property, use SetProperty and SetProperties methods to set page properties

Parameters:
string $propertyName - name of property
void GetSubPages( [array $config = null])

Returns indexed array of subpages ordered by sort index

Parameters:
array $config - - associative array with configuration params ARRAY[CONFIG_KEY] = CONFIG_VALUE following CONFIG_KEYs are supported bool "hidden" - if true hidden subpages will be included to result (DEFAULT false) bool "hidden_in_menu" - if true hidden in menu subpages will be included to result (DEFAULT false)
PageTemplate GetTemplate( )

Returns page template object.

string GetTitle( )

Returns page title. In case page browser title is not specified, generates page title automatically which includes page name and names of parent pages.

string GetUrl( )

Returns page url.

bool HasAncestor( object/int $page)

Returns true if page is ancestor of this page

Parameters:
object/int $page - id or page object
void Init( )

Re-Initializes all page parameters

bool IsShortcut( [string $url = ""])

Returns true if page is a shortcut to another page

Parameters:
string $url - url optional param to test url if it shortcut or not.
void Remove( )

Removes page and all sub pages.

void SetProperties( string $params)

Sets page properties for specified page translation, use GetProperty to retrieve the property value.

Parameters:
string $params - associative array with page properties
void SetProperty( string $propertyName, string $propertyValue)

Sets page property, use GetProperty to retrieve the property value.

Parameters:
string $propertyName - property name
string $propertyValue - property value
void Update( array $params)

Updates page parameters from associative array

Parameters:
array $params - associative array with parameters to update