CmsApp View code

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

Note: This class was named CmsObject before version 1.10

package

CMS

license

GPL

since 0.5

Methods

__construct() 

Constructor

get_instance() 

Retrieve the single app instancce.

static
get_installed_schema_version() 

Retrieve the installed schema version.

get_content_type() 

Retrieve the request content type (for frontend requests)

If no content type is explicity set, text/html is assumed.

set_content_type(string $mime_type = '') 

Set the request content type to a valid mime type.

Arguments

string $mime_type

get_content_object() 

Get the current content page

get_content_id() 

Get the ID of the current content page

GetAvailableModules() : array<mixed,string>

Get a list of all installed and available modules

This method will return an array of module names that are installed, loaded and ready for use. suotable for iteration with GetModuleInstance

Response

array<mixed,string>

GetModuleInstance(string $module_name, string $version = '') : \CMSModule

Get a reference to an installed module instance.

deprecated

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.

Arguments

string $module_name

The module name.

string $version

(optional) version number for a check.

Response

\CMSModule

Reference to the module object, or null.

GetDb() : \ADOConnection

Get a handle to the ADODB database object. You can then use this to perform all kinds of database operations.

final

Response

\ADOConnection

a handle to the ADODB database object

GetDbPrefix() : string

Get the database prefix.

Response

string

GetConfig() : \cms_config

Get a handle to the global CMS config.

This object contains global paths and settings that do not belong in the database.

Response

\cms_config

The configuration object.

GetModuleOperations() : \ModuleOperations

Get a handle to the CMS ModuleOperations object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\ModuleOperations

handle to the ModuleOperations object

GetUserOperations() : \UserOperations

Get a handle to the CMS UserOperations singleton object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\UserOperations

handle to the UserOperations object

GetContentOperations() : \ContentOperations

Get a handle to the CMS ContentOperations singleton object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\ContentOperations

handle to the ContentOperations object

GetBookmarkOperations() : \BookmarkOperations

Get a handle to the CMS Admin BookmarkOperations singleton object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\BookmarkOperations

handle to the BookmarkOperations object, useful only in the admin

GetGroupOperations() : \GroupOperations

Get a handle to the CMS GroupOperations object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\GroupOperations

handle to the GroupOperations object

GetUserTagOperations() : \UserTagOperations

Get a handle to the CMS UserTagOperations object.

deprecated

If it does not yet exist, this method will instantiate it.

Response

\UserTagOperations

handle to the UserTagOperations object

GetSmarty() : \Smarty_CMS

Get a handle to the CMS Smarty object.

If it does not yet exist, this method will instantiate it.

Response

\Smarty_CMS

handle to the Smarty object

GetHierarchyManager() : \HierarchyManager

Get a handle to the CMS HierarchyManager object.

If it does not yet exist, this method will instantiate it.

Response

\HierarchyManager

handle to the HierarchyManager object

test_state(string $state) : boolean

Test if the current application state matches the requested value.

This method will throw an exception if invalid data is passed in.

Arguments

string $state

A valid state name (see the state list above). It is recommended that the class constants be used.

Response

boolean

get_states() : array<mixed,\stringp>

Get a list of all current states.

Response

array<mixed,\stringp>

Array of state strings, or null.

is_frontend_request() : boolean

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

Response

boolean

is_https_request() : boolean

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

Response

boolean

Constants

A constant indicating that the request is for a page in the CMSMS admin console

STATE_ADMIN_PAGE

A constant indicating that the request is taking place during the installation process

STATE_INSTALL

A constant indicating that the request is for a stylesheet

STATE_STYLESHEET

A constant indicating that we are currently parsing page templates

STATE_PARSE_TEMPLATE