Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cUriBuilderMR
  • ModRewrite
  • ModRewrite_ContentController
  • ModRewrite_ContentExpertController
  • ModRewrite_ContentTestController
  • ModRewrite_ControllerAbstract
  • ModRewriteBase
  • ModRewriteController
  • ModRewriteDebugger
  • ModRewriteTest
  • ModRewriteUrlStack
  • ModRewriteUrlUtil

Functions

  • mr_arrayValue
  • mr_buildGeneratedCode
  • mr_buildNewUrl
  • mr_conCopyArtLang
  • mr_conMoveArticles
  • mr_conSaveArticle
  • mr_conSyncArticle
  • mr_debugOutput
  • mr_getConfiguration
  • mr_getRequest
  • mr_header
  • mr_i18n
  • mr_loadConfiguration
  • mr_queryAndNextRecord
  • mr_removeMultipleChars
  • mr_requestCleanup
  • mr_runFrontendController
  • mr_setClientLanguageId
  • mr_setConfiguration
  • mr_strCopyCategory
  • mr_strMovedownCategory
  • mr_strMoveSubtree
  • mr_strMoveUpCategory
  • mr_strNewCategory
  • mr_strNewTree
  • mr_strRenameCategory
  • mr_strSyncCategory
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class ModRewrite

Class to create websafe names, it also provides several helper functions

ModRewriteBase
Extended by ModRewrite
Package: Plugin\ModRewrite
Copyright: www.polycoder.de
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Stefan Seifarth / stese
Author: Murat Purc <murat@purc.de>
Located at plugins/mod_rewrite/classes/class.modrewrite.php
Methods summary
public static
# initialize( integer $clientId )

Initialization, is to call at least once, also possible to call multible times, if different client configuration is to load.

Initialization, is to call at least once, also possible to call multible times, if different client configuration is to load.

Loads configuration of passed client and sets some properties.

Parameters

$clientId
integer
$clientId Client id
public static boolean
# isInCategories( string $sName = '', integer $iCatId = 0, integer $iLangId = 0 )

Check categories on websafe name

Check categories on websafe name

Check all categories in the main parent category on existing same websafe name

Parameters

$sName
string
$sName Websafe name to check
$iCatId
integer
$iCatId Current category id
$iLangId
integer
$iLangId Current language id

Returns

boolean
True if websafename already exists, false if not
public static boolean
# isInCatArticles( string $sName = '', integer $iArtId = 0, integer $iLangId = 0, integer $iCatId = 0 )

Check articles on websafe name.

Check articles on websafe name.

Check all articles in the current category on existing same websafe name.

Parameters

$sName
string
$sName Websafe name to check
$iArtId
integer
$iArtId Current article id
$iLangId
integer
$iLangId Current language id
$iCatId
integer
$iCatId Category id

Returns

boolean
True if websafename already exists, false if not
public static boolean
# setArtWebsafeName( string $sName = '', integer $iArtId = 0, integer $iLangId = 0, integer $iCatId = 0 )

Set websafe name in article list.

Set websafe name in article list.

Insert new websafe name in article list

Parameters

$sName
string
$sName Original name (will be converted)
$iArtId
integer
$iArtId Current article id
$iLangId
integer
$iLangId Current language id
$iCatId
integer
$iCatId Category id

Returns

boolean
True if insert was successfully
public static boolean
# setCatWebsafeName( string $sName = '', integer $iCatId = 0, integer $iLangId = 0 )

Set websafe name in category list.

Set websafe name in category list.

Insert new websafe name in category list.

Parameters

$sName
string
$sName Original name (will be converted) or alias
$iCatId
integer
$iCatId Category id
$iLangId
integer
$iLangId Language id

Returns

boolean
True if insert was successfully
public static boolean
# setCatUrlPath( integer $iCatId = 0, integer $iLangId = 0 )

Set urlpath of category

Set urlpath of category

Parameters

$iCatId
integer
$iCatId Category id
$iLangId
integer
$iLangId Language id

Returns

boolean
True if insert was successfully
public static array
# getArtIdByArtlangId( integer $iArtlangId = 0 )

Get article id and language id from article language id

Get article id and language id from article language id

Parameters

$iArtlangId
integer
$iArtlangId Current article id

Returns

array
Array with idart and idlang of current article
public static integer|null
# getArtIdByWebsafeName( string $sArtName = '', integer $iCatId = 0, integer $iLangId = 0 )

Get article id by article websafe name

Get article id by article websafe name

Parameters

$sArtName
string
$sArtName Websafe name
$iCatId
integer
$iCatId Category id
$iLangId
integer
$iLangId Language id

Returns

integer|null
Recent article id or NULL
public static string
# getCatName( integer $iCatId = 0, integer $iLangId = 0 )

Get category name from category id and language id.

Get category name from category id and language id.

Parameters

$iCatId
integer
$iCatId Category id
$iLangId
integer
$iLangId Language id

Returns

string
Category name
public static integer
# getCatIdByUrlPath( string $path )

Funcion to return cat id by path.

Funcion to return cat id by path.

Caches the paths at first call to provode faster processing at further calls.

Parameters

$path
string
$path Category path

Returns

integer
Category id
public static string
# getArtTitle( integer $iArtId = 0, integer $iLangId = 0 )

Get article name from article id and language id

Get article name from article id and language id

Parameters

$iArtId
integer
$iArtId Article id
$iLangId
integer
$iLangId Language id

Returns

string
Article name

NOTE:

seems to be not used???
public static array
# getCatLanguages( integer $iCatId = 0 )

Get language ids from category id

Get language ids from category id

Parameters

$iCatId
integer
$iCatId Category id

Returns

array
Used language ids
public static array
# getArtIds( integer $iArtlangId = 0 )

Get article urlname and language id

Get article urlname and language id

Parameters

$iArtlangId
integer
$iArtlangId idartlang

Returns

array
Urlname, idlang of empty array
public static string
# buildRecursivPath( integer $iCatId = 0, integer $iLangId = 0, integer $iLastId = 0 )

Build a recursiv path for mod_rewrite rule like server directories (dir1/dir2/dir3)

Build a recursiv path for mod_rewrite rule like server directories (dir1/dir2/dir3)

Parameters

$iCatId
integer
$iCatId Latest category id
$iLangId
integer
$iLangId Language id
$iLastId
integer
$iLastId Last category id

Returns

string
linkpath with correct uri
public static string
# rewriteHtmlAnchor( array $aMatches = array() )

Return full CONTENIDO url from single anchor

Return full CONTENIDO url from single anchor

Parameters

$aMatches
array
$aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments

Returns

string
New anchor
public static string
# contenidoHtmlAnchor( array $aMatches = array(), boolean $bXHTML = true )

Return full CONTENIDO url from single anchor

Return full CONTENIDO url from single anchor

Parameters

$aMatches
array
$aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments
$bXHTML
boolean
$bXHTML Flag to return XHTML valid url

Returns

string
New anchor
public static string
# getArtWebsafeName( integer $iArtId = 0, integer $iLangId = 0 )

Get article websafe name from article id and language id.

Get article websafe name from article id and language id.

Parameters

$iArtId
integer
$iArtId Article id
$iLangId
integer
$iLangId Language id

Returns

string
Article websafe name
public static string
# getArtLangWebsafeName( integer $iArtLangId = 0 )

Get article websafe name from idartlang.

Get article websafe name from idartlang.

Parameters

$iArtLangId
integer
$iArtLangId idartlang

Returns

string
Article websafe name
public static string
# getClientName( integer $clientId = 0 )

Get name of client by id.

Get name of client by id.

Parameters

$clientId
integer
$clientId Client id

Returns

string
Client name
public static integer
# getClientId( string $sClientName = '' )

Get client id from client name

Get client id from client name

Parameters

$sClientName
string
$sClientName Client name

Returns

integer
Client id
public static boolean
# clientIdExists( integer $clientId )

Checks if client id exists

Checks if client id exists

Parameters

$clientId
integer
$clientId

Returns

boolean
public static string
# getLanguageName( integer $languageId = 0 )

Returns name of language by id.

Returns name of language by id.

Parameters

$languageId
integer
$languageId Language id

Returns

string
Lanuage name
public static boolean
# languageIdExists( integer $languageId )

Checks if language id exists

Checks if language id exists

Parameters

$languageId
integer
$languageId Language id

Returns

boolean
public static integer
# getLanguageId( string $sLanguageName = '', integer $iClientId = 1 )

Get language id from language name thanks to Nicolas Dickinson for multi Client/Language BugFix

Get language id from language name thanks to Nicolas Dickinson for multi Client/Language BugFix

Parameters

$sLanguageName
string
$sLanguageName Language name
$iClientId
integer
$iClientId Client id

Returns

integer
Language id
public static array
# getClientFullUrlParts( string $url )

Splits passed argument into scheme://host and path/query.

Splits passed argument into scheme://host and path/query.

Example: input = http://host/front_content.php?idcat=123 return = array('htmlpath' => 'http://host', 'url' => 'front_content.php?idcat=123')

Parameters

$url
string
$url URL to split

Returns

array
Assoziative array including the two parts: - array('htmlpath' => $path, 'url' => $url)
public static string
# urlPreClean( string $url )

Function to preclean a url.

Function to preclean a url.

Removes absolute path declaration '/front_content.php' or relative path definition to actual dir './front_content.php', ampersand entities '&' and returns a url like 'front_content.php?idart=12&idlang=1'

Parameters

$url
string
$url Url to clean

Returns

string
Cleaned Url
public static
# recreateCategoriesAliases( boolean $bOnlyEmpty = false )

Recreates all or only empty aliases in categories table.

Recreates all or only empty aliases in categories table.

Parameters

$bOnlyEmpty
boolean
$bOnlyEmpty Flag to reset only empty items
public static array|integer
# getEmptyCategoriesAliases( boolean $bOnlyNumber = true )

Returns list of all empty category aliases

Returns list of all empty category aliases

Parameters

$bOnlyNumber
boolean
$bOnlyNumber

Returns

array|integer
public static
# recreateArticlesAliases( boolean $bOnlyEmpty = false )

Recreates all or only empty urlname entries in art_lang table.

Recreates all or only empty urlname entries in art_lang table.

Parameters

$bOnlyEmpty
boolean
$bOnlyEmpty Flag to reset only empty items
public static array|integer
# getEmptyArticlesAliases( boolean $bOnlyNumber = true )

Returns list of all empty article aliases

Returns list of all empty article aliases

Parameters

$bOnlyNumber
boolean
$bOnlyNumber

Returns

array|integer
public static
# resetAliases( )

Method to reset all aliases (categories and articles).

Method to reset all aliases (categories and articles).

Shortcut to recreateCategoriesAliases() and recreateArticlesAliases()

public static
# recreateAliases( boolean $bOnlyEmpty = false )

Recreate all or only empty aliases (categories and articles).

Recreate all or only empty aliases (categories and articles).

Shortcut to recreateCategoriesAliases() and recreateArticlesAliases()

Parameters

$bOnlyEmpty
boolean
$bOnlyEmpty Flag to reset only empty items
public static array
# getHtaccessInfo( )

Returns .htaccess related assoziative info array

Returns .htaccess related assoziative info array

Returns

array
Methods inherited from ModRewriteBase
getConfig(), isEnabled(), setConfig(), setEnabled()
Properties summary
private static cDb $_db
#

Database instance

Database instance

protected static array $_lookupTable
#

Lookup table to cache some internal data such as db query results

Lookup table to cache some internal data such as db query results

CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0