Stud.IP  2.4 Revision 48548
 All Data Structures Namespaces Files Functions Variables Groups Pages
PageLayout Class Reference
Collaboration diagram for PageLayout:
Collaboration graph

Static Public Member Functions

static initialize ()
static setTitle ($title)
static getTitle ()
static setHelpKeyword ($help_keyword)
static getHelpKeyword ()
static setTabNavigation ($path)
static getTabNavigation ()
static addStyle ($content, $media= '')
static addStylesheet ($source, $attributes=array())
static removeStylesheet ($source, $attributes=array())
static addScript ($source)
static removeScript ($source)
static addHeadElement ($name, $attributes=array(), $content=NULL)
static removeHeadElement ($name, $attributes=array())
static addComment ($content)
static removeComment ($content)
static getHeadElements ()
static addBodyElements ($html)
static getBodyElements ()
static disableHeader ()
static isHeaderEnabled ()
static getBodyElementId ()
static postMessage (MessageBox $message, $id=null)
static clearMessages ()
static getMessages ()
static getSqueezePackages ()
static setSqueezePackages ($package)
static addSqueezePackage ($package)

Detailed Description

The PageLayout class provides utility functions to control the global page layout of Stud.IP. This includes the page title, the included CSS style sheets and JavaScript files. It replaces the "traditional" way of manipulating the page header via special global variables (like $CURRENT_PAGE and $_include_stylesheet).

Each Stud.IP page should at least set the page title and help keyword (if a help page exists).

Member Function Documentation

static addBodyElements (   $html)
static

Add an extra HTML fragment at the start of the HTML BODY section.

Parameters
string$htmlHTML fragment to include in BODY

Here is the caller graph for this function:

static addComment (   $content)
static

Insert a (conditional) comment in the header. To preserve execution order, this method utilizes addHeadElement() in a more or less hackish way.

Parameters
string$contentcomment content

Here is the call graph for this function:

Here is the caller graph for this function:

static addHeadElement (   $name,
  $attributes = array(),
  $content = NULL 
)
static

Add an extra HTML element to the HTML HEAD section. This can be used to include RSS/ATOM feed links, META tags or other stuff. If $content is NULL, no closing tag is generated. If the element needs a closing tag (like SCRIPT) but should not have contents, pass the empty string as the third parameter.

Parameters
string$nameelement name (e.g. 'meta')
array$attributesadditional attributes for the element
string$contentelement contents, if any

Here is the caller graph for this function:

static addScript (   $source)
static

Add a JavaScript SCRIPT element to the HTML HEAD section.

Parameters
string$sourceURL of JS file or file in assets folder

Here is the call graph for this function:

Here is the caller graph for this function:

static addSqueezePackage (   $package)
static

Add a squeeze package to the list of squeeze packages to use

Parameters
string$packagethe name of the package

Here is the caller graph for this function:

static addStyle (   $content,
  $media = '' 
)
static

Add a STYLE element to the HTML HEAD section.

Parameters
string$contentelement contents
string$mediamedia types

Here is the call graph for this function:

Here is the caller graph for this function:

static addStylesheet (   $source,
  $attributes = array() 
)
static

Add a style sheet LINK element to the HTML HEAD section.

Parameters
string$sourcestyle sheet URL or file in assets folder
array$attributesadditional attributes for LINK element

Here is the call graph for this function:

Here is the caller graph for this function:

static clearMessages ( )
static

Clears all messages pending for display.

Here is the caller graph for this function:

static disableHeader ( )
static

Disable output of the navigation header for this page.

static getBodyElementId ( )
static

Get a dynamically generated ID for the BODY element. The ID is based on the name of the PHP script, with the suffix removed and all non-alphanumeric characters replace with '_'.

static getBodyElements ( )
static

Return all HTML BODY fragments as a string.

Returns
string HTML fragment
static getHeadElements ( )
static

Return all HTML HEAD elements as a string.

Returns
string HTML fragment

Here is the call graph for this function:

static getHelpKeyword ( )
static

Get the current help keyword (defaults to 'Basis.Allgemeines').

Here is the caller graph for this function:

static getMessages ( )
static

Returns the list of pending messages and clears the list.

Returns
array list of MessageBox objects

Here is the call graph for this function:

static getSqueezePackages ( )
static

Return the names of the squeeze packages to use.

Per default the squeeze package "base" is included.

Returns
array an array containing the names of the packages
static getTabNavigation ( )
static

Returns the base navigation object (not its path) for the tabs. May return NULL if tab display is disabled.

Here is the call graph for this function:

static getTitle ( )
static

Get the current page title (defaults to $UNI_NAME_CLEAN).

Here is the caller graph for this function:

static initialize ( )
static

Initialize default page layout. This should only be called once from phplib_local.inc.php. Don't use this otherwise.

Here is the call graph for this function:

static isHeaderEnabled ( )
static

Return whether output of the navigation header is enabled.

static postMessage ( MessageBox  $message,
  $id = null 
)
static

Registers a MessageBox object for display the next time a layout is rendered. Note: This will only work for pages that use layout templates.

Parameters
MessageBoxmessage object to display

Here is the caller graph for this function:

static removeComment (   $content)
static

Remove a (conditional) comment from the header.

Parameters
string$contentcomment content

Here is the call graph for this function:

static removeHeadElement (   $name,
  $attributes = array() 
)
static

Remove HTML elements from the HTML HEAD section. This method will remove all elements matching the given name and all the attributes.

For example, to remove all META elements: PageLayout::removeHeadElement('meta');

Remove all style sheet LINK elements: PageLayout::removeHeadElement('link', array('rel' => 'stylesheet'));

Remove a particular style sheet LINK by href: PageLayout::removeHeadElement('link', array('href' => '...'));

Here is the caller graph for this function:

static removeScript (   $source)
static

Remove a JavaScript SCRIPT element from the HTML HEAD section.

Parameters
string$sourceURL of JS file or file in assets folder

Here is the call graph for this function:

static removeStylesheet (   $source,
  $attributes = array() 
)
static

Remove a style sheet LINK element from the HTML HEAD section.

Parameters
string$sourcestyle sheet URL or file in assets folder
array$attributesadditional attributes for LINK element

Here is the call graph for this function:

Here is the caller graph for this function:

static setHelpKeyword (   $help_keyword)
static

Set the help keyword to the given string.

Here is the caller graph for this function:

static setSqueezePackages (   $package)
static

Set the names of the squeeze packages to use

# use as many arguments as you want
PageLayout::setSqueezePackages("base", "admin", "upload");
# PageLayout::setSqueezePackages(...);
Parameters
...a variable-length argument list containing the names of the packages

Here is the caller graph for this function:

static setTabNavigation (   $path)
static

Select which tabs (if any) should be displayed on the page. The argument specifies a navigation item in the tree whose children will form the first level of tabs. If $path is NULL, no tabs are displayed. The default setting is to use the active element in the top navigation.

Parameters
string$pathpath of navigation item for tabs or NULL

Here is the call graph for this function:

Here is the caller graph for this function:

static setTitle (   $title)
static

Set the page title to the given text.

Here is the caller graph for this function:


The documentation for this class was generated from the following file: