__CMS_PREVIEW_PAGE__
public
mixed
__CMS_PREVIEW_PAGE__
= -100
public
mixed
__CMS_PREVIEW_PAGE__
= -100
Indicates that the incoming parameter is an uploaded file.
public
mixed
CLEAN_FILE
= 'CLEAN_FILE'
This is used when cleaning input parameters for a module action or module call.
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.
public
mixed
CLEAN_FLOAT
= 'CLEAN_FLOAT'
Indicates that the incoming parameter is expected to be an integer.
public
mixed
CLEAN_INT
= 'CLEAN_INT'
This is used when cleaning input parameters for a module action or module call.
Indicates that the incoming parameter is not to be cleaned.
public
mixed
CLEAN_NONE
= 'CLEAN_NONE'
This is used when cleaning input parameters for a module action or module call.
Indicates that the incoming parameter is a regular expression.
public
mixed
CLEAN_REGEXP
= 'regexp:'
This is used when cleaning input parameters for a module action or module call.
Indicates that the incoming parameter is a string.
public
mixed
CLEAN_STRING
= 'CLEAN_STRING'
This is used when cleaning input parameters for a module action or module call.
A constant indicating if CMSMS is in debug mode.
public
mixed
CMS_DEBUG
= self::$_instance['debug']
A constant containing the directory where CMSMS is installed.
public
mixed
CMS_ROOT_PATH
= self::$_instance['root_path']
A constant containing the CMSMS root url.
public
mixed
CMS_ROOT_URL
= self::$_instance['root_url']
If the root_url variable is not specified in the config file, then CMSMS will attempt to calculate one.
A constant to indicate where public (browsable) cachable files can be written.
public
mixed
PUBLIC_CACHE_LOCATION
= self::$_instance['public_cache_location']
A constant to indicate the public address for cachable files.
public
mixed
PUBLIC_CACHE_URL
= self::$_instance['public_cache_url']
A constant to indicate the location where private cacheable files can be written.
public
mixed
TMP_CACHE_LOCATION
= self::$_instance['tmp_cache_location']
A constant containing the smarty template compile directory.
public
mixed
TMP_TEMPLATES_C_LOCATION
= self::$_instance['tmp_templates_c_location']
Retrieve the value of the named preference for the given userid.
get_preference(int $userid, string $prefname[, mixed $default = '' ]) : mixed
The user id
The preference name
The default value if the preference is not set for the given user id.
Sets the given perference for the given userid with the given value.
set_preference(int $userid, string $prefname, mixed $value) : mixed
The user id
The preference name
The preference value (will be stored as a string)
Return the global cmsms() object.
cmsms() : CmsApp
Returns the currently configured database prefix.
cms_db_prefix() : string
A convenience function to test if the site is marked as down according to the config panel.
is_sitedown() : bool
This method includes handling the preference that indicates that site-down behaviour should be disabled for certain IP address ranges.
Redirects to relative URL on the current site.
redirect(string $to) : mixed
If headers have not been sent this method will use header based redirection. Otherwise javascript redirection will be used.
The url to redirect to
Given a page ID or an alias, redirect to it.
redirect_to_alias(mixed $alias) : mixed
Retrieves the URL of the specified page, and performs a redirect
An integer page id or a string page alias.
Calculate the difference in seconds between two microtime() values.
microtime_diff(string $a, string $b) : int
Earlier microtime value
Later microtime value
The difference.
Joins a path together using platform specific directory separators.
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);
Return the relative portion of a path
cms_relative_path(string $in[, string $relative_to = null ]) : string
The input path or file specification
The optional path to compute relative to. If not supplied the cmsms root path will be used.
The relative portion of the input string.
Perform HTML entity conversion on a string.
cms_htmlentities(string $val[, string $param = ENT_QUOTES ][, string $charset = "UTF-8" ][, bool $convert_single_quotes = false ]) : string
The input string
A flag indicating how quotes should be handled (see htmlentities) (ignored)
$val The input character set (ignored)
A flag indicating wether single quotes should be converted to entities.
the converted string.
A function to output a backtrace into the generated log file.
debug_bt_to_log() : mixed
A function to generate a backtrace in a readable format.
debug_bt() : mixed
This function does not return but echoes output.
Debug function to display $var nicely in html.
debug_display(mixed $var[, string $title = "" ][, bool $echo_to_screen = true ][, bool $use_html = true ][, bool $showtitle = TRUE ]) : string
The data to display
(optional) title for the output. If null memory information is output.
(optional) Flag indicating wether the output should be echoed to the screen or returned.
(optional) flag indicating wether html or text should be used in the output.
(optional) flag indicating wether the title field should be displayed in the output.
Display $var nicely only if $config["debug"] is set.
debug_output(mixed $var[, string $title = "" ]) : mixed
Debug function to output debug information about a variable in a formatted matter to a debug file.
debug_to_log(mixed $var[, string $title = '' ][, string $filename = '' ]) : mixed
data to display
optional title.
optional output filename
Display $var nicely to the CmsApp::get_instance()->errors array if $config['debug'] is set.
debug_buffer(mixed $var[, string $title = "" ]) : mixed
Retrieve the $value from the $parameters array checking for $parameters[$value] and $params[$id.$value].
get_parameter_value(array<string|int, mixed> $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.
Check the permissions of a directory recursively to make sure that we have write permission to all files.
is_directory_writable(string $path) : bool
Start directory.
Return an array containing a list of files in a directory performs a recursive search.
get_recursive_file_list(string $path, array<string|int, mixed> $excludes[, int $maxdepth = -1 ][, string $mode = "FULL" ][, d $d = 0 ]) : array<string|int, string>
Start Path.
Array of regular expressions indicating files to exclude.
How deep to browse (-1=unlimited)
"FULL"|"DIRS"|"FILES"
for internal use only
A function to recursively delete all files and folders in a directory; synonymous with rm -r.
recursive_delete(string $dirname) : bool
The directory name
A function to recursively chmod all files and folders in a directory.
chmod_r(string $path, int $mode) : mixed
The start location
The octal mode Rolf: only used in admin/listmodules.php
A convenience function to test wether one string starts with another.
startswith(string $str, string $sub) : bool
i.e: startswith('The Quick Brown Fox','The');
The string to test against
The search string
Similar to the startswith method, this function tests with string A ends with string B.
endswith(string $str, string $sub) : bool
i.e: endswith('The Quick Brown Fox','Fox');
The string to test against
The search string
Convert a human readable string into something that is suitable for use in URLS.
munge_string_to_url(string $alias[, bool $tolower = false ][, bool $withslash = false ]) : string
String to convert
Indicates whether output string should be converted to lower case
Indicates wether slashes should be allowed in the input.
A convenience function to return a bool variable given a php ini key that represents a bool.
ini_get_boolean(string $str) : int
The php ini key
Another convenience function to output a human-readable function stack trace.
stack_trace() : mixed
This method uses echo.
A wrapper around move_uploaded_file that attempts to ensure permissions on uploaded files are set correctly.
cms_move_uploaded_file(string $tmpfile, string $destination) : mixed
The temporary file specification
The destination file specification
A function to test whether an IP address matches a list of expressions.
cms_ipmatches(string $ip, array<string|int, mixed> $checklist) : bool
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)
IP address to test
Array of match expressions
Rolf: only used in lib/content.functions.php
Test if the string provided is a valid email address.
is_email(string $email[, bool $checkDNS = false ]) : bool
A simple function to convert a string to a bool.
cms_to_bool(string $str) : mixed
accepts, 'y','yes','true',1 as TRUE (case insensitive) all other values represent FALSE.
Input string to test. Rolf: only used in lib/classes/contenttypes/Content.inc.php
A function to return the appropriate HTML tags to include the CMSMS included jquery in a web page.
cms_get_jquery([string $exclude = '' ][, bool $ssl = null ][, bool $cdn = false ][, string $append = '' ][, string $custom_root = '' ][, bool $include_css = TRUE ]) : mixed
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
A comma separated list of script names or aliases to exclude.
Force use of the ssl_url for the root url to necessary scripts.
Force the use of a CDN url for the libraries if one is known
A comma separated list of library URLS to the output
A custom root URL for all scripts (when using local mode). If this is spefied the $ssl param will be ignored.
Optionally output stylesheet tags for the included javascript libraries.
Test if a string is a base64 encoded string
is_base64(string $s) : bool
The input string
Gets the userid of the currently logged in user.
get_userid([bool $redirect = true ]) : int
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.
Redirect to the admin login page if the user is not logged in.
The UID of the logged in administrator, otherwise FALSE
Gets the username of the currently logged in user.
get_username([bool $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.
Redirect to the admin login page if the user is not logged in.
the username of the logged in user.
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.
check_login([string $no_redirect = false ]) : bool
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.
If true, then don't redirect if not logged in
Checks to see that the given userid has access to the given permission.
check_permission(int $userid, string $permname) : bool
Members of the admin group have all permissions.
The user id
The permission name
Put an event into the audit (admin) log. This should be done on most admin events for consistency.
audit(int $itemid, string $itemname, string $action) : void
The item id (perhaps a content id, or a record id from a module)
The item name (perhaps Content, or the module name)
The action that needs to be audited
Gets the given site prefernce
get_site_preference(string $prefname[, mixed $defaultvalue = '' ]) : mixed
The preference name
The default value if the preference does not exist
Removes the given site preference
remove_site_preference(string $prefname[, bool $uselike = false ]) : void
Preference name to remove
Wether or not to remove all preferences that are LIKE the supplied name
Sets the given site perference with the given value.
set_site_preference(string $prefname, mixed $value) : void
The preference name
The preference value (will be stored as a string)
Replacement for deprecated strftime function
locale_ftime(string $format[, mixed $datevar = null ]) : string
strftime()- and/or date()-compatible format specifier
timestamp | date-time-string | DateTime object | empty to use time() value
Temporarily override the current frontend language.
cms_set_frontend_language([string $lang = '' ]) : mixed
The language to set. If empty, the system will be restored to the default frontend language.
Retrieve a translation for a specific string in a specific realm.
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');
The realm
The lang key and any vspring arguments.
Return a translated string for the default 'admin' realm.
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');
The key to translate and then any vsprintf arguments for the key.
Get the encoding of the current language.
get_encoding() : string
Retrieve a list of installed languages that is suitable for use in a dropdown.
get_language_list([bool $allow_none = true ]) : associative
Optionally adds 'none' (translated to current language) to the top of the list.
array of lang keys and display strings.