Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables 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)
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 getHeadElements ()
static addBodyElements ($html)
static getBodyElements ()
static disableHeader ()
static isHeaderEnabled ()
static getBodyElementId ()

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
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 addStyle (   $content)
static

Add a STYLE element to the HTML HEAD section.

Parameters
string$contentelement contents

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 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 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 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 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: