CmsAdminThemeBase
in package
Base class for CMSMS Admin themes.
This is an abstract class that is used for building CMSMS Admin Themes. This is also a singleton object.
Tags
Table of Contents
Properties
- $subtitle : string
- $themeName : string
- $title : string
- $userid : int
Methods
- add_footertext() : mixed
- Add text to the footer of the output, immediately before the </body> tag.
- add_headtext() : mixed
- Add text to the head section of the output
- add_notification() : mixed
- A public function to add a notification for display in the theme.
- AddNotification() : mixed
- A public function to add a notification for display in the theme.
- BackUrl() : mixed
- BackUrl "Back" Url - link to the next-to-last item in the breadcrumbs for the back button.
- DisplayImage() : mixed
- DisplayImage will display the themed version of an image (if it exists),
- do_footer() : string
- An abstract function to output the themes footer html This function may not display anything, but may store data for use in the postprocess mechanism it should store, or output all of the information required for the head section of the page, and all admin navigation etc. Many admin themes may not do anything here.
- do_header() : string
- An abstract function to output the header html This function may not display anything, but may store data for use in the postprocess mechanism it should store, or output all of the information required for the head section of the page, and all admin navigation etc. Many admin themes may not do anything here.
- do_login() : string
- An abstract function for processing the login form.
- do_toppage() : string
- An abstract function to output the content for a top level navigation page This method is called when the user has browsed to the root of the admin site, or to any top level navigation item
- EndTab() : string
- Output a string to indicate the end of the output for a specific tab.
- EndTabContent() : string
- Output a string to indicate the end of XHTML areas for tabs.
- EndTabHeaders() : string
- Output a string to stop the output of headers and close the necessary XHTML div.
- get_active_title() : string
- Return the title of the active item.
- get_bookmarks() : array<string|int, mixed>
- Return the list of bookmarks
- get_breadcrumbs() : array<string|int, mixed>
- Return list of breadcrumbs
- get_footertext() : string
- Get text that needs to be injected into the footer section of the output.
- get_headtext() : string
- Get text that needs to be injected into the head section of the output.
- get_navigation_tree() : array<string|int, mixed>
- Retrieve the admin navigation tree
- get_notifications() : array<string|int, mixed>
- Retrieve the current list of notifications.
- get_value() : mixed
- Return attached data
- GetAvailableThemes() : array<string|int, mixed>
- Retrieve a list of the available admin themes.
- GetDefaultTheme() : mixed
- A function to return the name of the default admin theme.
- GetThemeObject() : CmsAdminThemeBase
- A function to retrieve the global admin theme object.
- HasDisplayableChildren() : bool
- HasDisplayableChildren This method returns a boolean, based upon whether the section in question has displayable children.
- postprocess() : string
- An abstract function for processing the content area of the page.
- set_action_module() : mixed
- Set the current action module
- set_value() : mixed
- Attach some data to the admin theme.
- SetSubTitle() : mixed
- Set the page subtitle.
- SetTabHeader() : string
- Set a specific tab header.
- SetTitle() : mixed
- Set the page title.
- ShowErrors() : mixed
- Abstract function for showing errors in the admin theme.
- ShowHeader() : mixed
- Abstract method for showing a header in the content area of a theme This is usually an advanced function with some special behaviour based on the module_help_type
- ShowMessage() : mixed
- Abstrct function for showing messages in the admin theme.
- StartTab() : string
- Output a string to indicate the start of the output for a specific tab
- StartTabContent() : string
- Output a string to indicate the start of XHTML areas for tabs.
- StartTabHeaders() : string
- Output a string suitable for staring tab headers i.e: echo $this->StartTabHeaders();
- find_menuitem_by_title() : string
- A function to return the name (key) of a menu item given it's title returns the first match.
- get_action_module() : string
- Determine the module name (if any) associated with the current request.
- get_admin_navigation() : array<string|int, mixed>
- A function to return the admin navigation This function returns a doubly linked list of arrays representing the admin navigation
- get_module_help_url() : mixed
- Get the help URL for a module.
- HasPerm() : bool
- HasPerm
Properties
$subtitle read-only
public
string
$subtitle
The current page subtitle
$themeName read-only
public
string
$themeName
Return the theme name
$title read-only
public
string
$title
The current page title
$userid read-only
public
int
$userid
Return the current logged in userid (deprecated)
Methods
add_footertext()
Add text to the footer of the output, immediately before the </body> tag.
public
add_footertext(string $txt) : mixed
Parameters
- $txt : string
-
The text to add to the end of the output.
Tags
add_headtext()
Add text to the head section of the output
public
add_headtext(string $txt) : mixed
The CMSMS core code calls this method to add text and javascript to output in the head section required for various functionality.
Parameters
- $txt : string
-
The text to add to the head section.
Tags
add_notification()
A public function to add a notification for display in the theme.
public
add_notification(CmsAdminThemeNotification &$notification) : mixed
Parameters
- $notification : CmsAdminThemeNotification
-
A reference to the new notification
AddNotification()
A public function to add a notification for display in the theme.
public
AddNotification(int $priority, string $module, string $html) : mixed
This is simply a compatibility wrapper around the add_notification method.
Parameters
- $priority : int
-
priority level between 1 and 3
- $module : string
-
The module name.
- $html : string
-
The contents of the notification
BackUrl()
BackUrl "Back" Url - link to the next-to-last item in the breadcrumbs for the back button.
public
BackUrl() : mixed
DisplayImage()
DisplayImage will display the themed version of an image (if it exists),
public
DisplayImage(string $imageName[, string $alt = '' ][, int $width = '' ][, int $height = '' ][, string $class = '' ]) : mixed
Parameters
- $imageName : string
-
name of image
- $alt : string = ''
-
alt text
- $width : int = ''
-
width
- $height : int = ''
-
height
- $class : string = ''
-
class
do_footer()
An abstract function to output the themes footer html This function may not display anything, but may store data for use in the postprocess mechanism it should store, or output all of the information required for the head section of the page, and all admin navigation etc. Many admin themes may not do anything here.
public
abstract do_footer() : string
Return values
string —html contents.
do_header()
An abstract function to output the header html This function may not display anything, but may store data for use in the postprocess mechanism it should store, or output all of the information required for the head section of the page, and all admin navigation etc. Many admin themes may not do anything here.
public
abstract do_header() : string
Return values
string —html contents.
do_login()
An abstract function for processing the login form.
public
abstract do_login(array<string|int, mixed> $params) : string
Parameters
- $params : array<string|int, mixed>
Return values
string —html contents for the login page.
do_toppage()
An abstract function to output the content for a top level navigation page This method is called when the user has browsed to the root of the admin site, or to any top level navigation item
public
abstract do_toppage(string $section_name) : string
Parameters
- $section_name : string
-
The section name. An empty string indicates that a navigation of all top level items should be created.
Return values
string —html contents.
EndTab()
Output a string to indicate the end of the output for a specific tab.
public
final EndTab() : string
Tags
Return values
stringEndTabContent()
Output a string to indicate the end of XHTML areas for tabs.
public
final EndTabContent() : string
Tags
Return values
stringEndTabHeaders()
Output a string to stop the output of headers and close the necessary XHTML div.
public
final EndTabHeaders() : string
Tags
Return values
stringget_active_title()
Return the title of the active item.
public
get_active_title() : string
Return values
stringget_bookmarks()
Return the list of bookmarks
public
get_bookmarks([bool $pure = FALSE ]) : array<string|int, mixed>
Parameters
- $pure : bool = FALSE
-
if False the shortcuts for adding and managing bookmarks are added to the list.
Return values
array<string|int, mixed> —Array of Bookmark objects
get_breadcrumbs()
Return list of breadcrumbs
public
get_breadcrumbs() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of menu nodes representing the breadcrumb trail.
get_footertext()
Get text that needs to be injected into the footer section of the output.
public
get_footertext() : string
This method is typically called by the admin theme itself to get the text to render.
Tags
Return values
stringget_headtext()
Get text that needs to be injected into the head section of the output.
public
get_headtext() : string
This method is typically called by the admin theme itself to get the text to render.
Tags
Return values
stringget_navigation_tree()
Retrieve the admin navigation tree
public
get_navigation_tree([string $parent = -1 ][, int $maxdepth = -1 ]) : array<string|int, mixed>
Parameters
- $parent : string = -1
-
Indicates the parent to start at. use a value of -1 to indicate the top node.
- $maxdepth : int = -1
-
The maximum depth of the tree. -1 indicates no maximum depth
Tags
Return values
array<string|int, mixed> —A nested array of menu nodes. The children member represents the nesting.
get_notifications()
Retrieve the current list of notifications.
public
get_notifications() : array<string|int, mixed>
Return values
array<string|int, mixed> —Array of CmsAdminThemeNotification objects
get_value()
Return attached data
public
get_value(string $key) : mixed
Parameters
- $key : string
Tags
GetAvailableThemes()
Retrieve a list of the available admin themes.
public
static GetAvailableThemes() : array<string|int, mixed>
Return values
array<string|int, mixed> —A hash of strings.
GetDefaultTheme()
A function to return the name of the default admin theme.
public
static GetDefaultTheme() : mixed
Tags
GetThemeObject()
A function to retrieve the global admin theme object.
public
static GetThemeObject([string $name = '' ]) : CmsAdminThemeBase
This method will create the admin theme object if has not yet been created. It will read the cms preferences and cross reference with available themes.
Parameters
- $name : string = ''
-
optional theme name.
Return values
CmsAdminThemeBase —Reference to the initialized admin theme.
HasDisplayableChildren()
HasDisplayableChildren This method returns a boolean, based upon whether the section in question has displayable children.
public
HasDisplayableChildren(string $section) : bool
Parameters
- $section : string
-
section to test
Return values
boolpostprocess()
An abstract function for processing the content area of the page.
public
abstract postprocess(string $html) : string
Many admin themes will do most of their work in this method (passing the html contents through a smarty template etc).
Parameters
- $html : string
-
HTML contents
Return values
string —the HTML contents of the entire page.
set_action_module()
Set the current action module
public
set_action_module(string $module_name) : mixed
Parameters
- $module_name : string
-
the module name.
Tags
set_value()
Attach some data to the admin theme.
public
set_value(string $key, mixed $value) : mixed
Parameters
- $key : string
- $value : mixed
Tags
SetSubTitle()
Set the page subtitle.
public
SetSubTitle(string $str) : mixed
This is used in the admin to set the title for the page, and for the visible page header. Note: if no title is specified, the theme will try to calculate one automatically.
Parameters
- $str : string
-
The page subtitle.
Tags
SetTabHeader()
Set a specific tab header.
public
final SetTabHeader(string $tabid, string $title[, bool $active = false ]) : string
i.e: echo $this->SetTabHeader('preferences',$this->Lang('preferences'));
Parameters
- $tabid : string
-
The tab id
- $title : string
-
The tab title
- $active : bool = false
-
A flag indicating wether this tab is active.
Tags
Return values
stringSetTitle()
Set the page title.
public
SetTitle(string $str) : mixed
This is used in the admin to set the title for the page, and for the visible page header. Note: if no title is specified, the theme will try to calculate one automatically.
Parameters
- $str : string
-
The page title.
Tags
ShowErrors()
Abstract function for showing errors in the admin theme.
public
abstract ShowErrors(mixed $errors[, string $get_var = '' ]) : mixed
Parameters
- $errors : mixed
-
The errors, either a string, or an array of strings
- $get_var : string = ''
-
An optional get variable name that can contain an error string key. If specified, errors is ignored.
Tags
ShowHeader()
Abstract method for showing a header in the content area of a theme This is usually an advanced function with some special behaviour based on the module_help_type
public
abstract ShowHeader(string $title_name[, array<string|int, mixed> $extra_lang_params = array() ][, string $link_text = '' ][, mixed $module_help_type = FALSE ]) : mixed
Parameters
- $title_name : string
-
The name to show on the header. This will not be passed through the lang process if module_help_type is not FALSE.
- $extra_lang_params : array<string|int, mixed> = array()
-
Extra language parameters to pass to the title_name. Ignored if module_help_type is not FALSE
- $link_text : string = ''
-
Text to show in the module help link (depends on the module_help_type param)
- $module_help_type : mixed = FALSE
-
Flag for how to display module help types. Possible values are TRUE to display a simple link, FALSE for no help, and 'both' for both types of links
Tags
ShowMessage()
Abstrct function for showing messages in the admin theme.
public
abstract ShowMessage(mixed $message[, string $get_var = '' ]) : mixed
Parameters
- $message : mixed
-
The message, either a string, or an array of stri9ngs
- $get_var : string = ''
-
An optional get variable name that can contain an error string key. If specified, message param is ignored.
Tags
StartTab()
Output a string to indicate the start of the output for a specific tab
public
final StartTab(string $tabid[, array<string|int, mixed> $params = array() ]) : string
Parameters
- $tabid : string
-
The tabid (see SetTabHeader)
- $params : array<string|int, mixed> = array()
-
Parameters
Tags
Return values
stringStartTabContent()
Output a string to indicate the start of XHTML areas for tabs.
public
final StartTabContent() : string
Tags
Return values
stringStartTabHeaders()
Output a string suitable for staring tab headers i.e: echo $this->StartTabHeaders();
public
final StartTabHeaders() : string
Tags
Return values
stringfind_menuitem_by_title()
A function to return the name (key) of a menu item given it's title returns the first match.
protected
find_menuitem_by_title(string $title) : string
Parameters
- $title : string
-
The title to search for
Tags
Return values
string —The matching key, or null
get_action_module()
Determine the module name (if any) associated with the current request.
protected
get_action_module() : string
Tags
Return values
string —the module name for the current request, if any.
get_admin_navigation()
A function to return the admin navigation This function returns a doubly linked list of arrays representing the admin navigation
protected
get_admin_navigation() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —Doubly linked list of menu nodes. The parent, and children members of each node represent the links. a parent value of -1 represents a top level node.
get_module_help_url()
Get the help URL for a module.
protected
get_module_help_url([string $module_name = null ]) : mixed
Parameters
- $module_name : string = null
Tags
HasPerm()
HasPerm
protected
HasPerm(string $permission) : bool
Check if the user has one of the aggregate permissions
Parameters
- $permission : string
-
the permission to check.