Source for file config.plugin.php
Documentation is available at config.plugin.php
* Plugin Advanced Mod Rewrite initialization file.
* This file will be included by Contenido plugin loader routine, and the content
* of this file ensures that the AMR Plugin will be initialized correctly.
* @author Murat Purc <murat@purc.de>
* @copyright © Murat Purc 2008
defined('CON_FRAMEWORK') or die('Illegal call');
if (isset
($GLOBALS['client']) && (int)
$GLOBALS['client'] >
0) {
$clientId = (int)
$GLOBALS['client'];
} elseif (isset
($GLOBALS['load_client']) && (int)
$GLOBALS['load_client'] >
0) {
$clientId = (int)
$GLOBALS['load_client'];
// load language file (internationalization ist not implemented, just a pre release)
$pluginDir =
$GLOBALS['cfg']['path']['contenido'] .
$GLOBALS['cfg']['path']['plugins'] .
'mod_rewrite/';
$pluginLang =
($GLOBALS['i18nLanguage'] ==
'en_US') ?
'en_US' :
'de_DE';
if (is_file($pluginDir .
'locale/' .
$pluginLang .
'.inc.php')) {
@include_once($pluginDir .
'locale/' .
$pluginLang .
'.inc.php');
@include_once($pluginDir .
'locale/en_US.inc.php');
// include necessary sources
cInclude('classes', 'Debug/DebuggerFactory.class.php');
cInclude('classes', 'mp/class.mpdebug.php');
cInclude('classes', 'mp/class.mpglobals.php');
plugin_include('mod_rewrite', 'classes/class.modrewritebase.php');
plugin_include('mod_rewrite', 'classes/class.modrewrite.php');
plugin_include('mod_rewrite', 'classes/class.modrewritecontroller.php');
plugin_include('mod_rewrite', 'classes/class.modrewriteurlstack.php');
plugin_include('mod_rewrite', 'classes/class.modrewriteurlutil.php');
plugin_include('mod_rewrite', 'includes/functions.mod_rewrite.php');
cInclude('classes', 'mp/class.confighandler.php');
// set debug configuration
'enable' =>
true, //{%DEPLOY_DEBUG_ENABLE%}
'ressource_urls' =>
array('/contenido/logs/errorlog.txt'),
'dump_super_globals' =>
array('$_GET', '$_POST', '$_COOKIE', '$_SESSION'),
'ignore_empty_superglobals' =>
true
$_cecRegistry =
cApiCECRegistry::getInstance();
// Add new tree function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_newtree.AfterCall', 'mr_strNewTree');
// Add move subtree function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_movesubtree.AfterCall', 'mr_strMoveSubtree');
// Add new category function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_newcat.AfterCall', 'mr_strNewCategory');
// Add rename category function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_renamecat.AfterCall', 'mr_strRenameCategory');
// Add move up category function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_moveupcat.AfterCall', 'mr_strMoveUpCategory');
// Add move down category function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.str_movedowncat.AfterCall', 'mr_strMovedownCategory');
// Add copy category function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Category.strCopyCategory', 'mr_strCopyCategory');
// Add save article (new and existing category) function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Action.con_saveart.AfterCall', 'mr_conSaveArticle');
// Add move article function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Article.conMoveArticles_Loop', 'mr_conMoveArticles');
// Add duplicate article function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Article.conCopyArtLang_AfterInsert', 'mr_conCopyArtLang');
// Add sync article function to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Article.conSyncArticle_AfterInsert', 'mr_conSyncArticle');
if (!isset
($GLOBALS['contenido'])) {
// we are not in backend, add cec functions for rewriting
// Add mr related function for hook "after plugins loaded" to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Frontend.AfterLoadPlugins', 'mr_runFrontendController');
// Add url rewriting function to Contenido Extension Chainer
// @todo: no more need since Contenido 4.8.9 provides central Url building,
// but it is still available because of downwards compatibility
$_cecRegistry->addChainFunction('Contenido.Frontend.CreateURL', 'mr_buildNewUrl');
// overwrite url builder configuration with own url bilder
$GLOBALS['cfg']['url_builder']['name'] =
'MR';
$GLOBALS['cfg']['config'] =
array();
cInclude('classes', 'Url/Contenido_Url.class.php');
cInclude('classes', 'UrlBuilder/Contenido_UrlBuilderConfig.class.php');
Contenido_UrlBuilderConfig::setConfig($cfg['url_builder']);
if ($aMrCfg['rewrite_urls_at_congeneratecode'] ==
1) {
// Add url rewriting at code generation to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Content.conGenerateCode', 'mr_buildGeneratedCode');
} elseif ($aMrCfg['rewrite_urls_at_front_content_output'] ==
1) {
// Add url rewriting at html output to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Frontend.HTMLCodeOutput', 'mr_buildGeneratedCode');
// Fallback solution: Add url rewriting at code generation to Contenido Extension Chainer
$_cecRegistry->addChainFunction('Contenido.Content.conGenerateCode', 'mr_buildGeneratedCode');
unset
($clientId, $options);
Documentation generated on Sun, 08 Feb 2009 22:00:48 +0100 by phpDocumentor 1.4.1