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 |
__construct()
get_instance()
get_installed_schema_version()
get_content_type()
If no content type is explicity set, text/html is assumed.
set_content_type(string $mime_type = null)
string $mime_typedisable_template_processing() : void
This function controls whether the page template will be processed at all. It must be called early enough in the content generation process.
Ideally this method can be called from within a module action that is called from within the default content block when content_processing is set to 2 (the default) in the config.php
template_processing_allowed() : boolean
boolean
get_content_object() : \ContentBase|null
Will return the current content object for frontend requests. For admin requests, this method returns null.
\ContentBase|null
get_content_id() : integer|null
integer|null
GetAvailableModules() : array<mixed,string>
This method will return an array of module names that are installed, loaded and ready for use. suotable for iteration with GetModuleInstance
array<mixed,string>
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.
string $module_nameThe module name.
string $version(optional) version number for a check.
Reference to the module object, or null.
GetDb() : \ADOConnection
\ADOConnection
a handle to the ADODB database object
GetDbPrefix() : string
string
GetConfig() : \cms_config
This object contains global paths and settings that do not belong in the database.
The configuration object.
GetModuleOperations() : \ModuleOperations
If it does not yet exist, this method will instantiate it.
handle to the ModuleOperations object
GetSimplePluginOperations() : \CMSMS\simple_plugin_operations
GetUserOperations() : \UserOperations
If it does not yet exist, this method will instantiate it.
handle to the UserOperations object
GetContentOperations() : \ContentOperations
If it does not yet exist, this method will instantiate it.
handle to the ContentOperations object
GetBookmarkOperations() : \BookmarkOperations
If it does not yet exist, this method will instantiate it.
handle to the BookmarkOperations object, useful only in the admin
GetGroupOperations() : \GroupOperations
If it does not yet exist, this method will instantiate it.
handle to the GroupOperations object
GetUserTagOperations() : \UserTagOperations
If it does not yet exist, this method will instantiate it.
handle to the UserTagOperations object
GetSmarty() : mixed
If it does not yet exist, this method will instantiate it.
mixed
Smarty_CMS handle to the Smarty object. Null if called from the phar installer
GetHierarchyManager() : \HierarchyManager
If it does not yet exist, this method will instantiate it.
\HierarchyManager
handle to the HierarchyManager object
get_hook_manager()
get_template_manager()
get_site_identifier() : string
string
create_new_mailer(boolean $exceptions = true) : \cms_mailer
boolean $exceptionsWhether or not the mailer should throw exceptions.
test_state(string $state) : boolean
This method will throw an exception if invalid data is passed in.
string $stateA valid state name (see the state list above). It is recommended that the class constants be used.
boolean
get_states() : array<mixed,\stringp>
array<mixed,\stringp>
Array of state strings, or null.
is_cli() : boolean
boolean
is_frontend_request() : boolean
boolean
is_https_request() : boolean
boolean
STATE_ADMIN_PAGE
STATE_INSTALL
STATE_STYLESHEET
STATE_PARSE_TEMPLATE
STATE_LOGIN_PAGE