Functions

audit

A convenience function in the root namespace to create a message using the current audit manager.

« More »

cms_notice

A convenience function in the root namespace to create a notice message using the current audit manager.

« More »

cms_warning

A convenience function in the root namespace to create a warning message using the current audit manager.

« More »

cms_error

A convenience function in the root namespace to create an error message using the current audit manager.

« More »

NewDataDictionary

A method to create a new data dictionary object

« More »

cmsms

Return the global cmsms() object.

« More »

cms_db_prefix

Returns the currently configured database prefix.

« More »

get_preference

Retrieve the value of the named preference for the given userid.

« More »

set_preference

Sets the given perference for the given userid with the given value.

« More »

get_userid

Gets the userid of the currently logged in admin user.

If an effective uid has been set in the session, AND the primary user is a member of the admin group then allow emulating that effective uid.
« More »

get_username

Gets the username of the currently logged in admin user.

If an effective username has been set in the session, AND the primary user is a member of the admin group then return the effective username.
« More »

check_login

Checks to see if the user is logged in and the request has the proper key. If not, redirects the browser to the admin login.

Note: Because this method validates that the secret key is in the URL and matches the one that is in the session this method should only be called from admin actions.
« More »

check_permission

Checks to see that the given userid has access to the given permission.

Members of the admin group have all permissions.
« More »

get_site_preference

Gets the given site prefernce

« More »

is_sitedown

A convenience function to test if the site is marked as down according to the config panel.

This method includes handling the preference that indicates that site-down behaviour should be disabled for certain IP address ranges.
« More »

lang_by_realm

Retrieve a translation for a specific string in a specific realm.

Called with the realm first, followed by the key, this method will attempt to load the specific realm data if necessary before doing translation. This method accepts a variable number of arguments. Any arguments after the realm and the key are passed to the key via vsprintf i.e: lang_by_realm('tasks','my_string');
« More »

lang

Return a translated string for the default 'admin' realm.

This function is merely a wrapper around the lang_by_realm function that assumes the realm is 'admin'. This method will throw a notice if it is called from a frontend request i.e: lang('title');
« More »

redirect

Redirects to relative URL on the current site.

If headers have not been sent this method will use header based redirection. Otherwise javascript redirection will be used.
« More »

redirect_to_alias

Given a page ID or an alias, redirect to it.

Retrieves the URL of the specified page, and performs a redirect
« More »

microtime_diff

Calculate the difference in seconds between two microtime() values.

« More »

cms_join_path

Joins a path together using platform specific directory separators.

Taken from: http://www.php.net/manual/en/ref.dir.php This method should NOT be used for building URLS. This method accepts a variable number of string arguments. i.e: $out = cms_join_path($dir1,$dir2,$dir3,$filename); or $out = cms_join_path($dir1,$dir2,$filename);
« More »

cms_is_uri

Test if a string provided is a URI

« More »

cms_fix_path

Convert a string to use platform specific separators IF it is not a uri.

« More »

cms_relative_path

Return the relative portion of a path

« More »

cms_htmlentities

Perform HTML entity conversion on a string.

« More »

debug_bt_to_log

A function to output a backtrace into the generated log file.

« More »

debug_bt

A function to generate a backtrace in a readable format.

This function does not return but echoes output.
« More »

debug_display

Debug function to display $var nicely in html.

« More »

debug_output

Display $var nicely only if $config["debug"] is set.

« More »

debug_to_log

Debug function to output debug information about a variable in a formatted matter to a debug file.

« More »

debug_buffer

Display $var nicely to the CmsApp::get_instance()->errors array if $config['debug'] is set.

« More »

get_parameter_value

Retrieve the $value from the $parameters array checking for $parameters[$value] and $params[$id.$value].

Returns $default if $value is not in $params array. Note: This function will also trim() string values.
« More »

is_directory_writable

Check the permissions of a directory recursively to make sure that we have write permission to all files.

« More »

get_recursive_file_list

Return an array containing a list of files in a directory performs a recursive search.

« More »

recursive_delete

A function to recursively delete all files and folders in a directory; synonymous with rm -r.

« More »

chmod_r

A function to recursively chmod all files and folders in a directory.

« More »

startswith

A convenience function to test wether one string starts with another.

i.e: startswith('The Quick Brown Fox','The');
« More »

endswith

Similar to the startswith method, this function tests with string A ends with string B.

i.e: endswith('The Quick Brown Fox','Fox');
« More »

munge_string_to_url

Convert a human readable string into something that is suitable for use in URLS.

« More »

cleanString

Clean an input string Will encode unsafe characters as entities.

« More »

ini_get_boolean

A convenience function to return a bool variable given a php ini key that represents a bool.

« More »

stack_trace

Another convenience function to output a human readable function stack trace.

This method uses echo.
« More »

cms_move_uploaded_file

A wrapper around move_uploaded_file that attempts to ensure permissions on uploaded files are set correctly.

« More »

cms_ipmatches

A function to test wether an IP address matches a list of expressions.

Credits to J.Adams <jna@retins.net> Expressions can be of the form xxx.xxx.xxx.xxx (exact) xxx.xxx.xxx.[yyy-zzz] (range) xxx.xxx.xxx.xxx/nn (nn = # bits, cisco style -- i.e. /24 = class C)
« More »

is_email

Test if the string provided is a valid email address.

« More »

cms_to_bool

A simple function to convert a string to a bool.

accepts, 'y','yes','true',1 as TRUE (case insensitive) all other values represent FALSE.
« More »

is_base64

Test if a string is a base64 encoded string

« More »

cms_create_guid

Create a unique GUID.

« More »

Constants

CMS_ADODB_DT

A constant to assist with date and time flags in the data dictionary.

CLEAN_INT

Indicates that the incoming parameter is expected to be an integer.

This is used when cleaning input parameters for a module action or module call.

CLEAN_FLOAT

Indicates that the incoming parameter is expected to be a float This is used when cleaning input parameters for a module action or module call.

CLEAN_NONE

Indicates that the incoming parameter is not to be cleaned.

This is used when cleaning input parameters for a module action or module call.

CLEAN_STRING

Indicates that the incoming parameter is a string.

This is used when cleaning input parameters for a module action or module call.

CLEAN_REGEXP

Indicates that the incoming parameter is a regular expression.

This is used when cleaning input parameters for a module action or module call.

CLEAN_FILE

Indicates that the incoming parameter is an uploaded file.

This is used when cleaning input parameters for a module action or module call.

TMP_CACHE_LOCATION

A constant to indicate the location where private cachable files can be written.

PUBLIC_CACHE_LOCATION

A constant to indicate where public (browsable) cachable files can be written.

PUBLIC_CACHE_URL

A constant to indicate the public address for cachable files.

TMP_TEMPLATES_C_LOCATION

A constant containing the smarty template compile directory.

CMS_DEBUG

A constant indicating if CMSMS is in debug mode.

CMS_ROOT_PATH

A constant containing the directory where CMSMS is installed.

CMS_ASSETS_PATH

A constant containing the directory where CMSMS third party assets are stored.

CMS_ROOT_URL

A constant containing the CMSMS root url.

If the root_url variable is not specified in the config file, then CMSMS will attempt to calculate one.

CMS_UPLOADS_URL

A constant containing the CMSMS uploads url.

If the uploads_url is not specified in the config file, then CMSMS will calculate one from the root url.

CMS_ASSETS_URL

A constant containing the CMSMS assets url.

If the assets_url is not specified in the config file, then CMSMS will calculate one from the root url and the assets_dir setting.

CMS_DB_PREFIX

Classes, interfaces and traits

CronJobTrait

A Trait to define functionality for recurring cron jobs.

IAuditManager

An abstract interface for classes that provide auditing.

« More »

FilePickerInterface

Define an interface for modules that provide filepicker functionality.

« More »

CmsRegularTask

An interface to define how tasks should work.

« More »

CronJobInterface

A simple interface to define the functions and constants needed for a cron job.

« More »

ICookieManager

An interface to describe a CMSMS cookie manager.

« More »

HttpErrorLogAuditor

A basic error log auditor that uses PHP's error log to output formatted messages.

« More »

AuditManager

A manager contains links to the standard auditor and an optional audit handler.

so that CMSMS can output it's messages somewhere.
« More »

CmsPermission

Simple class for dealing with a permission.

« More »

UserTagOperations

A compatibility class to manage simple plugins.

Formerly 'UserDefinedTags' were stored in the database. In CMSMS 2.3+ this functionality was replaced with simple plugins. This class provides backwards compatibility. This class will be removed from CMSMS at some point in the future.
« More »

cms_content_tree

A tree class that allows backward compatibility (somewhat) to the old Tree class used in CMSMS versions prior to 1.9, and provides content retrieval abilities.

« More »

CmsLayoutTemplateCategory

A class representing a template category.

Templates can be optionally organized into categories, this class manages the category itself.
« More »

CmsDbQueryBase

An abstract class for building queries and managing results.

This class is capable of managing a resultset, and encapsulates conversionof database rows into application objects.
« More »

ContentBase

Base level content object.

This is the base level content class. It is an abstract object and cannot be instantiated directly. All content pages in the database are required to be drived from this class.
« More »

cms_cache_handler

This singleton class provides a convenient caching capbility.

By default this uses the cms_filecache_driver to cache data in the TMP_CACHE_LOCATION for one hour.
« More »

CmsLayoutStylesheetQuery

A class to represent a template query, and its results.

This class accepts in it's constructor an array of filter arguments.
« More »

UserOperations

Class for doing user related functions. Maybe of the User object functions are just wrappers around these.

« More »

CmsNls

A class to provide data and methods for encapsulating a single language

« More »

FilePickerProfile

A simple class that defines a profile of information used by the filepicker to indicate how it should behave and what functionality should be provided.

This is an immutable class. The constructor and overrideWith methods of this class accept an associative array of parameters (see the properties below) to allow building or altering a profile object. Ths is the only time when properties of a profile can be adjusted. ```php $obj = new \CMSMS\FilePickerProfile( [ 'type'=>FileType::TYPE_IMAGE, 'exclude_prefix'=>'foo' ] );
« More »

FileType

A simple abstract class that defines constants for numerous file types.

« More »

CmsAdminUtils

A set of static utilities for assisting with admin requests

« More »

ModuleOperations

A singleton utility class to allow for working with modules.

« More »

CmsAdminMenuItem

A class to represent menu items for building an admin navigation.

This class is used to build admin navigations.
« More »

cms_admin_utils

A Simple static class providing various convenience utilities for admin requests.

« More »

CmsLockOperations

A singleton class providing utilities for interacting with locks.

« More »

CmsNlsOperations

A singleton class to provide simple, generic mechanism for dealing with languages encodings, and locales. This class does not handle translation strings.

« More »

CmsCoreCapabilities

A class that identifies numerous standard core capabilities

« More »

Group

Generic group class. This can be used for any logged in group or group related function.

« More »

AutoCookieManager

This class adjusts the way cookies are stored to allow identifying their primitive type (string, object, array). And then when retrieved can automatically restore them.

This class uses json to encoe arrays and objects, for security. Objects should implement the JsonSerializable interface if they can be saved to a cookie.
« More »

TemplateTypeAssistant

An abstract class to define an assistant to the template type objects in the database.

« More »

cms_url

A class for interacting with a URL.

« More »

frontend_theme_placeholder

A class that acts as a placeholder for a frontend theme.

the frontend theme is used by the cms_theme resource to display content
« More »

HookManager

A class to manage hooks, and to call hook handlers.

This class is capable of managing a flexible list of hooks, registering handlers for those hooks, and calling the handlers
« More »

CmsRoute

Simple global convenience object to hold information for a single route.

« More »

simple_plugin_operations

This operations class handles reading and writing simple plugins.

this is a singleton class.
« More »

CmsLayoutTemplateType

A class to manage template types

« More »

User

Generic admin user class. This can be used for any logged in user or user related function.

« More »

BookmarkOperations

Class for doing bookmark related functions. Maybe of the Bookmark object functions are just wrappers around these.

« More »

cms_utils

A Simple Static class providing various convenience utilities.

« More »

SimpleAlert

The SimpleAlert class is a type of alert that allows the developer to create alerts with pre-defined titles, messages, icons, and permissions.

Admin alerts have a name, priority, title, message, a timestamp and can optionally refer to a module. Methods are used to test if a module is for a specific user, and to format the message. Alerts are stored as preferences in the database. If the name is the name of the class or something else that is not data or time dependant the only one instance of that alert can be stored in the database. This class usses the ArrayAccess interface to behave like a PHP array.
« More »

TranslatableAlert

The TranslatableAlert object is an alert that supports translatable language keys.

This class will use the module that is associated with the alert to translate the key. If the module name is empty, or the special value 'core' then the global 'lang' function will be used to read translations from the admin lang file.
« More »

Alert

An abstract class that defines Admin Alerts for CMSMS.

Admin alerts have a name, priority, title, message, a timestamp and can optionally refer to a module. Methods are used to test if a module is for a specific user, and to format the message. Alerts are stored as preferences in the database. If the name is the name of the class or something else that is not data or time dependant the only one instance of that alert can be stored in the database. This class usses the ArrayAccess interface to behave like a PHP array.
« More »

CMSModuleContentType

Class that module defined content types must extend.

This is the base level content class. It is an abstract object and cannot be instantiated directly. All content pages in the database are required to be drived from this class.
« More »

cms_tree_operations

A utility class to provide functions to populate a tree

« More »

CmsLayoutTemplateQuery

A class to represent a template query, and its results.

This class accepts in it's constructor an array (or a comma separated string, of filter arguments). Accepted filter arguments are:<br/> o:string - The originator name<br/> i:##,##,## - A list of template id's<br/> t:## - A template type id<br/> c:## - A template category id.<br/> d:## - A design id<br/> u:## - A template owner id<br/> e:## - An additional editor id.<br/> l:# - A boolean (0 or 1) indicating listable, or not listable. Example:<br/> <code> $qry = new CmsTemplateQuery(array('o:'.get_userid(false)));<br/> $qry->limit = 50;<br/> $list = $qry->GetMatches();<br/> </code>
« More »

CmsFormUtils

A static class providing functionality for building forms.

This class will undergo changes in the future, and may no longer operate as a static class goinf forward.
« More »

ScriptManager

The ScriptManager class provides the ability to queue javascript files for rendering on the frontend

« More »

CmsLayoutCollection

A class to manage a collection (or theme) of Templates and Stylesheets

« More »

cms_http_request

HTTP Class

This is a wrapper HTTP class that uses either cURL or fsockopen to harvest resources from web. This can be used with scripts that need a way to communicate with various APIs who support REST. Modified by Robert Campbell (calguy1000@cmsmadesimple.org) Renamed the class to cms_http_request Fixed some bugs.
« More »

cms_mailer

A class for sending email.

Prior to CMSMS 2.0 this class was implemented as a core module. This class should not be instantiated directly.
« More »

cms_siteprefs

A singleton class for working with site preferences

« More »

CmsLockException

An exception indicating an error creating a lock

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsLockOwnerException

An exception indicating a uid mismatch wrt a lock (person operating on the lock is not the owner)

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsUnLockException

An exception indicating an error removing a lock

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsNoLockException

An exception indicating an error loading or finding a lock

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsLock

A simple class represeinting a lock on a logical object in CMSMS.

« More »

Error

#ignore

« More »

compatibility

A class for providing some compatibility functionality with older module code

« More »

DataDictionary

A class defining methods to work directly with database tables.

This file is based on the DataDictionary base class from the adodb_lite library which was in turn a fork of the adodb library at approximately 2004. Credits and kudos to the authors of those packages.
« More »

Connection

A class defining a database connection, and mechanisms for working with a database.

This library is largely compatible with adodb_lite with the pear,extended,transaction plugins with a few notable differences: Differences: <ul> <li>GenID will not automatically create a sequence table. <p>We encourage you to not use sequence tables and use auto-increment fields instead.</p> </li> </ul>
« More »

DatabaseException

A special type of exception related to database queries.

« More »

DatabaseConnectionException

A special exception indicating a problem connecting to the database.

« More »

Resultset

A class defining a resultset and how to interact with results from a database query.

« More »

Statement

A class defining a prepared database statement.

« More »

ConnectionSpec

A class defining all of the details needed to connect to a database.

Some database drivers may not require all of the parameters.
« More »

ConnectionSpecException

A special exception to indicate a problem with a ConnectionSpec

« More »

EmptyRecordset

A final class to describe a special (empty) recordset.

« More »

CmsExtraDataException

A basic exception class that holds on to extended information.

« More »

CmsException

A base CMSMS Exception

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsLogicException

A base CMSMS Logic Exception

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsCommunicationException

A base CMSMS Communications Exception

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsPrivacyException

A base CMSMS Privacy Exception

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsSingletonException

A base CMSMS Singleton Exception

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsInvalidDataException

An exception indicating invalid data was supplied to a function or class.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsDataNotFoundException

An exception indicating that the requested data could not be found.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsError400Exception

A special exception indicating that a 400 error should be supplied.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsError404Exception

A special exception indicating that a 404 error should be supplied.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsError403Exception

A special exception indicating that a 403 error should be supplied.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsError503Exception

A special exception indicating that the install is temporarily unavailable (down for maintenance)

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsStopProcessingContentException

a special exception indicating that content processing should stop, but other than that it is not there is no error to display.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsContentException

A special exception indicating an error with a content object

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsEditContentException

A special exception indicating an error when editing content.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsSQLErrorException

A special exception indicating an SQL Error.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsXMLErrorException

A special exception indicating an XML Error.

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

CmsFileSystemException

A special exception indicating a problem with a file, directory, or filesystem

This exception can accept an integer 'code' for an exception or a language key. if the string passed in contains a space it is not translated.
« More »

apc_cache_driver

This is a cache driver for CMSMS that stores cached data in memory using the APC library

This class will obfuscate all keys, and groups for added security.
« More »

CmsApp

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

Note: This class was named CmsObject before version 1.10
« More »

CmsContentTypePlaceholder

Simple global convenience object to hold CMS Content Type structure.

This class is subject to a refactoring at some point.
« More »

cms_filecache_driver

A cache driver to cache files using the filesystem.

This driver stores files in the CMSMS TMP_CACHE location. Supports read, and write locking a settable cache lifetime, md5 encoded keys and groups so that filenames cannot be easily determined, and automatic cleaning.
« More »

CmsLayoutTemplate

A class to represent a smarty template.

« More »

cms_cache_driver

An abstract class for various cache drivers

« More »

Events

Class for handling and dispatching system and user defined events.

« More »

CmsAdminThemeBase

Base class for CMSMS Admin themes.

This is an abstract class that is used for building CMSMS Admin Themes. This is also a singleton object.
« More »

CmsAdminThemeNotification

A class representing a simple notification.

« More »

cms_cookies

A simple static class providing convenience utilities for working with cookies.

« More »

CmsLangOperations

A singleton class to provide simple, generic mechanism for dealing with languages encodings, and locales. This class does not handle translation strings.

« More »

hook_manager

A class to add hook handlers and emit hooks of various types.

This class is capable of managing a flexible list of hooks, registering handlers for those hooks, and calling the handlers
« More »

FileTypeHelper

A class to provide utilities for manipulating files by their type.

« More »

CmsLayoutStylesheet

A class to represent a stylesheet.

This class is capable of managing a single stylesheet, and has static methods for loading stylesheets from the database. Loaded stylesheets are cached in internal memory to ensure that the same stylesheet is not loaded twice for a request. Stylesheets are (optionally) attached to designs (CmsLayoutCollection) see the {cms_stylesheet} plugin for more information.
« More »

cms_userprefs

A static class for preferences stored with admin user preferences.

« More »

ContentOperations

Class for static methods related to content

« More »

CMSModule

Base module class.

All modules should inherit and extend this class with their functionality.
« More »

StylesheetManager

This class is the backend behind the {cms_queue_css} and {cms_render_css} plugins.

It handles queueing CSS files, and then concatenating them all on output, and generating the appropriate HTML meta tag.
« More »

LayoutTemplateManager

A class that manages the storage of CmsLayoutTemplate objects in the database.

This class also supports caching, and sending hooks at various levels
« More »

cms_route_manager

A singleton class to manage all recognized routes in the system.

This class is used internally to allow managing routes. It should not be used by the public.
« More »

cms_tree

A Simple PHP Tree class that allows storing associative data along with each node.

« More »

cms_admin_tabs

A simple convenience class for creating a tabbed interface in the CMSMS admin console

« More »

GroupOperations

A singleton Class for doing group related functions.

Many of the Group object functions are just wrappers around these.
« More »

SignedCookieManager

This cookie manager obfuscates all keys and signs via SHA1 the values On get, if the attached signature does not match the generated signature, no value is returned.

« More »

ExternalHandlerJob

A type of job that calls an external function for processing. i.e: a UDT or a static function.

If a module is specified for this object, then the module will be loaded before calling the handler.
« More »

CronJob

An abstract base class for a cronjob.

A Cron job is different than a regular job in that it recurs at a specified frequency and can have an end/until date.
« More »

RegularTask

This class allows converting an old CmsRegularTask pseudocron task into an asynchronous background job.

« More »

Job

A class defining an asynchronous job, and mechanisms for saving and retrieving that job.

« More »

JobManager

A singleton class defining a manager for asyncrhonous jobs.

In reality, this is a simple proxy for methods in the CmsJobManager module.
« More »

CmsLanguageDetector

An abstract class that is used to determine a suitable language for display This may be used by CMSMS on frontend requests to detect a suitable language.

modules may supply a language detector to read from preferences etc.
« More »

cms_config

A singleton class for interacting with the CMSMS config.php file.

This class usses the ArrayAccess interface to behave like a PHP array.
« More »

Bookmark

Bookmark class for the CMSMS admin console.

« More »