CmsApp
in package
Simple singleton class that contains various functions and states representing the application.
Note: This class was named CmsObject before version 1.10
Tags
Table of Contents
Constants
- STATE_ADMIN_PAGE = 'admin_request'
- A constant indicating that the request is for a page in the CMSMS admin console
- STATE_INSTALL = 'install_request'
- A constant indicating that the request is taking place during the installation process
- STATE_PARSE_TEMPLATE = 'parse_page_template'
- A constant indicating that we are currently parsing page templates
- STATE_STYLESHEET = 'stylesheet_request'
- A constant indicating that the request is for a stylesheet
Properties
- $bookmarkoperations : mixed
Methods
- get_content_id() : mixed
- Get the ID of the current content page
- get_content_object() : mixed
- Get the current content page
- get_content_type() : mixed
- Retrieve the request content type (for frontend requests)
- get_installed_schema_version() : mixed
- Retrieve the installed schema version.
- get_instance() : mixed
- Retrieve the single app instancce.
- get_states() : array<string|int, string>
- Get a list of all current states.
- GetAvailableModules() : array<string|int, string>
- Get a list of all installed and available modules
- GetBookmarkOperations() : BookmarkOperations
- Get a handle to the CMS Admin BookmarkOperations singleton object.
- GetConfig() : cms_config
- Get a handle to the global CMS config.
- GetContentOperations() : ContentOperations
- Get a handle to the CMS ContentOperations singleton object.
- GetDb() : Connection
- Get a handle to the ADODB database object. You can then use this to perform all kinds of database operations.
- GetDbPrefix() : string
- Get the database prefix.
- GetGroupOperations() : GroupOperations
- Get a handle to the CMS GroupOperations object.
- GetHierarchyManager() : cms_content_tree
- Get a handle to the CMS HierarchyManager object.
- GetModuleInstance() : CMSModule
- Get a reference to an installed module instance.
- GetModuleOperations() : ModuleOperations
- Get a handle to the CMS ModuleOperations object.
- GetSmarty() : Smarty_CMS
- Get a handle to the CMS Smarty object.
- GetUserOperations() : UserOperations
- Get a handle to the CMS UserOperations singleton object.
- GetUserTagOperations() : UserTagOperations
- Get a handle to the CMS UserTagOperations object.
- is_cli() : bool
- A convenience method to test if the current request was executed via the CLI.
- is_frontend_request() : bool
- A convenience method to test if the current request is a frontend request.
- is_https_request() : bool
- A convenience method to test if the current request was over HTTPS.
- set_content_type() : mixed
- Set the request content type to a valid mime type.
- test_state() : bool
- Test if the current application state matches the requested value.
- __construct() : mixed
- Constructor
Constants
STATE_ADMIN_PAGE
A constant indicating that the request is for a page in the CMSMS admin console
public
mixed
STATE_ADMIN_PAGE
= 'admin_request'
STATE_INSTALL
A constant indicating that the request is taking place during the installation process
public
mixed
STATE_INSTALL
= 'install_request'
STATE_PARSE_TEMPLATE
A constant indicating that we are currently parsing page templates
public
mixed
STATE_PARSE_TEMPLATE
= 'parse_page_template'
STATE_STYLESHEET
A constant indicating that the request is for a stylesheet
public
mixed
STATE_STYLESHEET
= 'stylesheet_request'
Properties
$bookmarkoperations
private
mixed
$bookmarkoperations
Methods
get_content_id()
Get the ID of the current content page
public
get_content_id() : mixed
Tags
get_content_object()
Get the current content page
public
get_content_object() : mixed
Tags
get_content_type()
Retrieve the request content type (for frontend requests)
public
get_content_type() : mixed
If no content type is explicity set, text/html is assumed.
Tags
get_installed_schema_version()
Retrieve the installed schema version.
public
get_installed_schema_version() : mixed
Tags
get_instance()
Retrieve the single app instancce.
public
static get_instance() : mixed
Tags
get_states()
Get a list of all current states.
public
get_states() : array<string|int, string>
Tags
Return values
array<string|int, string> —Array of state strings, or null.
GetAvailableModules()
Get a list of all installed and available modules
public
GetAvailableModules() : array<string|int, string>
This method will return an array of module names that are installed, loaded and ready for use. suotable for iteration with GetModuleInstance
Tags
Return values
array<string|int, string>GetBookmarkOperations()
Get a handle to the CMS Admin BookmarkOperations singleton object.
public
GetBookmarkOperations() : BookmarkOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
BookmarkOperations —handle to the BookmarkOperations object, useful only in the admin
GetConfig()
Get a handle to the global CMS config.
public
GetConfig() : cms_config
This object contains global paths and settings that do not belong in the database.
Tags
Return values
cms_config —The configuration object.
GetContentOperations()
Get a handle to the CMS ContentOperations singleton object.
public
GetContentOperations() : ContentOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
ContentOperations —handle to the ContentOperations object
GetDb()
Get a handle to the ADODB database object. You can then use this to perform all kinds of database operations.
public
final GetDb() : Connection
Tags
Return values
Connection —a handle to the ADODB database object
GetDbPrefix()
Get the database prefix.
public
GetDbPrefix() : string
Return values
stringGetGroupOperations()
Get a handle to the CMS GroupOperations object.
public
GetGroupOperations() : GroupOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
GroupOperations —handle to the GroupOperations object
GetHierarchyManager()
Get a handle to the CMS HierarchyManager object.
public
GetHierarchyManager() : cms_content_tree
If it does not yet exist, this method will instantiate it.
Tags
Return values
cms_content_tree —HierarchyManager handle to the HierarchyManager object
GetModuleInstance()
Get a reference to an installed module instance.
public
GetModuleInstance(string $module_name[, string $version = '' ]) : CMSModule
This method will return a reference to the module object specified if it is installed, and available. Optionally, a version check can be performed to test if the version of the requeted module matches that specified.
Parameters
- $module_name : string
-
The module name.
- $version : string = ''
-
(optional) version number for a check.
Tags
Return values
CMSModule —Reference to the module object, or null.
GetModuleOperations()
Get a handle to the CMS ModuleOperations object.
public
GetModuleOperations() : ModuleOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
ModuleOperations —handle to the ModuleOperations object
GetSmarty()
Get a handle to the CMS Smarty object.
public
GetSmarty() : Smarty_CMS
If it does not yet exist, this method will instantiate it.
Tags
Return values
Smarty_CMS —handle to the Smarty object
GetUserOperations()
Get a handle to the CMS UserOperations singleton object.
public
GetUserOperations() : UserOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
UserOperations —handle to the UserOperations object
GetUserTagOperations()
Get a handle to the CMS UserTagOperations object.
public
GetUserTagOperations() : UserTagOperations
If it does not yet exist, this method will instantiate it.
Tags
Return values
UserTagOperations —handle to the UserTagOperations object
is_cli()
A convenience method to test if the current request was executed via the CLI.
public
is_cli() : bool
Tags
Return values
boolis_frontend_request()
A convenience method to test if the current request is a frontend request.
public
is_frontend_request() : bool
Tags
Return values
boolis_https_request()
A convenience method to test if the current request was over HTTPS.
public
is_https_request() : bool
Tags
Return values
boolset_content_type()
Set the request content type to a valid mime type.
public
set_content_type([string $mime_type = '' ]) : mixed
Parameters
- $mime_type : string = ''
Tags
test_state()
Test if the current application state matches the requested value.
public
test_state(string $state) : bool
This method will throw an exception if invalid data is passed in.
Parameters
- $state : string
-
A valid state name (see the state list above). It is recommended that the class constants be used.
Tags
Return values
bool__construct()
Constructor
protected
__construct() : mixed