Functions

IP_match()

IP_match($network, $mask, $ip) 
deprecated [2012-08-02] Use ipMatch() instead

Parameters

$network

$mask

$ip

Add new article specification

addArtspec(string $artspectext, int $online) : void

Parameters

$artspectext

string

specification text

$online

int

Online status (1 or 0)

array_csort()

array_csort() 
deprecated [2012-08-02] Use cArray::csort() instead

array_search_recursive()

array_search_recursive($search, $array, $partial, $strict) 
deprecated [2012-08-02] Use cArray::searchRecursive() instead

Parameters

$search

$array

$partial

$strict

Redirect to main area

backToMainArea(bool $send) 

Parameters

$send

bool

Redirect Yes/No

Build a Article select Box

buildArticleSelect(string $sName, string $iIdCat, string $sValue) : string

Parameters

$sName

string

Name of the SelectBox

$iIdCat

string

category id

$sValue

string

Value of the SelectBox

Returns

stringHTML

Build a Category / Article select Box

buildCategorySelect(string $sName, string $sValue, int $sLevel, string $sStyle) : string

Parameters

$sName

string

Name of the SelectBox

$sValue

string

Value of the SelectBox

$sLevel

int

Value of highest level that should be shown

$sStyle

string

Optional style informations for select

Returns

stringHTML

Returns a formatted string with a stack trace ready for output.

buildStackString(int $startlevel) : string

"\tfunction1() called in file $filename($line)" "\tfunction2() called in file $filename($line)" ...

Parameters

$startlevel

int

The startlevel. Note that 0 is always buildStackString and 1 is the function called buildStackString (e.g. cWarning)

Returns

string

Writes a note to deprecatedlog.txt

cDeprecated($message) : void

Parameters

$message

CONTENIDO die-alternative.

cDie(string $file, int $line, string $message) 

Logs the message and calls die().

Parameters

$file

string

File name (use FILE)

$line

int

Line number (use LINE)

$message

string

Message to display

CONTENIDO error

cError(\Multiple $file, $line, $message) 

Examples:

// New version
cWarning('Some error message');
// Old version
cWarning(__FILE__, __LINE__, 'Some error message');

Parameters

$file

\Multiple

parameters

$line

$message

cIDNADecode()

cIDNADecode($targetEncoding, $string) 
deprecated [2011-08-24] This function is not supported any longer

Parameters

$targetEncoding

$string

cIDNAEncode()

cIDNAEncode($sourceEncoding, $string) 
deprecated [2011-08-24] This function is not supported any longer

Parameters

$sourceEncoding

$string

cInitializeArrayKey()

cInitializeArrayKey($aArray, $sKey, $mDefault) 
deprecated 2012-09-05 use function located in cArray instead of this function

Parameters

$aArray

$sKey

$mDefault

CONTENIDO warning

cWarning() 

Examples:

// New version
cWarning('Some warning message');
// Old version
cWarning(__FILE__, __LINE__, 'Some warning message');

Calls the plugin's store methods.

callPluginStore(string $entity) 

Parameters

$entity

string

Name of the directory to scan

checkMySQLConnectivity()

checkMySQLConnectivity() 
deprecated [2012-01-18] cDb performs the check for itself. This method is no longer needed

Small hack to clean up unused sessions.

cleanupSessions() 

As we are probably soon rewriting the session management, this hack is OK.

deprecated [2012-07-??] PHP will handle cleaning up sessions

Creates a random name (example: Passwords).

createRandomName(int $nameLength) : string

Parameters

$nameLength

int

Length of the generated string

Returns

stringRandom name

Defines a constant if not defined before.

defineIfNotDefined(string $constant, mixed $value) 

Parameters

$constant

string

Name of constant to define

$value

mixed

It's value

define_if()

define_if($constant, $value) 
deprecated [2012-08-02] Use defineIfNotDefined() instead

Parameters

$constant

$value

Delete specified article specification

deleteArtspec(int $idartspec) : void

Parameters

$idartspec

int

article specification id

Remove a system property entry

deleteSystemProperty(string $type, string $name) : bool

Parameters

$type

string

The type of the item

$name

string

The name of the item

Returns

bool

Returns a formatted date and/or timestring according to the current settings

displayDatetime(mixed $timestamp, bool $date, bool $time) : string

Parameters

$timestamp

mixed

a timestamp. If no value is given the current time will be used.

$date

bool

if true the date will be included in the string

$time

bool

if true the time will be included in the string

Returns

stringthe formatted timestring.

displayPlugin()

displayPlugin($entity, $form) 
deprecated [2012-02-26] Function does not work and is not longer supported

Parameters

$entity

$form

Ends the timing process and logs it to the timings file

endAndLogTiming($uuid) 

Parameters

$uuid

int UUID which has been used for timing

fakeheader()

fakeheader($time) 
deprecated [2012-03-05] This function is not longer supported.

Parameters

$time

Returns a list with all clients and languages.

getAllClientsAndLanguages() : array

Returns

arrayIndexed array where the value is an assoziative array as follows:
        - $arr[0]['idlang']
        - $arr[0]['langname']
        - $arr[0]['idclient']
        - $arr[0]['clientname']
        

Retrieve list of article specifications for current client and language

getArtspec() : array

Returns

arraylist of article specifications

Extracts the available content-types from the database

getAvailableContentTypes(int $idartlang) : void

Creates an array $a_content[type][number] = content string f.e. $a_content['CMS_HTML'][1] = content string Same for array $a_description

Parameters

$idartlang

int

Language specific ID of the arcticle

Get multi-language day

getCanonicalDay(int $iDay) : string

Parameters

$iDay

int

The day number of date(w)

Returns

stringDayname of current language

Returns multi-language month name (canonical) by its numeric value

getCanonicalMonth(int $month) : string

Parameters

$month

int

Returns

string

getClientName()

getClientName($idclient) 
deprecated [2012-06-21] Use cApiClientCollection->getClientname()

Parameters

$idclient

Returns the current effective setting for a property.

getEffectiveSetting(string $type, string $name, string $default) : mixed

The order is: System => Client => Group => User

System properties can be overridden by the group, and group properties can be overridden by the user.

Parameters

$type

string

The type of the item

$name

string

The name of the item

$default

string

Optional default value

Returns

mixedboolean false if nothing was found

Returns the current effective settings for a type of properties.

getEffectiveSettingsByType(string $type) : array

The order is: System => Client => Group => User

System properties can be overridden by the group, and group properties can be overridden by the user.

Parameters

$type

string

The type of the item

Returns

arrayValue

getFileExtension()

getFileExtension($filename) 
deprecated [2012-06-20] Use getFileType() from functions.file.php

Parameters

$filename

getGroupOrUserName()

getGroupOrUserName($uid) 

Parameters

$uid

Returns the id of passed area

getIDForArea(int | string $area) : int

Parameters

$area

intstring

Area name or id

Returns

intstring

Returns all languages (language ids and names) of an client

getLanguageNamesByClient(int $client) : array

Parameters

$client

int

Returns

arrayList of languages where the key is the language id and value the language name

Returns list of languages (language ids) by passed client.

getLanguagesByClient(int $client) : array

Parameters

$client

int

Returns

array

Returns the name of the numeric frame given

getNamedFrame(int $frame) : string

Parameters

$frame

int

Frame number

Returns

stringCanonical name of the frame

Returns the parent id of passed area

getParentAreaId(mixed $area) : int

Parameters

$area

mixed

Returns

int

getPhpModuleInfo()

getPhpModuleInfo($moduleName) 
deprecated [2012-03-10] This function is not longer supported.

Parameters

$moduleName

Retrieves all available system properties.

getSystemProperties(bool $bGetPropId) : array

Array format:

$array[$type][$name] = $value;

modified Timo Trautmann 22.02.2008 Support for editing name and type editing by primaray key idsystemprop if bGetPropId is set: $array[$type][$name][value] = $value; $array[$type][$name][idsystemprop] = $idsystemprop;

Parameters

$bGetPropId

bool

If true special mode is activated which generates for each property a third array, which also contains idsystemprop value

Returns

array

Gets system property entries

getSystemPropertiesByType(string $type) : array

Parameters

$type

string

The type of the properties

Returns

arrayAssoziative array like $arr[name] = value

Gets a system property entry

getSystemProperty(string $type, string $name) : string

Parameters

$type

string

The type of the item

$name

string

The name of the item

Returns

stringbool property value or false if nothing was found

getmicrotime()

getmicrotime() 

htmldecode()

htmldecode($string) 

Parameters

$string

humanReadableSize()

humanReadableSize($number) 

Parameters

$number

human_readable_size()

human_readable_size($number) 
deprecated [2012-08-02] Use humanReadableSize() instead

Parameters

$number

Includes plugins for a given entity.

includePlugins($entity) 

Parameters

$entity

Name of the directory to scan

IP match

ipMatch(string $network, string $mask, string $ip) : boolean

Parameters

$network

string

$mask

string

$ip

string

Returns

boolean

Checks if a value is alphanumeric

isAlphanumeric(mixed $test, bool $umlauts) : bool

Parameters

$test

mixed

Value to test

$umlauts

bool

[Use german Umlaute] Optional

Returns

boolValue is alphanumeric

Checks if an article is assigned to multiple categories

isArtInMultipleUse(int $idart) : bool

Parameters

$idart

int

Article-Id

Returns

boolArticle assigned to multiple categories

isGroup()

isGroup($uid) 

Parameters

$uid

isImageMagickAvailable()

isImageMagickAvailable() 
deprecated [2012-06-21] Use capiIsImageMagickAvailable() from functions.api.images.php

Checks if the script is being runned from the web

isRunningFromWeb() : bool

Returns

boolTrue if the script is running from the web

Returns wether a string is UTF-8 encoded or not

isUtf8(string $input) : bool

Parameters

$input

string

Returns

bool

Checks if passed email address is valid or not

isValidMail(string $email, bool $strict) 

Parameters

$email

string

$strict

bool

No more used!

is_alphanumeric()

is_alphanumeric($test, $umlauts) 
deprecated [2012-08-02] Use isAlphanumeric() instead

Parameters

$test

$umlauts

is_dbfs()

is_dbfs($file) 
deprecated [2012-06-20] Use cApiDbfs::isDbfs()

Parameters

$file

is_utf8()

is_utf8($input) 
deprecated [2012-08-02] Use isUtf8() instead

Parameters

$input

locale_arsort()

locale_arsort($locale, $array) 
deprecated [2012-08-02] Use cArray::sortWithLocale() instead

Parameters

$locale

$array

Write JavaScript to mark

markSubMenuItem(int $menuitem, bool $return) 

Parameters

$menuitem

int

Which menuitem to mark

$return

bool

Return or echo script

notifyOnError()

notifyOnError($errortitle, $errormessage) 
deprecated 2012-09-04 Use cWarning or the like.

Parameters

$errortitle

$errormessage

recursive_copy()

recursive_copy($from_path, $to_path) 
deprecated [2012-06-20] Use getFileType() from functions.file.php

Parameters

$from_path

$to_path

rereadClients()

rereadClients() 
deprecated no longer needed

Scans a given plugin directory and places the found plugins into the array $cfg['plugins'].

scanPlugins(string $entity) : void

Result: $cfg['plugins']['frontendusers'] => array with all found plugins

Note: Plugins are only "found" if the following directory structure if found:

entity/ plugin1/plugin1.php plugin2/plugin2.php

The plugin's directory and file name have to be the same, otherwise the function won't find them!

Parameters

$entity

string

Name of the directory to scan

Function checks current language and client settings by HTTP-Params and DB settings.

sendEncodingHeader(\cDb $db, array $cfg, int $lang, string $contentType) 

Based on this informations it will send an HTTP header for right encoding.

Parameters

$db

\cDb

NO MORE NEEDED

$cfg

array

Global cfg-array

$lang

int

Global language id

$contentType

string

Mime type

sendPostRequest()

sendPostRequest($host, $path, $data, $referer, $port) 
deprecated 2011-08-23 This function is not supported any longer

Parameters

$host

$path

$data

$referer

$port

Set a default article specification

setArtspecDefault(int $idartspec) : void

While creating a new article this defined article specification will be default setting

Parameters

$idartspec

int

Article specification id

Set article specifications online

setArtspecOnline(int $idartspec, int $online) : void

Flag to switch if an article specification should be shown the frontend or not

Parameters

$idartspec

int

article specification id

$online

int

0/1 switch the status between on an offline

setHelpContext()

setHelpContext($area) 

Parameters

$area

Sets a system property entry

setSystemProperty(string $type, string $name, string $value, int $idsystemprop) 
modified Timo Trautmann 22.02.2008 Support for editing name and type

Parameters

$type

string

The type of the item

$name

string

The name of the item

$value

string

The value of the item

$idsystemprop

int

The sysprop id, use optional. If set it allows to modify type name and value

Adds slashes to passed string if PHP setting for magic quotes is disabled

set_magic_quotes_gpc(string $code) 

Parameters

$code

string

String by reference

showLocation()

showLocation($area) 
deprecated [2011-09-02] This function is not supported any longer

Parameters

$area

showTable()

showTable($tablename) 
deprecated [2011-08-23] This function is not supported any longer

Parameters

$tablename

Starts the timing for a specific function

startTiming(string $function, array $parameters) : int

Parameters

$function

string

Name of the function

$parameters

array

All parameters for the function to measure

Returns

intuuid for this measure process

str_ireplace_once()

str_ireplace_once($find, $replace, $subject) 
deprecated [2012-08-02] Use cString::iReplaceOnce() instead

Parameters

$find

$replace

$subject

str_ireplace_once_reverse()

str_ireplace_once_reverse($find, $replace, $subject) 
deprecated [2012-08-02] Use cString::iReplaceOnceReverse() instead

Parameters

$find

$replace

$subject

str_rpos()

str_rpos($haystack, $needle, $start) 
deprecated [2012-08-02] Use cString::posReverse() instead

Parameters

$haystack

$needle

$start

trim_array()

trim_array($array) 
deprecated [2012-08-02] Use cArray::trim() instead

Parameters

$array

Loads the client information from the database and stores it in config.client.php.

updateClientCache(\number $idclient, string $htmlpath, string $frontendpath) 

Reinitializes the $cfgClient array and fills it wih updated information if provided.

Parameters

$idclient

\number

client id which will be updated

$htmlpath

string

new HTML path. Starting with "http://"

$frontendpath

string

path the to the frontend

Constants

 

$constant

$constant