CMS Made Simple API

cms_utils
in package

FinalYes

A Simple Static class providing various convenience utilities.

Tags
license

GPL

author

Robert Campbell

copyright

Copyright (c) 2010, Robert Campbell calguy1000@cmsmadesimple.org

since
1.9

Table of Contents

Methods

get_app_data()  : mixed
Get data that was stored elsewhere in the application.
get_config()  : cms_config
A convenience function to return a handle to the global CMSMS config.
get_current_alias()  : string
A convenience function to return the alias of the current page.
get_current_content()  : Content
A convenience functon to return a reference to the current content object.
get_current_pageid()  : int
A convenience function to return the page id of the current page
get_db()  : Connection
A convenience function to return the current database instance.
get_filepicker_module()  : CMSModule
A convenience method to get the currently selected filepicker module.
get_module()  : CmsModule
A convenience function to return the object representing an installed module.
get_real_ip()  : mixed
Attempt to retreive the IP address of the connected user.
get_search_module()  : CMSModule
A convenience method to get the currently selected search module.
get_smarty()  : Smarty_CMS
A convenience function to return a handle to the CMSMS Smarty object.
get_syntax_highlighter_module()  : CMSModule
A convenient method to get the currently selected syntax highlighter.
get_theme_object()  : mixed
Get a reference to the current theme object only returns a valid value when in an admin request.
get_wysiwyg_module()  : CMSModule
A convenient method to get the object pointer to the appropriate wysiwyg module.
module_available()  : bool
A convenience function to return an indication if a module is availalbe.
set_app_data()  : mixed
Set data for later use.

Methods

get_app_data()

Get data that was stored elsewhere in the application.

public static get_app_data(string $key) : mixed
Parameters
$key : string

The key to get.

Tags
since
1.9
Return values
mixed

The stored data, or null

get_config()

A convenience function to return a handle to the global CMSMS config.

public static get_config() : cms_config
Tags
since
1.9
Return values
cms_config

The global configuration object.

get_current_alias()

A convenience function to return the alias of the current page.

public static get_current_alias() : string

This function will always return NULL if called from an admin action

Tags
since
1.9
Return values
string

get_current_content()

A convenience functon to return a reference to the current content object.

public static get_current_content() : Content

This function will always return NULL if called from an admin action

Tags
since
1.9
Return values
Content

The current content object, or null

get_current_pageid()

A convenience function to return the page id of the current page

public static get_current_pageid() : int

This function will always return NULL if called from an admin action

Tags
since
1.9
Return values
int

get_filepicker_module()

A convenience method to get the currently selected filepicker module.

public static get_filepicker_module() : CMSModule
Tags
since
2.2
author

calguy1000

Return values
CMSModule

get_module()

A convenience function to return the object representing an installed module.

public static get_module(string $name[, string $version = '' ]) : CmsModule

If a version string is passed, a matching object will only be returned IF the installed version is greater than or equal to the supplied version.

Parameters
$name : string

The module name

$version : string = ''

An optional version string

Tags
see
version_compare()
see
ModuleOperations::get_module_instance
since
1.9
Return values
CmsModule

The matching module object or null

get_real_ip()

Attempt to retreive the IP address of the connected user.

public static get_real_ip() : mixed

This function attempts to compensate for proxy servers.

Tags
author

calguy1000

since
1.10
returns

string IP address in dotted notation, or null

get_search_module()

A convenience method to get the currently selected search module.

public static get_search_module() : CMSModule
Tags
since
1.10
author

calguy1000

Return values
CMSModule

get_smarty()

A convenience function to return a handle to the CMSMS Smarty object.

public static get_smarty() : Smarty_CMS
Tags
see
CmsApp::GetSmarty()
since
1.9
Return values
Smarty_CMS

Handle to the Smarty object

get_syntax_highlighter_module()

A convenient method to get the currently selected syntax highlighter.

public static get_syntax_highlighter_module() : CMSModule

This is a wrapper around a similar function in the ModuleOperations class.

Tags
since
1.10
author

calguy1000

Return values
CMSModule

get_theme_object()

Get a reference to the current theme object only returns a valid value when in an admin request.

public static get_theme_object() : mixed
Tags
author

calguy1000

since
1.11
returns

CmsAdminThemeBase derived object, or null

get_wysiwyg_module()

A convenient method to get the object pointer to the appropriate wysiwyg module.

public static get_wysiwyg_module([string $module_name = '' ]) : CMSModule

This is a wrapper around a similar function in the ModuleOperations class.

This method will return the currently selected frontend wysiwyg for frontend requests (or null if none is selected) For admin requests this method will return the users currently selected wysiwyg module, or null.

Parameters
$module_name : string = ''

The module name.

Tags
since
1.10
Return values
CMSModule

module_available()

A convenience function to return an indication if a module is availalbe.

public static module_available(string $name) : bool
Parameters
$name : string

The module name

Tags
see
get_module()
author

calguy1000

since
1.11
Return values
bool

set_app_data()

Set data for later use.

public static set_app_data(string $key, mixed $value) : mixed

This method is typically used to store data for later use by another part of the application. This data is not stored in the session, so it only exists for one request.

Parameters
$key : string

The name of this data.

$value : mixed

The data to store.

Tags
since
1.9

        
On this page

Search results