Functions

IP_match

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

Parameters

$network

string

$mask

string

$ip

string

Returns

boolean

SaveKeywordsforart()

SaveKeywordsforart($keycode, $idart, $place, $lang) 

deprecated since 22.08.2005 This function is called everytime when the code of an article is generated. In this case indexing can cause performance problems. Indexing an article is treated now in function conSaveContentEntry.

Parameters

$keycode

$idart

$place

$lang

_error_report()

_error_report($error) 

Parameters

$error

add new article specification

addArtspec(string $artspectext, $online) : void

Parameters

$artspectext

string

article specification text

$online

Adds slashes to passed variable

addslashes_deep(mixed $value) : array

Parameters

$value

mixed

Either a string or a multi-dimensional array of values

Returns

array

array_csort()

array_csort() 

array_search_recursive()

array_search_recursive($search, $array, $partial, $strict) 

Parameters

$search

$array

$partial

$strict

Redirect to main area

backToMainArea(bool $send) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$send

bool

Redirect Yes/No

Build a Article select Box

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

Parameters

$sName

String

Name of the SelectBox

$iIdCat

String

Value of the SelectBox

$sValue

Returns

StringHTML

Build a Category / Article select Box

buildCategorySelect(String $sName, String $sValue, Integer $sLevel, String $sStyle) : String

Parameters

$sName

String

Name of the SelectBox

$sValue

String

Value of the SelectBox

$sLevel

Integer

Value of highest level that should be shown

$sStyle

String

Optional style informations for select

Returns

StringHTML

Build a Category select Box containg all categories which user is allowed to create new categories

buildCategorySelectRights() : String

Returns

StringHTML

Deletes existing heap table (table in memory) and creates it.

buildHeapTable(string $sHeapTable, \DB_Contenido $db) : void

Parameters

$sHeapTable

string

Table name

$db

\DB_Contenido

Database object

buildTree()

buildTree($rootItem, $items) 

Parameters

$rootItem

$items

Builds user/group permissions (sysadmin, admin, client and language) by processing request variables ($msysadmin, $madmin, $mclient, $mlang) and returns the build permissions array.

buildUserOrGroupPermsFromRequest(bool $bAddUserToClient) : array

todo Do we really need to add other perms, if the user/group gets the 'sysadmin' permission?

Parameters

$bAddUserToClient

bool

Flag to add current user to current client, if no client is specified.

Returns

array

cDie: Contenido die-alternative

cDie(\$file $file, \$line $line, \$message $message) 

Parameters

$file

\$file

File name (use FILE)

$line

\$line

Line number (use LINE)

$message

\$message

Message to display

cError: Contenido error

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

Parameters

$file

\$file

File name (use FILE)

$line

\$line

Line number (use LINE)

$message

\$message

Message to display

cIDNADecode()

cIDNADecode($targetEncoding, $string) 

Parameters

$targetEncoding

$string

cIDNAEncode()

cIDNAEncode($sourceEncoding, $string) 

Parameters

$sourceEncoding

$string

Shortcut to contenido_include.

cInclude(string $sWhere, string $sWhat, bool $bForce) : void

see \contenido_include

Parameters

$sWhere

string

The area which should be included

$sWhat

string

The filename of the include

$bForce

bool

If true, force the file to be included

cInitializeArrayKey()

cInitializeArrayKey($aArray, $sKey, $mDefault) 

Parameters

$aArray

$sKey

$mDefault

cWarning: Contenido warning

cWarning(\$file $file, \$line $line, \$message $message) 

Parameters

$file

\$file

File name (use FILE)

$line

\$line

Line number (use LINE)

$message

\$message

Message to display

callPluginStore: Calls the plugin's store methods

callPluginStore(\$entity $entity) 

Example: callPluginStore("frontendusers");

Parameters

$entity

\$entity

Name of the directory to scan

capiImgScale: Scales (or crops) an image.

capiImgScale(string $img, int $maxX, int $maxY, boolean $crop, boolean $expand, int $cacheTime, boolean $wantHQ, int $quality, boolean $keepType) : string: string

If scaling, the aspect ratio is maintained.

This function chooses the best method to scale, depending on the system environment and/or the parameters.

Returns the path to the scaled temporary image.

Note that this function does some very poor caching; it calculates an md5 hash out of the image plus the maximum X and Y sizes, and uses that as the file name. If the file is older than 10 minutes, regenerate it.

Parameters

$img

string

The path to the image (relative to the frontend)

$maxX

int

The maximum size in x-direction

$maxY

int

The maximum size in y-direction

$crop

boolean

If true, the image is cropped and not scaled.

$expand

boolean

If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

$cacheTime

int

The number of minutes to cache the image, use 0 for unlimited

$wantHQ

boolean

If true, try to force high quality mode

$quality

int

The quality of the output file

$keepType

boolean

If true and a png file is source, output file is also png

Returns

string!!!URL!!! to the resulting image (http://...)
stringPath to the resulting image

capiImgScaleGetMD5CacheFile: Returns the MD5 Filename used for caching.

capiImgScaleGetMD5CacheFile($sImg, $iMaxX, $iMaxY, $bCrop, $bExpand) : string

Parameters

$sImg

$iMaxX

$iMaxY

$bCrop

$bExpand

Returns

stringPath to the resulting image

capiImgScaleHQ: Scales (or crops) an image in high quality.

capiImgScaleHQ(string $img, int $maxX, int $maxY, boolean $crop, boolean $expand, int $cacheTime, int $quality, boolean $keepType) : string

If scaling, the aspect ratio is maintained.

Note: GDLib 2.x is required!

Returns the path to the scaled temporary image.

Note that this function does some very poor caching; it calculates an md5 hash out of the image plus the maximum X and Y sizes, and uses that as the file name. If the file is older than the specified cache time, regenerate it.

Parameters

$img

string

The path to the image (relative to the frontend)

$maxX

int

The maximum size in x-direction

$maxY

int

The maximum size in y-direction

$crop

boolean

If true, the image is cropped and not scaled.

$expand

boolean

If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

$cacheTime

int

The number of minutes to cache the image, use 0 for unlimited

$quality

int

The quality of the output file

$keepType

boolean

If true and a png file is source, output file is also png

Returns

string!!!URL!!! to the resulting image (http://...)

capiImgScaleImageMagick: Scales (or crops) an image using ImageMagick.

capiImgScaleImageMagick(string $img, int $maxX, int $maxY, boolean $crop, boolean $expand, int $cacheTime, int $quality, boolean $keepType) : string

If scaling, the aspect ratio is maintained.

Note: ImageMagick is required!

Returns the path to the scaled temporary image.

Note that this function does some very poor caching; it calculates an md5 hash out of the image plus the maximum X and Y sizes, and uses that as the file name. If the file is older than the specified cache time, regenerate it.

Parameters

$img

string

The path to the image (relative to the frontend)

$maxX

int

The maximum size in x-direction

$maxY

int

The maximum size in y-direction

$crop

boolean

If true, the image is cropped and not scaled.

$expand

boolean

If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

$cacheTime

int

The number of minutes to cache the image, use 0 for unlimited

$quality

int

The quality of the output file

$keepType

boolean

If true and a png file is source, output file is also png

Returns

string!!!URL!!! to the resulting image (http://...)

capiImgScaleLQ: Scales (or crops) an image.

capiImgScaleLQ(string $img, int $maxX, int $maxY, boolean $crop, boolean $expand, int $cacheTime, int $quality, boolean $keepType) : string

If scaling, the aspect ratio is maintained.

Returns the path to the scaled temporary image.

Note that this function does some very poor caching; it calculates an md5 hash out of the image plus the maximum X and Y sizes, and uses that as the file name. If the file is older than 10 minutes, regenerate it.

Parameters

$img

string

The path to the image (relative to the frontend)

$maxX

int

The maximum size in x-direction

$maxY

int

The maximum size in y-direction

$crop

boolean

If true, the image is cropped and not scaled.

$expand

boolean

If true, the image is expanded (e.g. really scaled). If false, the image will only be made smaller.

$cacheTime

int

The number of minutes to cache the image, use 0 for unlimited

$quality

int

The quality of the output file

$keepType

boolean

If true and a png file is source, output file is also png

Returns

string!!!URL!!! to the resulting image (http://...

capiStrCleanURLCharacters: Removes or converts all "evil" URL characters.

capiStrCleanURLCharacters(\$sString $sString, \$bReplace $bReplace) : string

This function removes or converts all characters which can make an URL invalid.

Clean characters include: - All characters between 32 and 126 which are not alphanumeric and aren't one of the following: _-.

author Timo A. Hummel
copyright four for business AG, http://www.4fb.de

Parameters

$sString

\$sString

string The string to operate on

$bReplace

\$bReplace

string If true, all "unclean" characters are replaced

Returns

stringThe resulting string

capiStrRecodeString: Converts a string to another encoding.

capiStrRecodeString(\$sString $sString, \$targetEncoding $sourceEncoding, \$sourceEncoding $targetEncoding) : string

This function tries to detect which function to use (either recode or iconv).

If $sourceEncoding and $targetEncoding are the same, this function returns immediately.

For more information about encodings, refer to http://en.wikipedia.org/wiki/Character_encoding

For more information about the supported encodings in recode, refer to http://www.delorie.com/gnu/docs/recode/recode_toc.html

Note: depending on whether recode or iconv is used, the supported charsets differ. The following ones are commonly used and are most likely supported by both converters:

  • ISO-8859-1 to ISO-8859-15
  • ASCII
  • UTF-8

todo Check if the charset names are the same for both converters
todo Implement a converter and charset checker to ensure compilance.
author Timo A. Hummel
copyright four for business AG, http://www.4fb.de

Parameters

$sString

\$sString

string The string to operate on

$sourceEncoding

\$targetEncoding

string The target encoding (if false, use source encoding)

$targetEncoding

\$sourceEncoding

string The source encoding (default: ISO-8859-1)

Returns

stringThe resulting string

capiStrReplaceDiacritics: Converts diactritics to english characters whenever possible.

capiStrReplaceDiacritics(\$sString $sString, \$sourceEncoding $sourceEncoding, $targetEncoding) : string

For german umlauts, this function converts the umlauts to their ASCII equalients (e.g. ä => ae).

For more information about diacritics, refer to http://en.wikipedia.org/wiki/Diacritic

For other languages, the diacritic marks are removed, if possible.

author Timo A. Hummel
copyright four for business AG, http://www.4fb.de

Parameters

$sString

\$sString

string The string to operate on

$sourceEncoding

\$sourceEncoding

string The source encoding (default: ISO-8859-1)

$targetEncoding

Returns

stringThe resulting string

capiStrTrimAfterWord: Trims a string to a given length and makes sure that all words up to $maxlen are preserved, without exceeding $maxlen.

capiStrTrimAfterWord(\$string $string, \$maxlen $maxlen) : string

Warning: Currently, this function uses a regular ASCII-Whitespace to do the seperation test. If you are using '&nbsp' to create spaces, this function will fail.

Example: $string = "This is a simple test"; echo capiStrTrimAfterWord ($string, 15);

This would output "This is a", since this function respects word boundaries and doesn't operate beyond the limit given by $maxlen.

Parameters

$string

\$string

string The string to operate on

$maxlen

\$maxlen

int The maximum number of characters

Returns

stringThe resulting string

capiStrTrimHard: Trims a string to a specific length. If the string is longer than $maxlen, dots are inserted ("...") right before $maxlen.

capiStrTrimHard(\$string $string, \$maxlen $maxlen, $fillup) : string

Example: $string = "This is a simple test"; echo capiStrTrimHard ($string, 15);

This would output "This is a si...", since the string is longer than $maxlen and the resulting string matches 15 characters including the dots.

Parameters

$string

\$string

string The string to operate on

$maxlen

\$maxlen

int The maximum number of characters

$fillup

Returns

stringThe resulting string

capiStrTrimSentence: Trims a string to a approximate length. Sentence boundaries are preserved.

capiStrTrimSentence(\$string $string, \$approxlen $approxlen, \$hard $hard) : string

The algorythm inside calculates the sentence length to the previous and next sentences. The distance to the next sentence which is smaller will be taken to trim the string to match the approximate length parameter.

Example:

$string = "This contains two sentences. "; $string .= "Lets play around with them. ";

echo capiStrTrimSentence($string, 40); echo capiStrTrimSentence($string, 50);

The first example would only output the first sentence, the second example both sentences.

Explanation:

To match the given max length closely, the function calculates the distance to the next and previous sentences. Using the maxlength of 40 characters, the distance to the previous sentence would be 8 characters, and to the next sentence it would be 19 characters. Therefore, only the previous sentence is displayed.

The second example displays the second sentence also, since the distance to the next sentence is only 9 characters, but to the previous it is 18 characters.

If you specify the boolean flag "$hard", the limit parameter creates a hard limit instead of calculating the distance.

This function ensures that at least one sentence is returned.

Parameters

$string

\$string

string The string to operate on

$approxlen

\$approxlen

int The approximate number of characters

$hard

\$hard

boolean If true, use a hard limit for the number of characters (default: false)

Returns

stringThe resulting string

capiCatGetLevelNode: Seeks through the category tree and returns the node on a specific level.

capi_cat_getlevelnode(\$int $idcat, \$minLevel $minLevel) : int

Example:

  • Category A (15) |-+ News (16) | |- News A (17)
  • Category B (18) |-+ Internal (19)

Given you are in the leaf "News A" (idcat 17), and you want to get out in which "main" tree you are, you can call the function like this:

capi_cat_getlevelnode(17,1);

The example would return "Category A" (idcat 15). If you specify an invalid level, the results are undefined.

Parameters

$idcat

\$int

idcat The category number

$minLevel

\$minLevel

int The level to extract

Returns

intThe category node on a specific level

check possible image editing functionality

checkImageEditingPosibility() 

return mixed information about installed image editing extensions/tools

Function checks if a language is associated with a given list of clients Fixed CON-200

checkLangInClients(array $aClients, integer $iLang, array $aCfg, object $oDb) : boolean

Parameters

$aClients

array
  • array of clients to check

$iLang

integer
  • language id which should be checked

$aCfg

array
  • Contenido configruation array

$oDb

object
  • Contenido database object

Returns

boolean- status (if language id corresponds to list of clients true otherwise false)

checkMySQLConnectivity()

checkMySQLConnectivity() 

must be done

checkPathInformation(string $strConUrl, string $strBrowserUrl) : string

must be done

Parameters

$strConUrl

string

contenido fullhtmlPath

$strBrowserUrl

string

current browser string

Returns

stringstatus of path comparement

cleanupSessions()

cleanupSessions() 

check path informations

compareUrlStrings($arrConUrl, $arrBrowserUrl, $isIP) 

checks two path informations against each other to get potential nonconformities

Parameters

$arrConUrl

$arrBrowserUrl

$isIP

Change the template of a category

conChangeTemplateForCat(int $idcat, int $idtpl) : void

author Jan Lengowski
copyright four for business AG <www.4fb.de>

Parameters

$idcat

int

Category Id

$idtpl

int

Template Id

conCopyArtLang()

conCopyArtLang($srcidart, $dstidart, $newtitle, $bUseCopyLabel) 

Parameters

$srcidart

$dstidart

$newtitle

$bUseCopyLabel

conCopyArticle()

conCopyArticle($srcidart, $targetcat, $newtitle, $bUseCopyLabel) 

Parameters

$srcidart

$targetcat

$newtitle

$bUseCopyLabel

conCopyContainerConf()

conCopyContainerConf($srcidtplcfg, $dstidtplcfg) 

Parameters

$srcidtplcfg

$dstidtplcfg

conCopyContent()

conCopyContent($srcidartlang, $dstidartlang) 

Parameters

$srcidartlang

$dstidartlang

conCopyTemplateConfiguration()

conCopyTemplateConfiguration($srcidtplcfg) 

Parameters

$srcidtplcfg

Recursive function to create an location string

conCreateLocationString(int $idcat, string $seperator, string $cat_str, boolean $makeLink, string $linkClass, integer $firstTreeElementToUse, $uselang, $final, $usecache) : string

author Jan Lengowski
author Marco Jahn
copyright four for business AG <www.4fb.de>

Parameters

$idcat

int

ID of the starting category

$seperator

string

Seperation string

$cat_str

string

Category location string (by reference)

$makeLink

boolean

create location string with links

$linkClass

string

stylesheet class for the links

$firstTreeElementToUse

integer

first navigation level location string should be printed out (first level = 0!!)

$uselang

$final

$usecache

Returns

stringlocation string

Fetch all deeper categories by a given id

conDeeperCategoriesArray($idcat_start) : array

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idcat_start

Returns

arrayArray with all deeper categories

Delete an Article

conDeleteart(int $idart) 

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idart

int

Article Id

Edit an existing article

conEditArt(mixed $idcat, $idcatnew, $idart, $is_start, $idtpl, $idartlang, $idlang, $title, $summary, $artspec, $created, $lastmodified, $author, $online, $datestart, $dateend, $artsort, $keyart) : void

author Olaf Niemann
copyright four for business AG <www.4fb.de>

Parameters

$idcat

mixed

many

$idcatnew

$idart

$is_start

$idtpl

$idartlang

$idlang

$title

$summary

$artspec

$created

$lastmodified

$author

$online

$datestart

$dateend

$artsort

$keyart

Create a new Article

conEditFirstTime(mixed $idcat, $idcatnew, $idart, $is_start, $idtpl, $idartlang, $idlang, $title, $summary, $artspec, $created, $lastmodified, $author, $online, $datestart, $dateend, $artsort, $keyart) : int

author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$idcat

mixed

many

$idcatnew

$idart

$is_start

$idtpl

$idartlang

$idlang

$title

$summary

$artspec

$created

$lastmodified

$author

$online

$datestart

$dateend

$artsort

$keyart

Returns

intId of the new article

conFetchCategoryTree()

conFetchCategoryTree($client, $lang) 

Parameters

$client

$lang

Set articles on/offline for the time management function

conFlagOnOffline() 

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Generates the code for one article

conGenerateCode(int $idcat, int $idart, int $lang, int $client, int $layout) 

author Jan Lengowski
copyright four for business AG <www.4fb.de>

Parameters

$idcat

int

Id of category

$idart

int

Id of article

$lang

int

Id of language

$client

int

Id of client

$layout

int

Layout-ID of alternate Layout (if false, use associated layout)

Create code for all articles

conGenerateCodeForAllArts() 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Generate code for all articles in a category

conGenerateCodeForAllArtsInCategory(int $idcat) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idcat

int

Category ID

Generate code for all articles using one template

conGenerateCodeForAllArtsUsingTemplate(int $idtpl) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idtpl

int

Template-Id

Create code for all arts using the same layout

conGenerateCodeForAllartsUsingLayout(int $idlay) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idlay

int

Layout-ID

Create code for all articles using the same module

conGenerateCodeForAllartsUsingMod(int $idmod) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idmod

int

Module id

Create code for one article in all categorys

conGenerateCodeForArtInAllCategories(int $idart) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idart

int

Article ID

Generate code for the active client

conGenerateCodeForClient() 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

(re)generate keywords for all articles of a given client (with specified language)

conGenerateKeywords(\$client $client, \$lang $lang) : void

author Willi Man Created : 12.05.2004 Modified : 13.05.2004
copyright four for business AG 2003

Parameters

$client

\$client

Client

$lang

\$lang

Language of a client

Returns all available meta tag types

conGetAvailableMetaTagTypes() 

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Returns all categories in which the given article is in.

conGetCategoryAssignments(\idart $idart, \db $db) : array

Parameters

$idart

\idart

int Article ID

$db

\db

object Optional; if specified, uses the given db object

Returns

arrayFlat array which contains all category id's

get content from article

conGetContentFromArticle(\$article_lang $article_lang) : array

author Willi Man Created : 12.05.2004 Modified : 13.05.2004
copyright four for business AG 2003

Parameters

$article_lang

\$article_lang

ArticleLanguageId of an article (idartlang)

Returns

arrayArray with content of an article indexed by content-types

Get the meta tag value for a specific article

conGetMetaValue(\$idartlang $idartlang, \$idmetatype $idmetatype) 

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Parameters

$idartlang

\$idartlang

ID of the article

$idmetatype

\$idmetatype

Metatype-ID

conGetTopmostCat()

conGetTopmostCat($idcat, $minLevel) 

Parameters

$idcat

$minLevel

Toggle the lock status of an article

conLock(int $idart, \ing $lang) 

Parameters

$idart

int

Article Id

$lang

\ing

Language Id

generate index of article content

conMakeArticleIndex($idartlang, integer $idart) 

added by stese removed from function conSaveContentEntry before Touch the article to update last modified date

see \conSaveContentEntry

Parameters

$idartlang

$idart

integer

Toggle the online status of a category

conMakeCatOnline(int $idcat, int $lang, int $status) 

author Jan Lengowski
copyright four for business AG <www.4fb.de>

Parameters

$idcat

int

id of the category

$lang

int

id of the language

$status

int

status of the category

Toggle the online status of an article

conMakeOnline(int $idart, \ing $lang) 

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idart

int

Article Id

$lang

\ing

Language Id

Toggle the public status of a category

conMakePublic(int | int $idcat, $lang, $public) 

Almost the same function as strMakePublic in functions.str.php (conDeeperCategoriesArray instead of strDeeperCategoriesArray)

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idcat

intint

Article Id

$lang

$public

Set a start-article

conMakeStart(int $idcatart, $is_start) : void

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idcatart

int

Idcatart of the article

$is_start

Move articles for the time management function

conMoveArticles() 

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Save a content element and generate index

conSaveContentEntry(integer $idartlang, string $type, integer $typeid, string $value, $bForce) : void

author Olaf Niemann <olaf.niemann@4fb.de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idartlang

integer

idartlang of the article

$type

string

Type of content element

$typeid

integer

Serial number of the content element

$value

string

Content

$bForce

Set code creation flag to true

conSetCodeFlag(int $idcatart) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG 2003

Parameters

$idcatart

int

Contenido Category-Article-ID

Set the meta tag value for a specific article

conSetMetaValue(\$idartlang $idartlang, \$idmetatype $idmetatype, \$value $value) 

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Parameters

$idartlang

\$idartlang

ID of the article

$idmetatype

\$idmetatype

Metatype-ID

$value

\$value

Value of the meta tag

conSyncArticle()

conSyncArticle($idart, $srclang, $dstlang) 

Parameters

$idart

$srclang

$dstlang

Includes a file and takes care of all path transformations.

contenido_include(string $sWhere, string $sWhat, bool $bForce, string $bReturnPath) : void

Example: contenido_include('classes', 'class.backend.php');

Currently defined areas:

frontend Path to the current frontend conlib Path to conlib pear Path to the bundled pear copy classes Path to the contenido classes (see NOTE below) cronjobs Path to the cronjobs external Path to the external tools includes Path to the contenido includes scripts Path to the contenido scripts

NOTE: Since Contenido (since v 4.8.15) provides autoloading of required class files, there is no need to load Contenido class files of by using contenido_include() or cInclude().

Parameters

$sWhere

string

The area which should be included

$sWhat

string

The filename of the include

$bForce

bool

If true, force the file to be included

$bReturnPath

string

Flag to return the path instead of including the file

Duplicate rights for any element

copyRightsForElement(string $area, int $iditem, int $newiditem, int $idlang) 

author Martin Horwath
copyright dayside.net <dayside.net>

Parameters

$area

string

main area name

$iditem

int

ID of element to copy

$newiditem

int

ID of the new element

$idlang

int

ID of lang parameter

Creates a file.

createFile(string $filename, string $path) : \(void | \bool)

Exits the script, if filename is not valid or creation (touch or chmod) fails!

Parameters

$filename

string

The file to create

$path

string

Path to the file

Returns

\(void\bool)Either true on success or nothing

createRandomName: Creates a random name (example: Passwords)

createRandomName(\$nameLength $nameLength) : string

Example: echo createRandomName(8);

Parameters

$nameLength

\$nameLength

Length of the generated string

Returns

stringrandom name

Create rights for any element

createRightsForElement(string $area, int $iditem, int $idlang) 

author Martin Horwath
copyright dayside.net <dayside.net>

Parameters

$area

string

main area name

$iditem

int

ID of new element

$idlang

int

ID of lang parameter

dbDumpArea()

dbDumpArea($db, $id) 

deprecated
since 2008-07-11

Parameters

$db

$id

dbDumpAreasAsArray()

dbDumpAreasAsArray($arrayname, $db) 

deprecated
since 2008-07-11

Parameters

$arrayname

$db

dbDumpData()

dbDumpData($table) 

deprecated
since 2008-07-11

Parameters

$table

dbDumpNavSub()

dbDumpNavSub($arrayname, $db, $nextidarea) 

deprecated
since 2008-07-11

Parameters

$arrayname

$db

$nextidarea

dbDumpStructure()

dbDumpStructure($db, $table, $return) 

deprecated
since 2008-07-11

Parameters

$db

$table

$return

Returns the column structure of a table

dbGetColumns(\DB_Contenido $db, string $table) : array | bool

Parameters

$table

string

Returns

arrayboolEither assoziative column array or false

Returns existing indexes of a specific table.

dbGetIndexes(\DB_Contenido $db, string $table) : array

Parameters

$table

string

Returns

arrayAssoziative array where the key and the value is the index name

Returns the primary key column of a table

dbGetPrimaryKeyName(\DB_Contenido $db, string $table) : string

Parameters

$table

string

Returns

string

dbInsertData()

dbInsertData($table, $data) 

deprecated
since 2008-07-11

Parameters

$table

$data

Checks, if passed table exists in the database

dbTableExists(\DB_Contenido $db, string $table) : bool

Parameters

$table

string

Returns

bool

Updates the sequence table, stores the highest primary key value of a table in it.

dbUpdateSequence(string $sequencetable, string $table, \DB_Contenido | bool $db) 

Retrieves the primary key field of the table, retrieves the highes value and saves the value in the sequence table.

Parameters

$sequencetable

string

Name of sequence table

$table

string

Name of table

$db

\DB_Contenidobool

Database instance or false

dbUpgradeData()

dbUpgradeData($table, $valuesArray) 

deprecated
since 2008-07-11

Parameters

$table

$valuesArray

Updates a specific table. Used e. g. by Contenido setup to create or update tables.

dbUpgradeTable(\DB_Contenido $db, string $table, string $field, string $type, string $null, string $key, string $default, string $extra, string $upgradeStatement, bool $bRemoveIndexes) : bool

Function logic: 1 .) Check, if the table exists 2a.) If not, create it with the field specification, exit 2b.) If the table exists, check, if the field exist 3 .) If not, try to find the field using previous names (if specified in $field like "name1,name2") 4a.) If the field hasn't been found, create the field as specified, exit 4b.) If the field has been found using a previous name (if specified) rename the column to $field 5 .) As the field has been found, check, if the field's type is matching 5a.) If the type is matching, exit 5b.) If the field's content type is not matching, try to convert first (e.g. string to int or int to string), then use the upgrade statement if applicable

Note about the upgrade statement: - the code must be eval'able - the code needs to read $oldVal (old field value) and needs to set $newVal (value to which the field will be set) - $oldVal might be empty if the field didn't exist - $tableValues['fieldname'] contains the already existing values

Parameters

$db

\DB_Contenido

Database instance

$table

string

Name of table to create/update

$field

string

Name of field to create/update

$type

string

Data type of field. Feasible values are all possible data types e. g. int(10), varchar(32), datetime, varchar(255), text, tinyint(1)

$null

string

Parameter to forbid null values, feasible values "", "NULL" or "YES" where "NULL" or "YES" allows null values and "" doesn't

$key

string

The field will be added as a primary key, if value is "PRI", otherwhise the value should be empty ""

$default

string

The default value for the field. Feasible is each possible value depending on passed $type

$extra

string

Additional info for the field, e. g. "auto_increment", if the field should have the AUTO_INCREMENT attribute and empty otherwise.

$upgradeStatement

string

NOT USED AT THE MOMENT

$bRemoveIndexes

bool

Flag to remove all indexes

Returns

bool

define_if()

define_if($constant, $value) 

Parameters

$constant

$value

delete specified article specification

deleteArtspec(integer $idartspec) : void

Parameters

$idartspec

integer

article specification id

Delete rights for any element

deleteRightsForElement(string $area, int $iditem, int $idlang) 

author Martin Horwath
copyright dayside.net <dayside.net>

Parameters

$area

string

main area name

$iditem

int

ID of new element

$idlang

int

ID of lang parameter

Remove a system property entry

deleteSystemProperty(string $type, string $name) 

Parameters

$type

string

The type of the item

$name

string

The name of the item

displayFiles()

displayFiles($aFiles, $aSelected, $oForm, $sCaption, $sField, $sDisabled) 

Parameters

$aFiles

$aSelected

$oForm

$sCaption

$sField

$sDisabled

displayPlugin()

displayPlugin($entity, $form) 

Parameters

$entity

$form

domxml_new_doc()

domxml_new_doc($version) 

Parameters

$version

domxml_new_xmldoc()

domxml_new_xmldoc($version) 

Parameters

$version

domxml_open_file()

domxml_open_file($filename, $mode, $error) 

Parameters

$filename

$mode

$error

domxml_open_mem()

domxml_open_mem($str, $mode, $error) 

Parameters

$str

$mode

$error

domxml_xslt_stylesheet()

domxml_xslt_stylesheet($xslstring) 

Parameters

$xslstring

domxml_xslt_stylesheet_doc()

domxml_xslt_stylesheet_doc($dom_document) 

Parameters

$dom_document

domxml_xslt_stylesheet_file()

domxml_xslt_stylesheet_file($xslfile) 

Parameters

$xslfile

emptyLogFile - clears errorlog.txt

emptyLogFile() : string

clears Contenido standard errorlog.txt

author Marco Jahn

Returns

stringreturns message if clearing was successfull or not

endAndLogTiming: Ends the timing process and logs it to the timings file

endAndLogTiming(\uuid $uuid) 

Parameters

$uuid

\uuid

int UUID which has been used for timing

Extract a number from a string

extractNumber(string $string) 

author Olaf Niemann <olaf.niemann@4fb-de> Jan Lengowski <jan.lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$string

string

String var by reference

fakeheader()

fakeheader($time) 

Parameters

$time

Writes passed data into a file using binary mode.

fileEdit(string $filename, string $sCode, string $path) : \(string | \void)

Exits the script, if file could not opened!

Parameters

$filename

string

The file to write the content

$sCode

string

File content to write

$path

string

Path to the file

Returns

\(string\void)Either content of file o nothing

Validates passed filename. Filename can contain alphanumeric characters, dot, underscore or a hyphen.

fileValidateFilename(string $filename, bool $notifyAndExitOnFailure) : \(void | \bool)

Exits the script, if second parameter is set to true and validation fails!

Parameters

$filename

string

The filename to validate

$notifyAndExitOnFailure

bool

Flag to display notification and to exit further script execution, ifd validation fails

Returns

\(void\bool)Either validation result or nothing (depends on second parameter)

Generates check box elements

formGenerateCheckbox(\$name $name, \$value $value, \$checked $checked, $caption) : \Generated

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$name

\$name

Name of the checkbox

$value

\$value

Value of the checkbox

$checked

\$checked

Initially checked?

$caption

Returns

\Generatedfield code

Generates textial Input Form elements

formGenerateField(\$type $type, \$name $name, \$initvalue $initvalue, \$size $width, \$maxlen $maxlen) : \Generated

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$type

\$type

Either "text", "password" or "textbox"

$name

\$name

Name of the field

$initvalue

\$initvalue

Init value of the field

$width

\$size

Size of the field

$maxlen

\$maxlen

Maximum length of the field

Returns

\Generatedfield code

Function reduces long path names and creates a dynamic tooltipp which shows the full path name on mouseover

generateDisplayFilePath(string $sDisplayPath, int $iLimit) : string

author Timo Trautmann (4fb)

Parameters

$sDisplayPath

string
  • original filepath

$iLimit

int
  • limit of chars which were displayed directly. If the path string is shorter there will be no tooltipp

Returns

string- string, which contains short path name and tooltipp if neccessary

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']

Returns the idartlang for a given article and language

getArtLang(\$idart $idart, \$idlang $idlang) : mixed

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG 2003

Parameters

$idart

\$idart

ID of the article

$idlang

\$idlang

ID of the language

Returns

mixedidartlang of the article or false if nothing was found

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

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG

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: Returns the client name for a given ID

getClientName($idclient) : string

Parameters

$idclient

Returns

stringclient name

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($sType) : 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

$sType

Returns

arrayValue

Returns encoding for language with ID $iLang (global $lang in contenido style).

getEncodingByLanguage(\DB_Contenido $oDb, int $iLang, array $cfg) : string

The parameter $oDb has to be an instance of DB_Contenido (global $db in con) and $cfg is the equivalent to global $cfg array in contenido. If no encoding is found or any parameter is not valid, the function will return false, otherwise the encoding as string like it is stored in database. modified 18.03.2008 - Removed special mySQl behaviour (using db object instead) Timo Trautmann

Parameters

$iLang

int

$cfg

array

Returns

string

getExpandCollapseButton()

getExpandCollapseButton($item, $catName) 

Parameters

$item

$catName

getExpandCollapseButton()

getExpandCollapseButton($item) 

Parameters

$item

Reads content of file into memory using binary mode and returns it back.

getFileContent(string $filename, string $path) : \(string | \void)

Exits the script, if file could not opened!

Parameters

$filename

string

The file to get the content

$path

string

Path to the file

Returns

\(string\void)Either content of file o nothing

getFileExtension Returns the file extension of a given file

getFileExtension(string $filename) : \extension

Parameters

$filename

string

Name of the file

Returns

\extensionon success, false if no extension could be extracted.

Function returns file meta information from database (used when files were versionned or description is displayed)

getFileInformation(integer $iIdClient, string $sFilename, string $sType, object $oDb) : array

author Timo Trautmann

Parameters

$iIdClient

integer
  • id of client which contains this file

$sFilename

string
  • name of corresponding file

$sType

string
  • type of file (css, js or templates)

$oDb

object
  • contenido database object

Returns

arrayIndexes: idsfi - Primary key of database record created - Datetime when file was created lastmodified - Datetime when file was last modified author - Author of file (Contenido Backend User) modifiedby - Last modifier of file (Contenido Backend User) description - Description which was inserted for this file

Returns the filetype (extension).

getFileType(string $filename) : string

Parameters

$filename

string

The file to get the type

Returns

stringFiletype

getFiles()

getFiles($sPath, $sFileType, $sNoti) 

Parameters

$sPath

$sFileType

$sNoti

getGroupOrUserName()

getGroupOrUserName($uid) 

Parameters

$uid

Returns the id of passed area

getIDForArea(mixed $area) : int

Parameters

$area

mixed

Area name

Returns

int

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

getLanguagesByClient()

getLanguagesByClient($client) 

Parameters

$client

getNamedFrame: Returns the name of the numeric frame given

getNamedFrame(\$frame $frame) : string

Parameters

$frame

\$frame

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 - parses phpinfo() output

getPhpModuleInfo(\$modulName $moduleName) : array

parses phpinfo() output (1) get informations for a specific module (parameter $modulname) (2) get informations for all modules (no parameter for $modulname needed)

if a specified extension doesn't exists or isn't activated an array will be returned: Array ( [error] => extension is not available )

to get specified information on one module use (1): getPhpModuleInfo($moduleName = 'gd');

to get all informations use (2): getPhpModuleInfo($moduleName);

EXAMPLE OUTPUT (1): Array ( [GD Support] => Array ( [0] => enabled ) ... )

EXAMPLE OUTPUT (2): Array ( [yp] => Array ( [YP Support] => Array ( [0] => enabled )

    )

... }

foreach ($moduleSettings as $setting => $value) $setting contains the modul settings $value contains the settings as an array ($value[0] => Local Value && $value[1] => Master Value)

author Marco Jahn

Parameters

$moduleName

\$modulName

string specify modul name or if not get all settings

Returns

arraysee above for example

Retrieves all available system properties.

getSystemProperties(boolean $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

boolean

bGetPropId - 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($sType) : array

Parameters

$sType

Returns

arrayValue

Gets a system property entry

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

Parameters

$type

string

The type of the item

$name

string

The name of the item

Returns

mixedboolean false if nothing was found, or

getTemplateSelect()

getTemplateSelect() 

getmicrotime()

getmicrotime() 

html_doc()

html_doc($html_doc, $from_file) 

Parameters

$html_doc

$from_file

html_doc_file()

html_doc_file($filename) 

Parameters

$filename

htmldecode()

htmldecode($string) 

Parameters

$string

Special version of htmlentites for iso-8859-2 Returns transformed string

htmlentities_iso88592(string $sInput) : string

Parameters

$sInput

string

Returns

string

human_readable_size()

human_readable_size($number) 

Parameters

$number

i18n($string)

i18n(\$string $string, \$domain $domain) : string

gettext wrapper (for future extensions). Usage: i18n("Your text which has to be translated");

Parameters

$string

\$string

string The string to translate

$domain

\$domain

string The domain to look up

Returns

stringReturns the translation

i18nEmulateGettext()

i18nEmulateGettext(\$string $string, \$domain $domain) : string

Emulates GNU gettext

Parameters

$string

\$string

string The string to translate

$domain

\$domain

string The domain to look up

Returns

stringReturns the translation

i18nGetAvailableLanguages()

i18nGetAvailableLanguages() : array

Returns the available_languages array to prevent globals.

Returns

arrayAll available languages

i18nInit()

i18nInit(string $localePath, string $langCode) 

Initializes the i18n stuff.

global string $i18nLanguage
global array $i18nDomains

Parameters

$localePath

string

$langCode

string

i18nMatchBrowserAccept($accept)

i18nMatchBrowserAccept($accept) : string

Tries to match the language given by $accept to one of the languages in the system.

Parameters

$accept

Returns

stringThe locale key for the given accept string

i18nRegisterDomain()

i18nRegisterDomain(\$localePath $domain, \$domain $localePath) : string

Registers a new i18n domain.

Parameters

$domain

\$localePath

string Path to the locales

$localePath

\$domain

string Domain to bind to

Returns

stringReturns the translation

i18nStripAcceptLanguages($accept)

i18nStripAcceptLanguages($accept) : array

Strips all unnecessary information from the $accept string. Example: de,nl;q=0.7,en-us;q=0.3 would become an array with de,nl,en-us

Parameters

$accept

Returns

arrayArray with the short form of the accept languages

includePlugins: Includes plugins for a given entity

includePlugins(\$entity $entity) 

Example: includePlugins("frontendusers");

Parameters

$entity

\$entity

Name of the directory to scan

check if gif is animated

isAnimGif(string $sFile) : boolean

Parameters

$sFile

string

file path

Returns

booleantrue (gif is animated)/ false (single frame gif)

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

check for valid ip adress

isIPv4(string $strHostAdress) : boolean

Parameters

$strHostAdress

string

ip adress

Returns

booleanif string is a valid ip or not

isImageMagickAvailable - checks if ImageMagick is available

isImageMagickAvailable() : boolean

Returns

booleantrue if ImageMagick is available

isRunningFromWeb - checks if the script is being runned from the web

isRunningFromWeb() : boolean

Returns

booleantrue if the script is running from the web

isStartArticle()

isStartArticle($idartlang, $idcat, $idlang, $db) 

Parameters

$idartlang

$idcat

$idlang

$db

isValidMail()

isValidMail($sEMail, $bStrict) 

Parameters

$sEMail

$bStrict

Checks if a value is alphanumeric

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

Parameters

$test

mixed

Value to test

$umlauts

bool

[Use german Umlaute] Optional

Returns

boolValue is alphanumeric

is_dbfs()

is_dbfs($file) 

Parameters

$file

Deactivate a language

langActivateDeactivateLanguage($idlang, $active) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idlang

$active

Delete a language

langDeleteLanguage($idlang, $idclient) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idlang

$idclient

Duplicate a language

langDuplicateFromFirstLanguage($client, $idlang) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$client

$idlang

Edit a language

langEditLanguage($idlang, $langname, $encoding, $active, $direction) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idlang

$langname

$encoding

$active

$direction

langGetTextDirection()

langGetTextDirection($idlang, $db) 

Parameters

$idlang

$db

Create a new language

langNewLanguage(string $name, $client) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$name

string

Name of the language

$client

Rename a language

langRenameLanguage($idlang, $name) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
author Olaf Niemann <Olaf.Niemann@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$idlang

$name

layDeleteLayout()

layDeleteLayout($idlay) 

Parameters

$idlay

Edit or Create a new layout

layEditLayout(int $idlay, string $name, string $description, string $code) : int

author Olaf Niemann
copryright four for business AG <www.4fb.de>

Parameters

$idlay

int

Id of the Layout

$name

string

Name of the Layout

$description

string

Description of the Layout

$code

string

Layout HTML Code

Returns

int$idlay Id of the new or edited Layout

locale_arsort()

locale_arsort($locale, $array) 

Parameters

$locale

$array

Write JavaScript to mark

markSubMenuItem(int $menuitem, bool $return) 

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$menuitem

int

Which menuitem to mark

$return

bool

Return or echo script

translate strings in modules

mi18n(string $string) : string

global int $cCurrentModule
global string $lang
global cApiModuleTranslationCollection $mi18nTranslator

Parameters

$string

string

string to translate

Returns

stringtranslated string

modDeleteModule()

modDeleteModule($idmod) 

Parameters

$idmod

modEditModule()

modEditModule($idmod, $name, $description, $input, $output, $template, $type) 

Parameters

$idmod

$name

$description

$input

$output

$template

$type

modTestModule()

modTestModule($code, $id, $output) 

Parameters

$code

$id

$output

notifyOnError()

notifyOnError($errortitle, $errormessage) 

Parameters

$errortitle

$errormessage

phpInfoToHtml - grabs phpinfo() output

phpInfoToHtml() : string

grabs phpinfo() HTML output

author Marco Jahn

Returns

stringreturns phpinfo() HTML output

Includes a file from a plugin and takes care of all path transformations.

plugin_include(string $sWhere, string $sWhat) : void

Example: plugin_include('formedit', 'classes/class.formedit.php');

Parameters

$sWhere

string

The name of the plugin

$sWhat

string

The filename of the include

Recursive function to create an URL name location string

prCreateURLNameLocationString(int $idcat, string $seperator, string $cat_str, boolean $makeLink, string $linkClass, integer $firstTreeElementToUse, $uselang, $final, $usecache) : string

author Jan Lengowski
author Marco Jahn
copyright four for business AG <www.4fb.de>

Parameters

$idcat

int

ID of the starting category

$seperator

string

Seperation string

$cat_str

string

Category location string (by reference)

$makeLink

boolean

create location string with links

$linkClass

string

stylesheet class for the links

$firstTreeElementToUse

integer

first navigation level location string should be printed out (first level = 0!!)

$uselang

$final

$usecache

Returns

stringlocation string

prResolvePathViaCategoryNames: Resolves a path using some fuzzy logic.

prResolvePathViaCategoryNames(\$path $path, $iLangCheck) : integer

Warning: If you use this function, try to pass a "good" path. This function doesn't guarantee that the matches are logically best-matches.

This function operates on the actual category names.

Parameters

$path

\$path

string Path to resolve

$iLangCheck

Returns

integerClosest matching category ID (idcat)

prResolvePathViaURLNames: Resolves a path using some fuzzy logic.

prResolvePathViaURLNames(\$path $path) : integer

Warning: If you use this function, try to pass a "good" path. This function doesn't guarantee that the matches are logically best-matches.

This function operates on the category aliases. It compares the given path with the urlpaths generated by function prCreateURLNameLocationString() based on category aliases.

Parameters

$path

\$path

string Path to resolve

Returns

integerClosest matching category ID (idcat)

recCats()

recCats($aCats, $sInsertQuery, $iNextTreeId, $aAllCats, $iLevel) 

Parameters

$aCats

$sInsertQuery

$iNextTreeId

$aAllCats

$iLevel

recursive_copy()

recursive_copy($from_path, $to_path) 

Parameters

$from_path

$to_path

Function removes file meta information from database (used when a file is deleted)

removeFileInformation(integer $iIdClient, string $sFilename, string $sType, object $oDb) : void

author Timo Trautmann

Parameters

$iIdClient

integer
  • id of client which contains this file

$sFilename

string
  • name of corresponding file

$sType

string
  • type of file (css, js or templates)

$oDb

object
  • contenido database object

Renames a existing file.

renameFile(string $sOldFile, string $sNewFile, string $path) : \(void | \string)

Exits the script, if new filename is not valid or renaming fails!

Parameters

$sOldFile

string

Old filename

$sNewFile

string

New filename

$path

string

Path to the file

Returns

\(void\string)Either new filename or nothing

rereadClients()

rereadClients() 

saverights()

saverights() 

saverights()

saverights() 

saverightsarea()

saverightsarea() 

saverightsarea()

saverightsarea() 

scanDirectory()

scanDirectory($sDirectory, $bRecursive) 

Parameters

$sDirectory

$bRecursive

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

scanPlugins(\$entity $entity) : string

Example: scanPlugins("frontendusers");

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

\$entity

Name of the directory to scan

Returns

stringclient name

sendBugReport - send users bugreport

sendBugReport() : string

send users bugreport contains 4 attachements (1) errorlog.txt (2) install.log.txt (3) systemvariablen.html (generaten of writeSystemValuesOutput()) (4) phpinfo.html (generated of phpInfoToHtml())

to avoid errors when filesize attachement (1) or (2) is 0kb temporarily attachements with a specified message will be created

return value: - error code (0-3) 0) mail send successfull (no errors or missing data) 1) not all fields are filled out 2) email adress is not valid 3) user hasn't agreed to the declaration of consent

author Marco Jahn

Returns

stringreturns several server and Contenido settings

Function checks current language and client settings by HTTP-Params and DB settings. Based on this informations it will send an HTTP header for right encoding.

sendEncodingHeader(\DB_Contenido $db, array $cfg, int $lang) 

since 4.6.18
version 1.0.0
author Holger Librenz

Parameters

$cfg

array

global cfg-array

$lang

int

global language id

sendPostRequest: Sents a HTTP POST request

sendPostRequest(\$host $host, \$pathhost $path, \$data $data, \$referer $referer, \$port $port) 

Example: sendPostRequest("hostname", "serverpath/test.php", $data);

Parameters

$host

\$host

Hostname or domain

$path

\$pathhost

Path on the host or domain

$data

\$data

Data to send

$referer

\$referer

Referer (optional)

$port

\$port

Port (default: 80)

set a default article specification

setArtspecDefault(integer $idartspec) : void

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

Parameters

$idartspec

integer

article specification id

set article specifications online

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

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

Parameters

$idartspec

integer

article specification id

$online

integer

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

set_magic_quotes_gpc()

set_magic_quotes_gpc($code) 

Parameters

$code

showLocation()

showLocation($area) 

Parameters

$area

showTable()

showTable($tablename) 

Parameters

$tablename

showTree()

showTree($iIdcat, $aWholelist) 

Parameters

$iIdcat

$aWholelist

sort_pre_post()

sort_pre_post($arr) 

Parameters

$arr

startTiming: Starts the timing for a specific function

startTiming(\function $function, \parameters $parameters) : int

Parameters

$function

\function

string Name of the function

$parameters

\parameters

array All parameters for the function to measure

Returns

intuuid for this measure process

Generates the location string for passed category id.

statCreateLocationString(int $idcat, string $seperator, string $cat_str) : void

Performs a recursive call, if parent category doesn't matches to 0

Parameters

$idcat

int

The category id

$seperator

string

Separator for location string

$cat_str

string

The location string variable (reference)

Returns a drop down to choose the stats to display

statDisplayTopChooser($default) : string

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$default

none

Returns

stringReturns a drop down string

Returns a drop down to choose the stats to display for yearly summary pages

statDisplayYearlyTopChooser($default) : string

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$default

none

Returns

stringReturns a drop down string

Return an array with all months for a specific year which are available as stat files

statGetAvailableMonths(mixed $year, $client, $lang) : array

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$year

mixed

many

$client

$lang

Returns

arrayArray of strings with months.

Return an array with all years which are available as stat files

statGetAvailableYears(mixed $client, $lang) : array

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$client

mixed

many

$lang

Returns

arrayArray of strings with years.

Resets the statistic for passed client

statResetStatistic(int $client) : void

Parameters

$client

int

Id of client

Returns the canonical month.

statReturnCanonicalMonth(int $month) : string

Wrapper for function getCanonicalMonth()

Parameters

$month

int

The digit representation of a month

Returns

stringTextual representation of a month

Archives the current statistics

statsArchive(\$yearmonth $yearmonth) : \none

Parameters

$yearmonth

\$yearmonth

String with the desired archive date (YYYYMM)

Returns

\none

Displays statistic information layer (a div Tag)

statsDisplayInfo(int $id, string $type, int $x, int $y, int $w, int $h) : string

Parameters

$id

int

Either article or directory id

$type

string

The type

$x

int

Style top position

$y

int

Style left position

$w

int

Style width

$h

int

Style height

Returns

stringComposed info layer

Generates a statistics page

statsOverviewAll(\$yearmonth $yearmonth) : \none

author Jan Lengowski <Jan.Lengowski@4fb.de>
modified Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$yearmonth

\$yearmonth

Specifies the year and month from which to retrieve the statistics, specify "current" to retrieve the current entries

Returns

\none

Generates a top<n> statistics page

statsOverviewTop(\$yearmonth $yearmonth, \$top $top) : \none

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$yearmonth

\$yearmonth

Specifies the year and month from which to retrieve the statistics, specify "current" to retrieve the current entries

$top

\$top

Specifies the amount of pages to display

Returns

\none

Generates a top<n> statistics page

statsOverviewTopYear(\$year $year, \$top $top) : \none

author Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$year

\$year

Specifies the year from which to retrieve the statistics

$top

\$top

Specifies the amount of pages to display

Returns

\none

Generates a statistics page for a given year

statsOverviewYear(\$year $year) : \none

author Jan Lengowski <Jan.Lengowski@4fb.de>
modified Timo A. Hummel <Timo.Hummel@4fb.de>
copyright four for business AG <http://www.4fb.de>

Parameters

$year

\$year

Specifies the year to retrieve the statistics for

Returns

\none

Copies the category and it's existing articles into another category.

strCopyCategory(int $idcat, int $destidcat, bool $remakeTree, bool $bUseCopyLabel) : void

Parameters

$idcat

int

Id of category to copy

$destidcat

int

Id of destination category

$remakeTree

bool

Flag to rebuild category tree

$bUseCopyLabel

bool

Flag to add copy label to the new categories

Copies the categorytree (category and its childs) to an another category.

strCopyTree(int $idcat, int $destcat, bool $remakeTree, bool $bUseCopyLabel) : void

Parameters

$idcat

int

Id of category to copy

$destcat

int

Id of destination category

$remakeTree

bool

Flag to rebuild category tree

$bUseCopyLabel

bool

Flag to add copy label to the new categories

strDeeperCategoriesArray()

strDeeperCategoriesArray($idcat_start) 

Parameters

$idcat_start

Deletes the category and its template configurations.

strDeleteCategory(int $idcat) : void

Only categories having no child categories and having no articles will be deleted!

Parameters

$idcat

int

Id of category to delete

Checks, if passed category cotains any articles

strHasArticles(int $tmp_idcat) : bool

Parameters

$tmp_idcat

int

ID of category

Returns

bool

Checks if category has a start article

strHasStartArticle(int $idcat, int $idlang) : bool

Parameters

$idcat

int

Id of category

$idlang

int

The language id

Returns

bool

Sets the public status of the category and its childs

strMakePublic(int $idcat, int $lang, int $public) : void

Parameters

$idcat

int

Category id

$lang

int

Language id

$public

int

Public status

Sets the visible status of the category and its childs

strMakeVisible(int $idcat, int $lang, int $visible) : void

Parameters

$idcat

int

Category id

$lang

int

Language id

$visible

int

Visible status

Checks if category is movable.

strMoveCatTargetallowed(int $idcat, int $source) : bool

Parameters

$idcat

int

Id of category to move

$source

int

Id of source category

Returns

bool

Moves a category downwards.

strMoveDownCategory(int $idcat) : void

Parameters

$idcat

int

Id of category to move downwards

Moves a subtree to another destination.

strMoveSubtree(int $idcat, int $parentid_new) : void

Parameters

$idcat

int

Id of category

$parentid_new

int

Id of destination parent category

Moves a category upwards.

strMoveUpCategory(int $idcat) : void

Parameters

$idcat

int

Id of category to move upwards

Creates a new category.

strNewCategory(int $tmp_parentid, string $catname, bool $remakeTree, string $catalias, bool $bVisible, bool $bPublic, int $iIdtplcfg) : \(int | \void)

Parameters

$tmp_parentid

int

Id of parent category

$catname

string

The category name

$remakeTree

bool

Flag to rebuild category tree structure

$catalias

string

Alias of category

$bVisible

bool

Flag about visible status

$bPublic

bool

Flag about public status

$iIdtplcfg

int

Id of template configuration

Returns

\(int\void)Id of new generated category or nothing on failure

Creates a new category tree (root category item).

strNewTree(string $catname, string $catalias, bool $bVisible, bool $bPublic, int $iIdtplcfg) : \(int | \void)

Parameters

$catname

string

The category name

$catalias

string

Alias of category

$bVisible

bool

Flag about visible status

$bPublic

bool

Flag about public status

$iIdtplcfg

int

Id of template configuration

Returns

\(int\void)Id of new generated category or nothing on failure

strNextBackwards()

strNextBackwards($tmp_idcat) 

Parameters

$tmp_idcat

strNextDeeper()

strNextDeeper($tmp_idcat, $ignore_lang) 

Parameters

$tmp_idcat

$ignore_lang

Hotfix recursive call more than 200 times exit script on hosteurope Timo.Trautmann

strNextDeeperAll($tmp_idcat, $ignore_lang) 

Parameters

$tmp_idcat

$ignore_lang

strNextPost()

strNextPost($tmp_idcat) 

Parameters

$tmp_idcat

strOrderedPostTreeList()

strOrderedPostTreeList($idcat, $poststring) 

Parameters

$idcat

$poststring

Remakes the category tree structure in category tree table.

strRemakeTreeTable() : void

Hotfix recursive call more than 200 times exit script on hosteurope Timo.Trautmann (strRemakeTreeTableFindNext)

strRemakeTreeTableFindNext($tmp_idcat, $tmp_level) 

@deprecated

Parameters

$tmp_idcat

$tmp_level

Renames a category

strRenameCategory(int $idcat, int $lang, string $newcategoryname, string $newcategoryalias) : void

Parameters

$idcat

int

Category id

$lang

int

Language id

$newcategoryname

string

New category name

$newcategoryalias

string

New category alias

Renders the category tree a HTML table

strShowTreeTable() : void

Synchronizes a category from one language to another language.

strSyncCategory(int $idcatParam, int $sourcelang, int $targetlang, bool $bMultiple) : void

Parameters

$idcatParam

int

Id of category to synchronize

$sourcelang

int

Id of source language

$targetlang

int

Id of target language

$bMultiple

bool

Flag to synchronize child languages

str_ireplace_once - Replaces a string only once

str_ireplace_once(\$find $find, \$replace $replace, \$subject $subject) : string

Caution: This function only takes strings as parameters, not arrays!

Parameters

$find

\$find

string String to find

$replace

\$replace

string String to replace

$subject

\$subject

string String to process

Returns

stringProcessed string

str_ireplace_once_reverse - Replaces a string only once, in reverse direction

str_ireplace_once_reverse(\$find $find, \$replace $replace, \$subject $subject) : string

Caution: This function only takes strings as parameters, not arrays!

Parameters

$find

\$find

string String to find

$replace

\$replace

string String to replace

$subject

\$subject

string String to process

Returns

stringProcessed string

str_rpos - Finds a string position in reverse direction

str_rpos(\$haystack $haystack, \$needle $needle, \$start $start) : string

NOTE: The original strrpos-Function of PHP4 only finds a single character as needle.

Parameters

$haystack

\$haystack

string String to search in

$needle

\$needle

string String to search for

$start

\$start

integer Offset

Returns

stringProcessed string

Removes slashes from passed variable.

stripslashes_deep(mixed $value) : array

Parameters

$value

mixed

Either a string or a multi-dimensional array of values

Returns

array

check users right for a client

system_have_perm(integer $client) : boolean

check if the user has a right for a defined client

author Marco Jahn

Parameters

$client

integer

client id

Returns

booleanwether user has access or not

tplAutoFillModules()

tplAutoFillModules($idtpl) 

Parameters

$idtpl

Browse a specific layout for containers

tplBrowseLayoutForContainers($idlay) : string

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.>

Parameters

$idlay

Returns

string&-seperated String of all containers

Delete a template

tplDeleteTemplate(int $idtpl) : \$new_idtpl

author Olaf Niemann <Olaf.Niemann@4fb.de>
author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.>

Parameters

$idtpl

int

ID of the template to duplicate

Returns

\$new_idtplID of the duplicated template

Duplicate a template

tplDuplicateTemplate(int $idtpl) : \$new_idtpl

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.>

Parameters

$idtpl

int

ID of the template to duplicate

Returns

\$new_idtplID of the duplicated template

Edit or create a new Template

tplEditTemplate($changelayout, $idtpl, $name, $description, $idlay, $c, $default) 

author Olaf Niemann <Olaf.Niemann@4fb.de>
author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.de>

Parameters

$changelayout

$idtpl

$name

$description

$idlay

$c

$default

Retrieve the default module

tplGetContainerDefault($idlay, int $container) : array

Parameters

$idlay

$container

int

Container number

Returns

arrayAllowed container types

Retrieve the container mode

tplGetContainerMode($idlay, int $container) : string

Parameters

$idlay

$container

int

Container number

Returns

stringContainer name

Retrieve the container name

tplGetContainerName($idlay, int $container) : string

Parameters

$idlay

$container

int

Container number

Returns

stringContainer name

Retrieve the allowed container types

tplGetContainerTypes($idlay, int $container) : array

Parameters

$idlay

$container

int

Container number

Returns

arrayAllowed container types

Get used datas if a template is in use

tplGetInUsedData(int $idtpl) : array

author Munkh-Ulzii Balidar
copyright four for business AG <www.4fb.de>

Parameters

$idtpl

int

Template ID

Returns

array- category name, article name

Checks if a template is in use

tplIsTemplateInUse(int $idtpl) : bool

author Jan Lengowski <Jan.Lengowski@4fb.de>
copyright four for business AG <www.4fb.de> modified Munkh-Ulzii Balidar, improved the sql query without while loop

Parameters

$idtpl

int

Template ID

Returns

boolis template in use

Preparse the layout for caching purposes

tplPreparseLayout($idlay) : \none

Parameters

$idlay

Returns

\none

Copies a complete template configuration

tplcfgDuplicate(int $idtplcfg) : int

Parameters

$idtplcfg

int

Template Configuration ID

Returns

intnew template configuration ID

trans($string)

trans(\$string $string) : string

gettext wrapper (for future extensions). Usage: trans("Your text which has to be translated");

deprecated since 4.8.16 CL, use i18n instead, function will be deleted in one of next versions

Parameters

$string

\$string

string The string to translate

Returns

stringReturns the translation

Trims an array

trim_array(array $array) : array

Parameters

$array

array

Array to trim

Returns

arrayTrimmed array

Function updates file meta information (used when files were created or edited).

updateFileInformation(integer $iIdClient, string $sFilename, string $sType, string $sAuthor, string $sDescription, object $oDb, string $sFilenameNew) : void

It creates new database record for file meta informations if database record does not exist. Otherwise, existing record will be updated

author Timo Trautmann

Parameters

$iIdClient

integer
  • id of client which contains this file

$sFilename

string
  • name of corresponding file

$sType

string
  • type of file (css, js or templates)

$sAuthor

string
  • author of file

$sDescription

string
  • description of file

$oDb

object
  • contenido database object

$sFilenameNew

string
  • new filename if filename was changed (optional)

uplCreateFriendlyName()

uplCreateFriendlyName($filename) 

Parameters

$filename

uplDirectoryListRecursive()

uplDirectoryListRecursive($currentdir, $startdir, $files, $depth, $pathstring) 

Parameters

$currentdir

$startdir

$files

$depth

$pathstring

uplGetFileExtension()

uplGetFileExtension($sFile) 

Parameters

$sFile

Returns the icon for a file type

uplGetFileIcon(\$file $file) : \Icon

Parameters

$file

\$file

Filename to retrieve the extension for

Returns

\Iconfor the file type

Returns the description for a file type

uplGetFileTypeDescription(\$extension $extension) : \Text

Parameters

$extension

\$extension

Extension to use

Returns

\Textfor the file type

uplGetThumbnail()

uplGetThumbnail($file, $maxsize) 

Parameters

$file

$maxsize

uplHasFiles()

uplHasFiles($dir) 

Parameters

$dir

uplHasSubdirs()

uplHasSubdirs($dir) 

Parameters

$dir

uplRecursiveDBDirectoryList()

uplRecursiveDBDirectoryList($directory, $rootitem, $level) 

Parameters

$directory

$rootitem

$level

uplRecursiveDirectoryList()

uplRecursiveDirectoryList($directory, $rootitem, $level, $sParent, $iRenameLevel) 

Parameters

$directory

$rootitem

$level

$sParent

$iRenameLevel

uplRecursiveRmDirIfEmpty()

uplRecursiveRmDirIfEmpty($dir) 

Parameters

$dir

uplRenameDirectory()

uplRenameDirectory($oldpath, $newpath, $parent) 

Parameters

$oldpath

$newpath

$parent

uplRender()

uplRender($path, $sortby, $sortmode, $startpage, $thumbnailmode) 

Parameters

$path

$sortby

$sortmode

$startpage

$thumbnailmode

uplRender()

uplRender($searchfor, $sortby, $sortmode, $startpage, $thumbnailmode) 

Parameters

$searchfor

$sortby

$sortmode

$startpage

$thumbnailmode

uplSearch()

uplSearch($searchfor) 

Parameters

$searchfor

uplSyncDirectory ($path) Sync database contents with directory

uplSyncDirectory(string $path) 

Parameters

$path

string

Specifies the path to scan

uplSyncDirectoryDBFS ($path) Sync database contents with DBFS

uplSyncDirectoryDBFS(string $path) 

Parameters

$path

string

Specifies the path to scan

upldelete()

upldelete($path, $files) 

Parameters

$path

$files

uplmkdir()

uplmkdir($path, $name) 

Parameters

$path

$name

writeSystemValuesOutput - get several server and Contenido settings

writeSystemValuesOutput($usage) : string

parse system and Contenido output into a string

author Marco Jahn

Parameters

$usage

Returns

stringreturns a string containing several server and Contenido settings

xmldoc()

xmldoc($str) 

Parameters

$str

xmldocfile()

xmldocfile($filename) 

Parameters

$filename

xpath_eval()

xpath_eval($xpath_context, $eval_str, $contextnode) 

Parameters

$xpath_context

$eval_str

$contextnode

xpath_new_context()

xpath_new_context($dom_document) 

Parameters

$dom_document

xpath_register_ns()

xpath_register_ns($xpath_context, $prefix, $namespaceURI) 

Parameters

$xpath_context

$prefix

$namespaceURI

Constants

 

Project: Contenido Content Management System

CONTENIDO_STRIPSLASHES 

Description: Makes available those super global arrays that are made available in versions of PHP after v4.1.0

Requirements:

con_php_req 5.0
package Contenido Backend includes
version 1.0.1
author Martin Horwath
copyright four for business AG <www.4fb.de>
license http://www.contenido.org/license/LIZENZ.txt
link http://www.4fb.de
link http://www.contenido.org
since file available since contenido release <= 4.6 {@internal created unkown modified 2008-06-25, Frederic Schneider, add stripslashes_deep and contenido_stripslashes constant modified 2008-06-26 Removed $_SERVER and $_ENV because this global vars are read only modified 2009-11-06, Murat Purc, replaced deprecated functions (PHP 5.3 ready) and removed code for PHP older than 4.1.0 modified 2011-02-04, Murat Purc, fixed potential attac by manipulated request variables (see http://forum.contenido.org/viewtopic.php?f=11&t=30812) $Id: globals_off.inc.php 2 2011-07-20 12:00:48Z oldperl $: }}