cms_utils
in package
A Simple Static class providing various convenience utilities.
Tags
Table of Contents
Methods
- get_app_data() : mixed
- Get data that was stored elsewhere in the application.
- get_config() : cms_config
- A convenience function to return a handle to the global CMSMS config.
- get_current_alias() : string
- A convenience function to return the alias of the current page.
- get_current_content() : Content
- A convenience functon to return a reference to the current content object.
- get_current_pageid() : int
- A convenience function to return the page id of the current page
- get_db() : Connection
- A convenience function to return the current database instance.
- get_filepicker_module() : CMSModule
- A convenience method to get the currently selected filepicker module.
- get_module() : CmsModule
- A convenience function to return the object representing an installed module.
- get_real_ip() : mixed
- Attempt to retreive the IP address of the connected user.
- get_search_module() : CMSModule
- A convenience method to get the currently selected search module.
- get_smarty() : Smarty_CMS
- A convenience function to return a handle to the CMSMS Smarty object.
- get_syntax_highlighter_module() : CMSModule
- A convenient method to get the currently selected syntax highlighter.
- get_theme_object() : mixed
- Get a reference to the current theme object only returns a valid value when in an admin request.
- get_wysiwyg_module() : CMSModule
- A convenient method to get the object pointer to the appropriate wysiwyg module.
- module_available() : bool
- A convenience function to return an indication if a module is availalbe.
- set_app_data() : mixed
- Set data for later use.
Methods
get_app_data()
Get data that was stored elsewhere in the application.
public
static get_app_data(string $key) : mixed
Parameters
- $key : string
-
The key to get.
Tags
Return values
mixed —The stored data, or null
get_config()
A convenience function to return a handle to the global CMSMS config.
public
static get_config() : cms_config
Tags
Return values
cms_config —The global configuration object.
get_current_alias()
A convenience function to return the alias of the current page.
public
static get_current_alias() : string
This function will always return NULL if called from an admin action
Tags
Return values
stringget_current_content()
A convenience functon to return a reference to the current content object.
public
static get_current_content() : Content
This function will always return NULL if called from an admin action
Tags
Return values
Content —The current content object, or null
get_current_pageid()
A convenience function to return the page id of the current page
public
static get_current_pageid() : int
This function will always return NULL if called from an admin action
Tags
Return values
intget_db()
A convenience function to return the current database instance.
public
static get_db() : Connection
Tags
Return values
Connectionget_filepicker_module()
A convenience method to get the currently selected filepicker module.
public
static get_filepicker_module() : CMSModule
Tags
Return values
CMSModuleget_module()
A convenience function to return the object representing an installed module.
public
static get_module(string $name[, string $version = '' ]) : CmsModule
If a version string is passed, a matching object will only be returned IF the installed version is greater than or equal to the supplied version.
Parameters
- $name : string
-
The module name
- $version : string = ''
-
An optional version string
Tags
Return values
CmsModule —The matching module object or null
get_real_ip()
Attempt to retreive the IP address of the connected user.
public
static get_real_ip() : mixed
This function attempts to compensate for proxy servers.
Tags
get_search_module()
A convenience method to get the currently selected search module.
public
static get_search_module() : CMSModule
Tags
Return values
CMSModuleget_smarty()
A convenience function to return a handle to the CMSMS Smarty object.
public
static get_smarty() : Smarty_CMS
Tags
Return values
Smarty_CMS —Handle to the Smarty object
get_syntax_highlighter_module()
A convenient method to get the currently selected syntax highlighter.
public
static get_syntax_highlighter_module() : CMSModule
This is a wrapper around a similar function in the ModuleOperations class.
Tags
Return values
CMSModuleget_theme_object()
Get a reference to the current theme object only returns a valid value when in an admin request.
public
static get_theme_object() : mixed
Tags
get_wysiwyg_module()
A convenient method to get the object pointer to the appropriate wysiwyg module.
public
static get_wysiwyg_module([string $module_name = '' ]) : CMSModule
This is a wrapper around a similar function in the ModuleOperations class.
This method will return the currently selected frontend wysiwyg for frontend requests (or null if none is selected) For admin requests this method will return the users currently selected wysiwyg module, or null.
Parameters
- $module_name : string = ''
-
The module name.
Tags
Return values
CMSModulemodule_available()
A convenience function to return an indication if a module is availalbe.
public
static module_available(string $name) : bool
Parameters
- $name : string
-
The module name
Tags
Return values
boolset_app_data()
Set data for later use.
public
static set_app_data(string $key, mixed $value) : mixed
This method is typically used to store data for later use by another part of the application. This data is not stored in the session, so it only exists for one request.
Parameters
- $key : string
-
The name of this data.
- $value : mixed
-
The data to store.