CmsAdminUtils View code

A set of static utilities for assisting with admin requests

package

CMS

version

$Revision$

license

GPL

since 2.0
author

Robert Campbell

Methods

is_valid_itemname(string $str) : boolean|string

Test if a string is suitable for use as a name of an item in CMSMS.

static

For use by various modules and the core. The name must begin with an alphanumeric character (but some extended characters are allowed). And must be followed by the same alphanumeric characters note the name is not necessarily guaranteed to be usable in smarty without backticks.

Arguments

string $str

The string to test

Response

boolean|string

FALSE on error or the validated string.

get_generic_url(string $in_url) : string

Convert an admin request URL to a generic form that is suitable for saving to a database.

static

This is useful for things like bookmarks and homepages.

Arguments

string $in_url

The input URL that has the session key in it.

Response

string

A URL that is converted to a generic form.

get_session_url(string $in_url) : string

Convert a generic URL into something that is suitable for this users session.

static

Arguments

string $in_url

The generic url. usually retrieved from a preference or from the database

Response

string

A URL that has a session key in it.

fetch_latest_cmsms_ver() : string

Get the latest available CMSMS version.

static

This method does a remote request to the version check URL at most once per day.

Response

string

site_needs_updating() : boolean

Test if the current site is in need of upgrading (a new version of CMSMS is available)

static

Response

boolean

Constants

A regular expression to use when testing if an item has a valid name.

ITEMNAME_REGEX