Functions

cCatPerm()

cCatPerm($widcat, $db) 

Parameters

$widcat

$db

getGroupIDs()

getGroupIDs($db) 

Parameters

$db

linksort()

linksort($sErrors) 

Parameters

$sErrors

Returns value of an array key (assoziative or indexed).

mr_arrayValue(array $array, mixed $key, mixed $default) : mixed

Shortcut function for some ways to access to arrays:

// old way
if (is_array($foo) && isset($foo['bar']) && $foo['bar'] == 'yieeha') {
    // do something
}

// new, more readable way:
if (mr_arrayValue($foo, 'bar') == 'yieeha') {
    // do something
}

// old way
if (is_array($foo) && isset($foo['bar'])) {
    $jep = $foo['bar'];
} else {
    $jep = 'yummy';
}

// new way
$jep = mr_arrayValue($foo, 'bar', 'yummy');

Parameters

$array

array

The array

$key

mixed

Position of an indexed array or key of an assoziative array

$default

mixed

Default value to return

Returns

mixedEither the found value or the default value

Replaces existing ancors inside passed code, while rebuilding the urls.

mr_buildGeneratedCode(string $code) : string

Will be called by chain 'Contenido.Content.conGenerateCode' or 'Contenido.Frontend.HTMLCodeOutput' depening on mod_rewrite settings.

Parameters

$code

string

Code to prepare

Returns

stringNew code

Works as a wrapper for Contenido_Url.

mr_buildNewUrl(string $url) : string

Will also be called by chain 'Contenido.Frontend.CreateURL'.

todo : Still exists bcause of downwards compatibility (some other modules/plugins are using it)

Parameters

$url

string

URL to rebuild

Returns

stringNew URL

Processes mod_rewrite related job for duplicated articles.

mr_conCopyArtLang(array $data) : array

Will be called by chain 'Contenido.Article.conCopyArtLang_AfterInsert'.

Parameters

$data

array

Assoziative array with record entries

Returns

arrayLoop through of arguments

Processes mod_rewrite related job for articles beeing moved.

mr_conMoveArticles(array $data) : array

Will be called by chain 'Contenido.Article.conMoveArticles_Loop'.

Parameters

$data

array

Assoziative array with record entries

Returns

arrayLoop through of arguments

Processes mod_rewrite related job for saved articles (new or modified article).

mr_conSaveArticle(array $data) : array

Will be called by chain 'Contenido.Action.con_saveart.AfterCall'.

Parameters

$data

array

Assoziative array with some article properties

Returns

arrayPassed parameter

Processes mod_rewrite related job for synchronized articles.

mr_conSyncArticle(array $data) : array

Will be called by chain 'Contenido.Article.conSyncArticle_AfterInsert'.

Parameters

$data

array

Assoziative array with record entries as follows: array( 'src_art_lang' => Recordset (assoziative array) of source item from con_art_lang table 'dest_art_lang' => Recordset (assoziative array) of inserted destination item from con_art_lang table );

Returns

arrayLoop through of argument

Debug output only during development

mr_debugOutput(bool $print) : mixed

Parameters

$print

bool

Flag to echo the debug data

Returns

mixedEither the debug data, if parameter $print is set to true, or nothing

Returns the mod rewrite configuration array of an client.

mr_getConfiguration(int $clientId) : array | null

File is placed in /contenido/mod_rewrite/includes/and is named like config.mod_rewrite_{client_id}.php.

Parameters

$clientId

int

Id of client

Returns

arraynull

Minimalistic'n simple way to get request variables.

mr_getRequest(string $key, mixed $default) : mixed

Checks occurance in $_GET, then in $_POST. Uses trim() and strip_tags() to preclean data.

Parameters

$key

string

Name of var to get

$default

mixed

Default value to return

Returns

mixedThe value

Replaces calling of header method for redirects in front_content.php, used during development.

mr_header(\$header $header) 

Parameters

$header

\$header

Header value for redirect

Returns amr related translation text

mr_i18n(string $key) : string

Parameters

$key

string

The message id as string

Returns

stringRelated message

Loads Advanced Mod Rewrite configuration for passed client using serialized file containing the settings.

mr_loadConfiguration(int $clientId, bool $forceReload) 

File is placed in /contenido/mod_rewrite/includes/and is named like config.mod_rewrite_{client_id}.php.

Parameters

$clientId

int

Id of client

$forceReload

bool

Flag to force to reload configuration, e. g. after done changes on it

Database query helper. Used to execute a select statement and to return the result of first recordset.

mr_queryAndNextRecord(string $query) : mixed

Minimizes following code:

// default way
$db  = new DB_Contenido();
$sql = "SELECT * FROM foo WHERE bar='foobar'";
$db->query($sql);
$db->next_record();
$data = $db->Record;

// new way
$sql  = "SELECT * FROM foo WHERE bar='foobar'";
$data = mr_queryAndNextRecord($sql);

Parameters

$query

string

Query to execute

Returns

mixedAssoziative array including recordset or null

Cleanups passed string from characters beeing repeated two or more times

mr_removeMultipleChars(string $char, string $string) : string

Parameters

$char

string

Character to remove

$string

string

String to clean from character

Returns

stringCleaned string

Request cleanup function. Request data is allways tainted and must be filtered.

mr_requestCleanup(mixed $data, array $options) : mixed

Pass the array to cleanup using several options. Emulates array_walk_recursive().

Parameters

$data

mixed

Data to cleanup

$options

array

Default options array, provides only 'filter' key with several filter functions which are to execute as follows: $options['filter'] = array('trim', 'myFilterFunc'); If no filter functions are set, 'trim', 'strip_tags' and 'stripslashes' will be used by default. A userdefined function must accept the value as a parameter and must return the filtered parameter, e. g. function myFilter($data) { // do what you want with the data, e. g. cleanup of xss content return $data; }

Returns

mixedCleaned data

Includes the frontend controller script which parses the url and extacts needed data like idcat, idart, lang and client from it.

mr_runFrontendController() : bool

Will be called by chain 'Contenido.Frontend.AfterLoadPlugins' at front_content.php.

Returns

boolJust a return value

Sets language of client, like done in front_content.php

mr_setClientLanguageId(int $client) 

Parameters

$client

int

Client id

Saves the mod rewrite configuration array of an client.

mr_setConfiguration(int $clientId, array $config) : bool

File is placed in /contenido/mod_rewrite/includes/and is named like config.mod_rewrite_{client_id}.php.

Parameters

$clientId

int

Id of client

$config

array

Configuration to save

Returns

bool

Processes mod_rewrite related job after copying a category subtree.

mr_strCopyCategory(array $data) : array

Will be called by chain 'Contenido.Category.strCopyCategory'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

Processes mod_rewrite related job after moving a category subtree.

mr_strMoveSubtree(array $data) : array

Will be called by chain 'Contenido.Action.str_movesubtree.AfterCall'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

Processes mod_rewrite related job after moving a category up.

mr_strMoveUpCategory(int $idcat) : int

Will be called by chain 'Contenido.Action.str_moveupcat.AfterCall'.

todo do we really need processing of the category? there is no mr relevant data changes while moving the category on same level, level and name won't change

Parameters

$idcat

int

Category id

Returns

intCategory id

Processes mod_rewrite related job after moving a category down.

mr_strMovedownCategory(int $idcat) : int

Will be called by chain 'Contenido.Action.str_movedowncat.AfterCall'.

todo do we really need processing of the category? there is no mr relevant data changes while moving the category on same level, level and name won't change

Parameters

$idcat

int

Id of category beeing moved down

Returns

intCategory id

Processes mod_rewrite related job for created new category.

mr_strNewCategory(array $data) : array

Will be called by chain 'Contenido.Action.str_newcat.AfterCall'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

Processes mod_rewrite related job for created new tree.

mr_strNewTree(array $data) : array

Will be called by chain 'Contenido.Action.str_newtree.AfterCall'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

Processes mod_rewrite related job for renamed category 2010-02-01: and now all existing subcategories and modify their paths too...

mr_strRenameCategory(array $data) : array

2010-02-01: max 50 recursion level

Will be called by chain 'Contenido.Action.str_renamecat.AfterCall'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

Processes mod_rewrite related job during structure synchronisation process, sets the urlpath of current category.

mr_strSyncCategory(array $data) : array

Will be called by chain 'Contenido.Category.strSyncCategory_Loop'.

Parameters

$data

array

Assoziative array with some values

Returns

arrayPassed parameter

pica_ArticleListActions()

pica_ArticleListActions($aActions) 

Parameters

$aActions

pica_GetCustomTabProperties()

pica_GetCustomTabProperties($sIntName) 

Parameters

$sIntName

pica_RegisterCustomTab()

pica_RegisterCustomTab() 

pica_RenderArticleAction()

pica_RenderArticleAction($idcat, $idart, $idartlang, $actionkey) 

Parameters

$idcat

$idart

$idartlang

$actionkey

str_replace_recursive()

str_replace_recursive($array) 

Parameters

$array

url_is_image()

url_is_image($sUrl) 

Parameters

$sUrl

url_is_uri()

url_is_uri($sUrl) 

Parameters

$sUrl

Classes and interfaces

Contenido_UrlBuilder_MR

Class to build frontend urls for advandced mod rewrite plugin.

« More »

ModRewrite

Class to create websafe names

« More »

ModRewriteBase

Abstract base mod rewrite class.

« More »

ModRewriteController

Mod Rewrite controller class. Extracts url parts and sets some necessary globals like: - $idart - $idcat - $client - $changeclient - $lang - $changelang

« More »

ModRewriteUrlStack

Mod rewrite url stack class. Provides features to collect urls and to get the pretty path and names of categories/articles at one go.

« More »

ModRewriteUrlUtil

Mod Rewrite url utility class. Handles convertion of Urls from contenido core based url composition pattern to AMR (Advanced Mod Rewrite) url composition pattern and vice versa.

« More »