cms_set_frontend_language(string $lang = '')
string
$langThe language to set. If empty, the system will be restored to the default frontend language.
lang_by_realm(string $realm, string $key) : string
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');
string
$realmThe realm
string
$keyThe lang key and any vspring arguments.
string
lang(string $key) : string
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');
string
$keyThe key to translate and then any vsprintf arguments for the key.
string
get_encoding : string
string
get_language_list(boolean $allow_none = true) : \associative
boolean
$allow_noneOptionally adds 'none' (translated to current language) to the top of the list.
\associative
array of lang keys and display strings.
is_sitedown : boolean
This method includes handling the preference that indicates that site-down behaviour should be disabled for certain IP address ranges.
boolean
redirect(string $to)
If headers have not been sent this method will use header based redirection. Otherwise javascript redirection will be used.
string
$toThe url to redirect to
redirect_to_alias(mixed $alias)
Retrieves the URL of the specified page, and performs a redirect
mixed
$aliasAn integer page id or a string page alias.
microtime_diff(string $a, string $b) : integer
string
$aEarlier microtime value
string
$bLater microtime value
integer
The difference.
cms_join_path : string
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);
string
cms_relative_path(string $in, string $relative_to = null) : string
string
$inThe input path or file specification
string
$relative_toThe optional path to compute relative to. If not supplied the cmsms root path will be used.
string
The relative portion of the input string.
cms_htmlentities(string $val, string $param = ENT_QUOTES, string $charset = "UTF-8", boolean $convert_single_quotes = false) : string
string
$valThe input string
string
$paramA flag indicating how quotes should be handled (see htmlentities) (ignored)
string
$charset$val The input character set (ignored)
boolean
$convert_single_quotesA flag indicating wether single quotes should be converted to entities.
string
the converted string.
debug_bt_to_log
debug_bt
This function does not return but echoes output.
debug_display(mixed $var, string $title = "", boolean $echo_to_screen = true, boolean $use_html = true, boolean $showtitle = TRUE) : string
mixed
$varThe data to display
string
$title(optional) title for the output. If null memory information is output.
boolean
$echo_to_screen(optional) Flag indicating wether the output should be echoed to the screen or returned.
boolean
$use_html(optional) flag indicating wether html or text should be used in the output.
boolean
$showtitle(optional) flag indicating wether the title field should be displayed in the output.
string
debug_output(mixed $var, string $title = "")
mixed
$varstring
$titledebug_to_log(mixed $var, string $title = '', string $filename = '')
mixed
$vardata to display
string
$titleoptional title.
string
$filenameoptional output filename
debug_buffer(mixed $var, string $title = "")
mixed
$varstring
$titleget_parameter_value(array $parameters, string $value, mixed $default_value = '', string $session_key = '') : mixed
Returns $default if $value is not in $params array. Note: This function will also trim() string values.
array
$parametersstring
$valuemixed
$default_valuestring
$session_key mixed
is_directory_writable(string $path) : boolean
string
$pathStart directory.
boolean
get_recursive_file_list(string $path, array $excludes, integer $maxdepth = -1, string $mode = "FULL", \d $d) : array<mixed,string>
string
$pathStart Path.
array
$excludesArray of regular expressions indicating files to exclude.
integer
$maxdepthHow deep to browse (-1=unlimited)
string
$mode"FULL"|"DIRS"|"FILES"
\d
$dfor internal use only
array<mixed,string>
recursive_delete(string $dirname) : boolean
string
$dirnameThe directory name
boolean
chmod_r(string $path, integer $mode)
string
$pathThe start location
integer
$modeThe octal mode Rolf: only used in admin/listmodules.php
startswith(string $str, string $sub) : boolean
i.e: startswith('The Quick Brown Fox','The');
string
$strThe string to test against
string
$subThe search string
boolean
endswith(string $str, string $sub) : boolean
i.e: endswith('The Quick Brown Fox','Fox');
string
$strThe string to test against
string
$subThe search string
boolean
munge_string_to_url(string $alias, boolean $tolower = false, boolean $withslash = false) : string
string
$aliasString to convert
boolean
$tolowerIndicates whether output string should be converted to lower case
boolean
$withslashIndicates wether slashes should be allowed in the input.
string
ini_get_boolean(string $str) : integer
string
$strThe php ini key
integer
stack_trace
This method uses echo.
cms_move_uploaded_file(string $tmpfile, string $destination) : \bool.
string
$tmpfileThe temporary file specification
string
$destinationThe destination file specification
\bool.
cms_ipmatches(string $ip, array $checklist) : boolean
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)
string
$ipIP address to test
array
$checklistArray of match expressions
boolean
Rolf: only used in lib/content.functions.php
is_email(string $email, boolean $checkDNS = false) : boolean
string
$emailboolean
$checkDNS boolean
cms_to_bool(string $str)
accepts, 'y','yes','true',1 as TRUE (case insensitive) all other values represent FALSE.
string
$strInput string to test. Rolf: only used in lib/classes/contenttypes/Content.inc.php
cms_get_jquery(string $exclude = '', boolean $ssl = null, boolean $cdn = false, string $append = '', string $custom_root = '', boolean $include_css = TRUE)
CMSMS is distributed with a recent version of jQuery, jQueryUI and various other jquery based libraries. This function generates the HTML code that will include these scripts.
See the {cms_jquery} smarty plugin for a convenient way of including the CMSMS provided jquery libraries from within a smarty template.
Known libraries: jquery jquery-ui nestedSortable json migrate
string
$excludeA comma separated list of script names or aliases to exclude.
boolean
$sslForce use of the ssl_url for the root url to necessary scripts.
boolean
$cdnForce the use of a CDN url for the libraries if one is known
string
$appendA comma separated list of library URLS to the output
string
$custom_rootA custom root URL for all scripts (when using local mode). If this is spefied the $ssl param will be ignored.
boolean
$include_cssOptionally output stylesheet tags for the included javascript libraries.
get_userid(boolean $redirect = true) : integer
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.
boolean
$redirectRedirect to the admin login page if the user is not logged in.
integer
The UID of the logged in administrator, otherwise FALSE
get_username(boolean $check = true) : string
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.
boolean
$checkRedirect to the admin login page if the user is not logged in.
string
the username of the logged in user.
check_login(string $no_redirect = false) : boolean
string
$no_redirectIf true, then don't redirect if not logged in
boolean
check_permission(integer $userid, string $permname) : boolean
Members of the admin group have all permissions.
integer
$useridThe user id
string
$permnameThe permission name
boolean
audit(integer $itemid, string $itemname, string $action) : void
integer
$itemidThe item id (perhaps a content id, or a record id from a module)
string
$itemnameThe item name (perhaps Content, or the module name)
string
$actionThe action that needs to be audited
get_site_preference(string $prefname, mixed $defaultvalue = '') : mixed
string
$prefnameThe preference name
mixed
$defaultvalueThe default value if the preference does not exist
mixed
remove_site_preference(string $prefname, boolean $uselike = false) : void
string
$prefnamePreference name to remove
boolean
$uselikeWether or not to remove all preferences that are LIKE the supplied name
set_site_preference(string $prefname, mixed $value) : void
string
$prefnameThe preference name
mixed
$valueThe preference value (will be stored as a string)
NewDataDictionary(\CMSMS\Database\Connection $conn) : \CMSMS\Database\DataDictionary
ADONewConnection(string $dbms, string $flags) : \CMSMS\Database\Connection
load_adodb
This method currently has no functionality.
adodb_connect
adodb_error(string $dbtype, string $function_performed, integer $error_number, string $error_message, string $host, string $database, mixed &$connection_obj)
string
$dbtypestring
$function_performedinteger
$error_numberstring
$error_messagestring
$hoststring
$databasemixed
$connection_objget_preference(integer $userid, string $prefname, mixed $default = '') : mixed
integer
$useridThe user id
string
$prefnameThe preference name
mixed
$defaultThe default value if the preference is not set for the given user id.
mixed
set_preference(integer $userid, string $prefname, mixed $value)
integer
$useridThe user id
string
$prefnameThe preference name
mixed
$valueThe preference value (will be stored as a string)
cms_db_prefix : string
string
__CMS_PREVIEW_PAGE__
CMS_ADODB_DT
TMP_CACHE_LOCATION
PUBLIC_CACHE_LOCATION
PUBLIC_CACHE_URL
TMP_TEMPLATES_C_LOCATION
CMS_DEBUG
CMS_ROOT_PATH
CMS_ROOT_URL
If the root_url variable is not specified in the config file, then CMSMS will attempt to calculate one.
CMS_DB_PREFIX
CLEAN_INT
This is used when cleaning input parameters for a module action or module call.
CLEAN_FLOAT
CLEAN_NONE
This is used when cleaning input parameters for a module action or module call.
CLEAN_STRING
This is used when cleaning input parameters for a module action or module call.
CLEAN_REGEXP
This is used when cleaning input parameters for a module action or module call.
CLEAN_FILE
This is used when cleaning input parameters for a module action or module call.
ContentBase
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.
cms_content_tree
CmsFormUtils
User
CmsNlsOperations
CmsLayoutStylesheetQuery
This class accepts in it's constructor an array of filter arguments.
Group
CmsAdminUtils
ExternalHandlerJob
If a module is specified for this object, then the module will be loaded before calling the handler.
CmsLanguageDetector
modules may supply a language detector to read from preferences etc.
cms_tree
CmsRoute
cms_mailer
Prior to CMSMS 2.0 this class was implemented as a core module.
GroupOperations
Many of the Group object functions are just wrappers around these.
UserOperations
CmsAdminThemeBase
This is an abstract class that is used for building CMSMS Admin Themes. This is also a singleton object.
CmsAdminThemeNotification
CmsLayoutStylesheet
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.
CmsLangOperations
CmsLayoutTemplateQuery
This class accepts in it's constructor an array (or a comma separated string, of filter arguments).
Accepted filter arguments are:
o:string - The originator name
i:##,##,## - A list of template id's
t:## - A template type id
c:## - A template category id.
d:## - A design id
u:## - A template owner id
e:## - An additional editor id.
l:# - A boolean (0 or 1) indicating listable, or not listable.
Example:
$qry = new CmsTemplateQuery(array('o:'.get_userid(false)));
$qry->limit = 50;
$list = $qry->GetMatches();
CMSModuleContentType
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.
CmsAdminMenuItem
All modules should inherit and extend this class with their functionality.
cms_module_smarty_plugin_manager
cms_userprefs
CmsLayoutTemplateCategory
Templates can be optionally organized into categories, this class manages the category itself.
cms_http_request
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.
CmsLockOperations
CmsApp
Note: This class was named CmsObject before version 1.10
CmsContentTypePlaceholder
cms_admin_utils
cms_tree_operations
cms_config
This class usses the ArrayAccess interface to behave like a PHP array.
cms_cache_handler
By default this uses the cms_filecache_driver to cache data in the TMP_CACHE_LOCATION for one hour.
CmsDbQueryBase
This class is capable of managing a resultset, and encapsulates conversionof database rows into application objects.
CMSModule
All modules should inherit and extend this class with their functionality.
CmsCoreCapabilities
BookmarkOperations
CmsLayoutCollection
CmsLockException
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.
CmsLockOwnerException
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.
CmsUnLockException
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.
CmsNoLockException
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.
cms_route_manager
cms_filecache_driver
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.
cms_admin_tabs
ModuleOperations
CmsExtraDataException
CmsException
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.
CmsLogicException
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.
CmsCommunicationException
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.
CmsPrivacyException
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.
CmsSingletonException
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.
CmsInvalidDataException
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.
CmsDataNotFoundException
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.
CmsError404Exception
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.
CmsError403Exception
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.
CmsContentException
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.
CmsEditContentException
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.
CmsSQLErrorException
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.
FilePickerInterface
FilePickerProfile
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.
$obj = new \CMSMS\FilePickerProfile( [ 'type'=>FileType::TYPE_IMAGE,
'exclude_prefix'=>'foo' ] );
HookManager
This class is capable of managing a flexible list of hooks, registering handlers for those hooks, and calling the handlers and/or related events.
FileType
DataDictionary
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.
compatibility
Resultset
EmptyResultset
ConnectionSpec
Some database drivers may not require all of the parameters.
ConnectionSpecException
Connection
This library is largely compatible with adodb_lite with the pear,extended,transaction plugins with a few notable differences:
Differences:
We encourage you to not use sequence tables and use auto-increment fields instead.
DatabaseException
CronJobTrait
CronJobInterface
JobManager
In reality, this is a simple proxy for methods in the CmsJobManager module.
RegularTask
Alert
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.
SimpleAlert
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.
TranslatableAlert
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.