Page

Represents a web page.  This class is primarily concerned with making sure that the things in the HEAD part of the page are set up correctly.

Inherits

LnBlogObject

Events

OnInitFired when a page object is first created.
InitCompleteFired after object initialization is complete.
OnOutputFired when processing for HTML output starts.
OutputCompleteFired after the HTML output has been performed.
Summary
Represents a web page.
Holds a reference to the primary object which is displayed on this page.
String holding the DOCTYPE for the page.
A string used for the page title.
Represents the MIME type of the page.
Holds the character encoding to use for the page.
Sets the object which the page is currently displaying.
Adds style sheets to be link into the page.
Adds style sheets to be added inline into the page.
Adds a generic link element to the page header.
Adds an RSS feed to the link elements of the page header.
Adds a script file to the header of the page.
Adds an inline script to the header of the page.
Adds a META item to the page.
Add an item to the HTTP header for the page.
Redirect to another page.
Refresh the page.
Displays the page, i.e.

Properties

display_object

Holds a reference to the primary object which is displayed on this page.  The type of object will vary from page to page and may be set to false on some pages.  For most pages, it will be the current Blog object, but BlogEntry and Article object are also common.

doctype

String holding the DOCTYPE for the page.  Should normally be set using a named constant.

title

A string used for the page title.

mime_type

Represents the MIME type of the page.

charset

Holds the character encoding to use for the page.

Functions

setDisplayObject

function setDisplayObject(&$ref)

Sets the object which the page is currently displaying.

Parameters

refA reference to the object to set.

addStylesheet

function addStylesheet()

Adds style sheets to be link into the page.

Parameters

Takes a variable number of string parameters, each representing the filename of a CSS file.

addInlineStylesheet

function addInlineStylesheet()

Adds style sheets to be added inline into the page.

Parameters

Takes a variable number of string parameters, each containing the CSS code to use for the inline styles.

addLink

function addLink($attribs)

Adds a generic link element to the page header.

Parameters

attribsAn associative array, with each key corresponding to an attribute of the link with the corresponding value as the value.

addRSSFeed

function addRSSFeed($href,
$type,
$title)

Adds an RSS feed to the link elements of the page header.

Parameters

hrefThe URL of the feed file.
typeThe MIME type of the feed, e.g. application/xml or application/rss+xml
titleThe title for the feed.

addScript

function addScript($href,  
$type = "text/javascript")

Adds a script file to the header of the page.

Parameters

hrefThe URL of the script file.
typeOptional MIME type of the script.  The default is text/javascript.

addInlineScript

function addInlineScript($text,  
$type = "text/javascript")

Adds an inline script to the header of the page.

Parameters

textThe text of the script to add inline.
typeOptional MIME type of the script.  The default is text/javascript.

addMeta

function addMeta($content,  
$name = false,
$httpequiv = false)

Adds a META item to the page.

Parameters

contentThe content of the meta tag.
nameOptional name attribute.
httpequivOptional http-equiv attribute.

addHeader

function addHeader($name,
$content)

Add an item to the HTTP header for the page.

Parameters

nameThe header name.
contentThe content of the header.

redirect

function redirect($url)

Redirect to another page.

Parameters

urlThe target URL to which to redirect.

refresh

function refresh($url,  
$delay = )

Refresh the page.

Parameters

urlThe URL of the page to refresh.
delayOptional delay of refresh.  Default is 0.

display

function display($page_body,  
$blog = false)

Displays the page, i.e. sends it to the browser.

function setDisplayObject(&$ref)
Sets the object which the page is currently displaying.
function addStylesheet()
Adds style sheets to be link into the page.
function addInlineStylesheet()
Adds style sheets to be added inline into the page.
function addLink($attribs)
Adds a generic link element to the page header.
function addRSSFeed($href,
$type,
$title)
Adds an RSS feed to the link elements of the page header.
function addScript($href,  
$type = "text/javascript")
Adds a script file to the header of the page.
function addInlineScript($text,  
$type = "text/javascript")
Adds an inline script to the header of the page.
function addMeta($content,  
$name = false,
$httpequiv = false)
Adds a META item to the page.
function addHeader($name,
$content)
Add an item to the HTTP header for the page.
function redirect($url)
Redirect to another page.
function refresh($url,  
$delay = )
Refresh the page.
function display($page_body,  
$blog = false)
Displays the page, i.e.
A base object which is event-aware, i.e.