Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cGuiBackendHelpbox
  • cGuiFileOverview
  • cGuiFoldingRow
  • cGuiList
  • cGuiMenu
  • cGuiNavigation
  • cGuiNotification
  • cGuiObjectPager
  • cGuiPage
  • cGuiScrollList
  • cGuiSourceEditor
  • cGuiTableForm
  • cGuiTree
  • cPager
  • cTemplate
  • cTree
  • cTreeItem
  • NoteLink
  • NoteList
  • NoteListItem
  • NoteView
  • TODOLink
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class cGuiPage

Generic page GUI class.

Manages HTML pages and provides functions for rendering them.

Direct known subclasses

ArticleForumLeftBottom, ArticleForumRightBottom, cGuiFileOverview, cGuiSourceEditor, PifaLeftBottomPage, PifaRightBottomFormDataPage, PifaRightBottomFormExportPage, PifaRightBottomFormFieldsPage, PifaRightBottomFormImportPage, PifaRightBottomFormPage
Package: Core\GUI
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Mischa Holz
Located at classes/gui/class.page.php
Methods summary
public
# __construct( string $pageName, string $pluginName = '', string $subMenu = '' )

Constructor to create an instance of this class.

Constructor to create an instance of this class.

The constructor initializes the class and tries to get the encoding from the currently selected language.

It will also add every script in the form of /scripts/*.PAGENAME.js and every stylesheet in the form of /styles/*.PAGENAME.css to the page as well as /scripts/PAGENAME.js and /styles/PAGENAME.css.

Parameters

$pageName
string
$pageName The name of the page which will be used to load corresponding stylesheets, templates and scripts.
$pluginName
string
$pluginName [optional] The name of the plugin in which the site is run
$subMenu
string
$subMenu [optional] The number of the submenu which should be highlighted when this page is shown.
public
# addScript( string $script )

Adds a script to the website - path can be absolute, relative to the plugin scripts folder and relative to the CONTENIDO scripts folder.

Adds a script to the website - path can be absolute, relative to the plugin scripts folder and relative to the CONTENIDO scripts folder.

NOTE: This function will also add inline JavaScript in the form of "<script...". However this shouldn't be used.

If the page was constructed in a plugin and the plugin name was given in the constructor it will find the JS script in plugins/PLUGINNAME/scripts/ too.

Parameters

$script
string
$script The filename of the script. It has to reside in /scripts/ in order to be found.
public
# addStyle( string $stylesheet )

Adds a stylesheet to the website - path can be absolute, relative to the plugin stylesheets folder and relative to the CONTENIDO stylesheets folder.

Adds a stylesheet to the website - path can be absolute, relative to the plugin stylesheets folder and relative to the CONTENIDO stylesheets folder.

Parameters

$stylesheet
string
$stylesheet The filename of the stylesheet. It has to reside in /styles/ in order to be found.
public
# addMeta( array $meta )

Adds a meta tag to the website.

Adds a meta tag to the website.

Parameters

$meta
array
$meta Associative array with the meta tag attributes

Throws

cInvalidArgumentException
if an invalid attribute for the meta tag has been given
public
# addBodyClassName( string $className )

Adds class attribute value to the body tag.

Adds class attribute value to the body tag.

Parameters

$className
string
$className
public
# setSubnav( string $additional = '', string $aarea = '' )

Loads the subnavigation of the current area upon rendering.

Loads the subnavigation of the current area upon rendering.

Parameters

$additional
string
$additional [optional] Additional parameters the subnavigation might need. These have to look like "key=value&key2=value2..."
$aarea
string
$aarea [optional] The area of the subnavigation. If none is given the current area will be loaded.
public
# setReload( )

Adds the reload script for the left_bottom frame to the website.

Adds the reload script for the left_bottom frame to the website.

public
# reloadFrame( string $frameName, string|array $updatedParameters = null )

Adds JavaScript to the page to reload a certain frame.

Adds JavaScript to the page to reload a certain frame.

Parameters

$frameName
string
$frameName Name of the frame
$updatedParameters
string|array
$updatedParameters [optional] Either an array with keys that will be passed to Con.UtilUrl.replaceParams OR a string containing the new href of the frame.
public
# setMarkScript( string $item )

Sets the markscript.

Sets the markscript.

Parameters

$item
string
$item The number of the submenu which should be marked.
public
# setEncoding( string $encoding )

Sets the encoding of the website.

Sets the encoding of the website.

Parameters

$encoding
string
$encoding An encoding which should be valid to use in the meta tag
public
# set( string $type, string $key, string $value )

Applies a value to a key in the content template.

Applies a value to a key in the content template.

Parameters

$type
string
$type Either "s" or "d" for "static" or "dynamic" values
$key
string
$key The key which should be replaced
$value
string
$value The value which should replace the key

See

cTemplate::set()
public
# setPageBase( string $filename = '' )

Function to specify the file used to generate the page template.

Function to specify the file used to generate the page template.

Parameters

$filename
string
$filename [optional] the page base file
public
# next( )

Calls the next() method on the content template.

Calls the next() method on the content template.

See

cTemplate::next()
public
# abortRendering( )

After calling this the page will only display messages and not render the content template.

After calling this the page will only display messages and not render the content template.

NOTE: You still have to call render() to actually show any messages.

public
# displayCriticalError( string $msg )

Displays an error message and aborts rendering after that.

Displays an error message and aborts rendering after that.

NOTE: You still have to call render() to actually show any messages.

Parameters

$msg
string
$msg A message
public
# displayError( string $msg )

Displays an error but the rendering of the content template will continue.

Displays an error but the rendering of the content template will continue.

Parameters

$msg
string
$msg A message
public
# displayWarning( string $msg )

Displays a warning.

Displays a warning.

Parameters

$msg
string
$msg The warning
public
# displayInfo( string $msg )

Displays an info.

Displays an info.

Parameters

$msg
string
$msg The info message
public
# displayOk( string $msg )

Display a ok.

Display a ok.

Parameters

$msg
string
$msg The ok message
public
# setContent( array|object $objects )

Sets an array (or a single object) of cHTML objects which build up the site instead of a content template.

Sets an array (or a single object) of cHTML objects which build up the site instead of a content template.

NOTE: All these objects must have a render() method or else they won't be shown.

Parameters

$objects
array|object
$objects An array of objects
public
# appendContent( array|object $objects )

Appends all cHTML objects in an array (or a single object) which build up the site instead of a content template.

Appends all cHTML objects in an array (or a single object) which build up the site instead of a content template.

NOTE: All these objects must have a render() method or else they won't be shown.

Parameters

$objects
array|object
$objects An array of objects or a single object
public string|
# render( cTemplate|null $template = NULL, boolean $return = false )

Renders the page and either prints it or returns it.

Renders the page and either prints it or returns it.

Parameters

$template
cTemplate|null
$template [optional] If set, use this content template instead of the default one
$return
boolean
$return [optional] If true, the page will be returned instead of echoed

Returns

string|

Throws

cInvalidArgumentException
protected
# _renderMetaTags( )

Renders set meta tags and adds them to _pageTemplate property.

Renders set meta tags and adds them to _pageTemplate property.

protected
# _renderScripts( )

Renders set scripts and adds them to _pageTemplate property.

Renders set scripts and adds them to _pageTemplate property.

protected
# _renderStyles( )

Renders set styles and adds them to _pageTemplate property.

Renders set styles and adds them to _pageTemplate property.

protected string
# _renderContentMessages( )

Renders text for all available content messages and returns the assembled message string.

Renders text for all available content messages and returns the assembled message string.

Returns

string
protected string
# _renderObjects( )

Loops through all defined objects, calls their render function, collects the output of the objects and returns it back.

Loops through all defined objects, calls their render function, collects the output of the objects and returns it back.

Returns

string
protected string
# _renderTemplate( cTemplate $template )

Renders template of a page or of a plugin and returns the output back.

Renders template of a page or of a plugin and returns the output back.

Parameters

$template
cTemplate
$template

Returns

string

Throws

cInvalidArgumentException
protected string
# _getRealFilePathName( string $file )

Returns only the path and name of the given file.

Returns only the path and name of the given file.

Some JS or CSS file URLs may contain a query part, like "/path/to/file.js.php?contenido=12234" and this function returns only the path part "/path/to/file.js.php" of it.

Parameters

$file
string
$file

Returns

string
Properties summary
protected string $_pageName
#

The name of the page. This will be used to load the template, stylesheets and scripts.

The name of the page. This will be used to load the template, stylesheets and scripts.

protected string $_pluginName
#

The name of the plugin of the current webpage.

The name of the plugin of the current webpage.

protected cTemplate $_pageTemplate
#

The general page template.

The general page template.

protected string $_pageBase
#

The file used generate the page.

The file used generate the page.

protected cTemplate $_contentTemplate
#

The template for everything that is inside the body. This is usually template.PAGENAME.html.

The template for everything that is inside the body. This is usually template.PAGENAME.html.

protected array $_scripts
#

An array of script names (inside /scripts/) which will be included in the final page.

An array of script names (inside /scripts/) which will be included in the final page.

protected array $_styles
#

An array of stylesheets (inside /styles/) which will be included in the final page.

An array of stylesheets (inside /styles/) which will be included in the final page.

protected string $_subnav
#

The script to set the subnavigation. This will be included in the final page.

The script to set the subnavigation. This will be included in the final page.

protected string $_markScript
#

The script to markup the current submenu item. This will be included in the final page.

The script to markup the current submenu item. This will be included in the final page.

protected string $_error
#

An error message which will be used to display an error with the help of cGuiNotification.

An error message which will be used to display an error with the help of cGuiNotification.

protected string $_warning
#

A warning which will be used to display an error with the help of cGuiNotification.

A warning which will be used to display an error with the help of cGuiNotification.

protected string $_info
#

An info which will be used to display an error with the help of cGuiNotification.

An info which will be used to display an error with the help of cGuiNotification.

protected string $_ok
#

A ok which will be used to display an error with the help of cGuiNotification.

A ok which will be used to display an error with the help of cGuiNotification.

protected boolean $_abort
#

If true, just display the message and don't render the template.

If true, just display the message and don't render the template.

protected array $_objects
#

An array of cHTML objects which will be rendered instead of filling a template.

An array of cHTML objects which will be rendered instead of filling a template.

protected array $_metaTags
#

Array of arrays where each array contains information about a meta tag.

Array of arrays where each array contains information about a meta tag.

protected array $_bodyClassNames
#

Array of class attribute values for body tag.

Array of class attribute values for body tag.

protected string $_filesDirectory
#

Scripts and styles subfolder for cGuiPage objects.

Scripts and styles subfolder for cGuiPage objects.

protected boolean $_skipTemplateCheck false
#

Whether the template exist check should be skipped or not.

Whether the template exist check should be skipped or not.

CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0