Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

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
  • Todo
  • Download

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
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
Websafe name to check
$iCatId
Current category id
$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
Websafe name to check
$iArtId
Current article id
$iLangId
Current language id
$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
Original name (will be converted)
$iArtId
Current article id
$iLangId
Current language id
$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
Original name (will be converted) or alias
$iCatId
Category id
$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
Category id
$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
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
Websafe name
$iCatId
Category id
$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
Category id
$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
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
Article id
$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
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
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
Latest category id
$iLangId
Language id
$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
[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
[0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments
$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
Article id
$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
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
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
Client name

Returns

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

Checks if client id exists

Checks if client id exists

Parameters

$clientId

Returns

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

Returns name of language by id.

Returns name of language by id.

Parameters

$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
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
Language name
$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
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
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
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

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

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
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.7 API documentation generated by ApiGen