Stud.IP
6.0
|
Static Public Member Functions | |
static static | initialize () |
static | setTitle ($title) |
static | hasTitle () |
static | getTitle () |
static | setHelpKeyword ($help_keyword) |
static | getHelpKeyword () |
static | setHelpUrl (?string $url) |
static | getHelpUrl () |
static | setTabNavigation ($path) |
static | getTabNavigation () |
static | getTabNavigationPath () |
static | addStyle ($content, $media='') |
static | addStylesheet ($source, $attributes=[]) |
static | removeStylesheet ($source, $attributes=[]) |
static | addScript ($source, $attributes=[]) |
static | removeScript ($source, $attributes=[]) |
static | addHeadElement ($name, $attributes=[], $content=NULL) |
static | removeHeadElement ($name, $attributes=[]) |
static | addComment ($content) |
static | removeComment ($content) |
static | getHeadElements () |
static | addBodyElements ($html) |
static | getBodyElements () |
static | disableHeader () |
static | isHeaderEnabled () |
static | disableSidebar (bool $state=true) |
static | isSidebarEnabled () |
static | disableFooter (bool $state=true) |
static | isFooterEnabled () |
static | setBodyElementId ($id) |
static | hasBodyElementId () |
static | getBodyElementId () |
static | postMessage (LayoutMessage $message, $id=null) |
static | postSuccess ($message, $details=[], $close_details=false) |
static | postError ($message, $details=[], $close_details=false) |
static | postInfo ($message, $details=[], $close_details=false) |
static | postWarning ($message, $details=[], $close_details=false) |
static | postException ($message, $details=[], $close_details=false) |
static | postQuestion ($question, $accept_url='', $decline_url='') |
static | clearMessages () |
static | getMessages (string $type=LayoutMessage::class) |
static | getSqueezePackages () |
static | setSqueezePackages ($package) |
static | addSqueezePackage ($package) |
static | addCustomQuicksearch ($html) |
static | hasCustomQuicksearch () |
static | getCustomQuicksearch () |
static | allowFullscreenMode ($state=true) |
static | isFullscreenModeAllowed () |
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).
|
static |
Add an extra HTML fragment at the start of the HTML BODY section.
string | $html | HTML fragment to include in BODY |
|
static |
Insert a (conditional) comment in the header. To preserve execution order, this method utilizes addHeadElement() in a more or less hackish way.
string | $content | comment content |
|
static |
Modifies the Quicksearch of Stud.IP
$html | HTML code for the custom quicksearch |
|
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.
string | $name | element name (e.g. 'meta') |
array | $attributes | additional attributes for the element |
string | $content | element contents, if any |
|
static |
Add a JavaScript SCRIPT element to the HTML HEAD section.
string | $source | URL of JS file or file in assets folder |
array | $attributes | Additional parameters for the script tag |
|
static |
Add a squeeze package to the list of squeeze packages to use
string | $package | the name of the package |
|
static |
Add a STYLE element to the HTML HEAD section.
string | $content | element contents |
string | $media | media types |
|
static |
Add a style sheet LINK element to the HTML HEAD section.
string | $source | style sheet URL or file in assets folder |
array | $attributes | additional attributes for LINK element |
|
static |
Defines whether full screen mode toggle is allowed or not.
boolean | $state |
|
static |
Clears all messages pending for display.
|
static |
Disable output of the page footer for this page.
bool | $state |
|
static |
Disable output of the navigation header for this page.
|
static |
Disable output of the sidebar for this page.
|
static |
Gets the id of the body element. If non was set, it is dynamically generated base on the name of the current PHP script, with the suffix removed and all non-alphanumeric characters replaced with '_'.
|
static |
Return all HTML BODY fragments as a string.
|
static |
Retrieves the code of the custom quicksearch
|
static |
Return all HTML HEAD elements as a string.
|
static |
Get the current help keyword (defaults to 'Basis.Allgemeines').
|
static |
Get the current help URL. If no URL is set explicitly, the URL for the help keyword is used.
|
static |
Returns the list of pending messages and clears the list.
|
static |
Return the names of the squeeze packages to use.
Per default the squeeze package "base" is included.
|
static |
Returns the base navigation object (not its path) for the tabs. May return NULL if tab display is disabled.
|
static |
Returns the base navigation path for the tabs. May return NULL if tab display is disabled.
|
static |
Get the current page title (defaults to $UNI_NAME_CLEAN).
|
static |
Returns whether an id for the body element has been set.
|
static |
Check if a custom quicksearch was added to the layout
|
static |
Returns whether a title has been set
|
static |
Initialize default page layout. This should only be called once from phplib_local.inc.php. Don't use this otherwise.
|
static |
Return whether output of the page footer is enabled.
|
static |
Returns whether full screen mode toggle is allowed.
|
static |
Return whether output of the navigation header is enabled.
|
static |
Return whether output of the sidebar is enabled.
|
static |
Convenience method: Post an error message box.
String | $message | Error message to diplay |
Array | $details | Additional details (optional) |
bool | $close_details | Show the details closed (optional, defaults to false) |
|
static |
Convenience method: Post an exception message box.
String | $message | Exception message to diplay |
Array | $details | Additional details (optional) |
bool | $close_details | Show the details closed (optional, defaults to false) |
|
static |
Convenience method: Post an info message box.
String | $message | Info message to diplay |
Array | $details | Additional details (optional) |
bool | $close_details | Show the details closed (optional, defaults to false) |
|
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.
MessageBox | message object to display |
|
static |
Convenience method: Post a question to confirm an action.
Be aware, that this will output the question as html. So you should either know what you are doing, use htmlReady() or post the QuestionBox for yourself using self::postMessage().
String | $question | Question to confirm |
Array | $approve_params | Parameters to send when approving |
Array | $disapprove_params | Parameters to send when disapproving |
|
static |
Convenience method: Post a success message box.
String | $message | Success message to diplay |
Array | $details | Additional details (optional) |
bool | $close_details | Show the details closed (optional, defaults to false) |
|
static |
Convenience method: Post a warning message box.
String | $message | Warning message to diplay |
Array | $details | Additional details (optional) |
bool | $close_details | Show the details closed (optional, defaults to false) |
|
static |
Remove a (conditional) comment from the header.
string | $content | comment content |
|
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' => '...'));
|
static |
Remove a JavaScript SCRIPT element from the HTML HEAD section.
string | $source | URL of JS file or file in assets folder |
array | $attributes | Additional parameters for the script tag |
|
static |
Remove a style sheet LINK element from the HTML HEAD section.
string | $source | style sheet URL or file in assets folder |
array | $attributes | additional attributes for LINK element |
|
static |
Sets the id of the html body element. The given id is stripped of all non alpha-numeric characters (except for -).
String | $id | Id of the body element |
|
static |
Set the help keyword to the given string.
|
static |
Set the help URL in the help bar. Pass null to fall back to the help keyword.
|
static |
Set the names of the squeeze packages to use
... | a variable-length argument list containing the names of the packages |
|
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.
string | $path | path of navigation item for tabs or NULL |
|
static |
Set the page title to the given text.
string | $title | Page title |