CMS Made Simple API

CmsApp
in package

FinalYes

Simple singleton class that contains various functions and states representing the application.

Note: This class was named CmsObject before version 1.10

Tags
license

GPL

since
0.5

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

Methods

get_content_id()

Get the ID of the current content page

public get_content_id() : mixed
Tags
since
2.0

get_content_object()

Get the current content page

public get_content_object() : mixed
Tags
since
2.0

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
since
2.0

get_installed_schema_version()

Retrieve the installed schema version.

public get_installed_schema_version() : mixed
Tags
since
2.0

get_instance()

Retrieve the single app instancce.

public static get_instance() : mixed
Tags
since
1.10

get_states()

Get a list of all current states.

public get_states() : array<string|int, string>
Tags
since
1.11.2
author

Robert Campbell

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
see
CmsApp::GetModuleInstance()
since
1.9
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
final
see
BookmarkOperations
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
final
Return values
cms_config

The configuration object.

GetDbPrefix()

Get the database prefix.

public GetDbPrefix() : string
Return values
string

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
final
see
HierarchyManager
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
since
1.9
Return values
CMSModule

Reference to the module object, or null.

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
final
see
Smarty_CMS
link
http://www.smarty.net/manual/en/
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
final
see
UserOperations
Return values
UserOperations

handle to the UserOperations object

is_cli()

A convenience method to test if the current request was executed via the CLI.

public is_cli() : bool
Tags
since
2.2.9
author

Robert Campbell

Return values
bool

is_frontend_request()

A convenience method to test if the current request is a frontend request.

public is_frontend_request() : bool
Tags
since
1.11.2
author

Robert Campbell

Return values
bool

is_https_request()

A convenience method to test if the current request was over HTTPS.

public is_https_request() : bool
Tags
since
1.11.12
author

Robert Campbell

Return values
bool

set_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
since
2.0

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
throws
CmsInvalidDataException
author

Robert Campbell

since
1.11.2
Return values
bool

__construct()

Constructor

protected __construct() : mixed

        
On this page

Search results