cms_utils View code

A Simple Static class providing various convenience utilities.

package

CMS

license

GPL

author

Robert Campbell

copyright

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

since 1.9

Methods

get_app_data(string $key) : mixed

Get data that was stored elsewhere in the application.

static

Arguments

string $key

The key to get.

Response

mixed

The stored data, or null

set_app_data(string $key, mixed $value) 

Set data for later use.

static

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.

Arguments

string $key

The name of this data.

mixed $value

The data to store.

get_module(string $name, string $version = '') : \CmsModule

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

static

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.

Arguments

string $name

The module name

string $version

An optional version string

Response

\CmsModule

The matching module object or null

module_available(string $name) : boolean

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

static final

Arguments

string $name

The module name

Response

boolean

get_db() : \ADOConnection

A convenience function to return the current database instance.

static final

Response

\ADOConnection

a handle to the ADODB database object

get_config() : \cms_config

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

static final

Response

\cms_config

The global configuration object.

get_smarty() : \Smarty_CMS

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

static final

Response

\Smarty_CMS

Handle to the Smarty object

get_current_content() : \Content

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

static final

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

Response

\Content

The current content object, or null

get_current_alias() : string

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

static final

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

Response

string

get_current_pageid() : integer

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

static final

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

Response

integer

get_wysiwyg_module(string $module_name = '') : \CMSModule

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

static

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.

Arguments

string $module_name

The module name.

Response

\CMSModule

get_syntax_highlighter_module() : \CMSModule

A convenient method to get the currently selected syntax highlighter.

static

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

Response

\CMSModule

get_search_module() : \CMSModule

A convenience method to get the currently selected search module.

static

Response

\CMSModule

get_filepicker_module() : \CMSModule

A convenience method to get the currently selected filepicker module.

static

Response

\CMSModule

get_real_ip() 

Attempt to retreive the IP address of the connected user.

static

This function attempts to compensate for proxy servers.

get_theme_object() 

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

static