From d09857390394f7d13359aa5fb040ef70d876650e Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Sat, 28 Dec 2019 17:11:03 +0100 Subject: [PATCH] Release version 1.0.0 --- cl_plugin.xml | 8 +- classes/class.modrewrite.php | 4 +- classes/class.modrewritebase.php | 10 +- .../class.modrewrite_content_controller.php | 138 +++++++-------- ...ss.modrewrite_contentexpert_controller.php | 2 +- .../class.modrewrite_controller_abstract.php | 4 +- includes/config.mod_rewrite_default.php | 46 ++--- includes/config.plugin.php | 30 ++-- includes/functions.mod_rewrite.php | 101 ++++++----- includes/include.mod_rewrite_content.php | 164 +++++++++--------- .../include.mod_rewrite_contentexpert.php | 52 +++--- includes/include.mod_rewrite_contenttest.php | 14 +- .../{mod_rewrite.mo => cl-mod-rewrite.mo} | Bin .../{mod_rewrite.po => cl-mod-rewrite.po} | 0 templates/content.html | 10 +- templates/content_top.html | 4 +- templates/contentexpert.html | 8 +- templates/contenttest.html | 4 +- 18 files changed, 312 insertions(+), 287 deletions(-) rename locale/de_DE/LC_MESSAGES/{mod_rewrite.mo => cl-mod-rewrite.mo} (100%) rename locale/de_DE/LC_MESSAGES/{mod_rewrite.po => cl-mod-rewrite.po} (100%) diff --git a/cl_plugin.xml b/cl_plugin.xml index 45042bc..18c494e 100644 --- a/cl_plugin.xml +++ b/cl_plugin.xml @@ -32,10 +32,10 @@ - - - - + + + + \ No newline at end of file diff --git a/classes/class.modrewrite.php b/classes/class.modrewrite.php index 92c5387..faa259a 100644 --- a/classes/class.modrewrite.php +++ b/classes/class.modrewrite.php @@ -496,7 +496,7 @@ class ModRewrite extends ModRewriteBase { } /** - * Build a recursiv path for mod_rewrite rule like server directories + * Build a recursiv path for cl-mod-rewrite rule like server directories * (dir1/dir2/dir3) * * @param int $iCatId Latest category id @@ -826,7 +826,7 @@ class ModRewrite extends ModRewriteBase { $htmlPath = $clientPath; $aComp = parse_url($htmlPath); - // check if path matches to defined rootdir from mod_rewrite conf + // check if path matches to defined rootdir from cl-mod-rewrite conf if (isset($aComp['path']) && $aComp['path'] !== parent::getConfig('rootdir')) { // replace not matching path agaings configured one // this will replace e. g. "http://host/cms/" against "http://host/" diff --git a/classes/class.modrewritebase.php b/classes/class.modrewritebase.php index ff7fe8a..0284fd2 100644 --- a/classes/class.modrewritebase.php +++ b/classes/class.modrewritebase.php @@ -55,7 +55,7 @@ abstract class ModRewriteBase { } /** - * Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite'] + * Returns configuration of mod rewrite, content of gobal $cfg['cl-mod-rewrite'] * * @param string $key Name of configuration key * @param mixed $default Default value to return as a fallback @@ -65,23 +65,23 @@ abstract class ModRewriteBase { public static function getConfig($key = null, $default = null) { global $cfg; if ($key == null) { - return $cfg['mod_rewrite']; + return $cfg['cl-mod-rewrite']; } elseif ((string) $key !== '') { - return (isset($cfg['mod_rewrite'][$key])) ? $cfg['mod_rewrite'][$key] : $default; + return (isset($cfg['cl-mod-rewrite'][$key])) ? $cfg['cl-mod-rewrite'][$key] : $default; } else { return $default; } } /** - * Sets the configuration of mod rewrite, content of gobal $cfg['mod_rewrite'] + * Sets the configuration of mod rewrite, content of gobal $cfg['cl-mod-rewrite'] * * @param string $key Name of configuration key * @param mixed $value The value to set */ public static function setConfig($key, $value) { global $cfg; - $cfg['mod_rewrite'][$key] = $value; + $cfg['cl-mod-rewrite'][$key] = $value; } } diff --git a/classes/controller/class.modrewrite_content_controller.php b/classes/controller/class.modrewrite_content_controller.php index 17477cb..9aeaefb 100644 --- a/classes/controller/class.modrewrite_content_controller.php +++ b/classes/controller/class.modrewrite_content_controller.php @@ -50,115 +50,115 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { $request = (count($_POST) > 0) ? $_POST : $_GET; mr_requestCleanup($request); - // use mod_rewrite + // use cl-mod-rewrite if (mr_arrayValue($request, 'use') == 1) { $this->_oView->use_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use'] = 1; + $aMR['cl-mod-rewrite']['use'] = 1; } else { $this->_oView->use_chk = ''; - $aMR['mod_rewrite']['use'] = 0; + $aMR['cl-mod-rewrite']['use'] = 0; } // root dir if (mr_arrayValue($request, 'rootdir', '') !== '') { if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/', $request['rootdir'])) { - $sMsg = i18n("The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\-_\/\.]", "mod_rewrite"); + $sMsg = i18n("The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\-_\/\.]", "cl-mod-rewrite"); $this->_oView->rootdir_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif (!is_dir($_SERVER['DOCUMENT_ROOT'] . $request['rootdir'])) { if (mr_arrayValue($request, 'checkrootdir') == 1) { // root dir check is enabled, this results in error - $sMsg = i18n("The specified directory '%s' does not exists", "mod_rewrite"); + $sMsg = i18n("The specified directory '%s' does not exists", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $_SERVER['DOCUMENT_ROOT'] . $request['rootdir']); $this->_oView->rootdir_error = $this->_notifyBox('error', $sMsg); $bError = true; } else { // root dir check ist disabled, take over the setting and // output a warning. - $sMsg = i18n("The specified directory '%s' does not exists in DOCUMENT_ROOT '%s'. This could happen, if clients DOCUMENT_ROOT differs from CONTENIDO backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.", "mod_rewrite"); + $sMsg = i18n("The specified directory '%s' does not exists in DOCUMENT_ROOT '%s'. This could happen, if clients DOCUMENT_ROOT differs from CONTENIDO backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $request['rootdir'], $_SERVER['DOCUMENT_ROOT']); $this->_oView->rootdir_error = $this->_notifyBox('warning', $sMsg); } } $this->_oView->rootdir = conHtmlentities($request['rootdir']); - $aMR['mod_rewrite']['rootdir'] = $request['rootdir']; + $aMR['cl-mod-rewrite']['rootdir'] = $request['rootdir']; } // root dir check if (mr_arrayValue($request, 'checkrootdir') == 1) { $this->_oView->checkrootdir_chk = ' checked="checked"'; - $aMR['mod_rewrite']['checkrootdir'] = 1; + $aMR['cl-mod-rewrite']['checkrootdir'] = 1; } else { $this->_oView->checkrootdir_chk = ''; - $aMR['mod_rewrite']['checkrootdir'] = 0; + $aMR['cl-mod-rewrite']['checkrootdir'] = 0; } // start from root if (mr_arrayValue($request, 'startfromroot') == 1) { $this->_oView->startfromroot_chk = ' checked="checked"'; - $aMR['mod_rewrite']['startfromroot'] = 1; + $aMR['cl-mod-rewrite']['startfromroot'] = 1; } else { $this->_oView->startfromroot_chk = ''; - $aMR['mod_rewrite']['startfromroot'] = 0; + $aMR['cl-mod-rewrite']['startfromroot'] = 0; } // prevent duplicated content if (mr_arrayValue($request, 'prevent_duplicated_content') == 1) { $this->_oView->prevent_duplicated_content_chk = ' checked="checked"'; - $aMR['mod_rewrite']['prevent_duplicated_content'] = 1; + $aMR['cl-mod-rewrite']['prevent_duplicated_content'] = 1; } else { $this->_oView->prevent_duplicated_content_chk = ''; - $aMR['mod_rewrite']['prevent_duplicated_content'] = 0; + $aMR['cl-mod-rewrite']['prevent_duplicated_content'] = 0; } // language settings if (mr_arrayValue($request, 'use_language') == 1) { $this->_oView->use_language_chk = ' checked="checked"'; $this->_oView->use_language_name_disabled = ''; - $aMR['mod_rewrite']['use_language'] = 1; + $aMR['cl-mod-rewrite']['use_language'] = 1; if (mr_arrayValue($request, 'use_language_name') == 1) { $this->_oView->use_language_name_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use_language_name'] = 1; + $aMR['cl-mod-rewrite']['use_language_name'] = 1; } else { $this->_oView->use_language_name_chk = ''; - $aMR['mod_rewrite']['use_language_name'] = 0; + $aMR['cl-mod-rewrite']['use_language_name'] = 0; } } else { $this->_oView->use_language_chk = ''; $this->_oView->use_language_name_chk = ''; $this->_oView->use_language_name_disabled = ' disabled="disabled"'; - $aMR['mod_rewrite']['use_language'] = 0; - $aMR['mod_rewrite']['use_language_name'] = 0; + $aMR['cl-mod-rewrite']['use_language'] = 0; + $aMR['cl-mod-rewrite']['use_language_name'] = 0; } // client settings if (mr_arrayValue($request, 'use_client') == 1) { $this->_oView->use_client_chk = ' checked="checked"'; $this->_oView->use_client_name_disabled = ''; - $aMR['mod_rewrite']['use_client'] = 1; + $aMR['cl-mod-rewrite']['use_client'] = 1; if (mr_arrayValue($request, 'use_client_name') == 1) { $this->_oView->use_client_name_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use_client_name'] = 1; + $aMR['cl-mod-rewrite']['use_client_name'] = 1; } else { $this->_oView->use_client_name_chk = ''; - $aMR['mod_rewrite']['use_client_name'] = 0; + $aMR['cl-mod-rewrite']['use_client_name'] = 0; } } else { $this->_oView->use_client_chk = ''; $this->_oView->use_client_name_chk = ''; $this->_oView->use_client_name_disabled = ' disabled="disabled"'; - $aMR['mod_rewrite']['use_client'] = 0; - $aMR['mod_rewrite']['use_client_name'] = 0; + $aMR['cl-mod-rewrite']['use_client'] = 0; + $aMR['cl-mod-rewrite']['use_client_name'] = 0; } // use lowercase uri if (mr_arrayValue($request, 'use_lowercase_uri') == 1) { $this->_oView->use_lowercase_uri_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use_lowercase_uri'] = 1; + $aMR['cl-mod-rewrite']['use_lowercase_uri'] = 1; } else { $this->_oView->use_lowercase_uri_chk = ''; - $aMR['mod_rewrite']['use_lowercase_uri'] = 0; + $aMR['cl-mod-rewrite']['use_lowercase_uri'] = 0; } $this->_oView->category_separator_attrib = ''; @@ -179,144 +179,144 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { // category seperator if ($categorySeperator == '') { - $sMsg = i18n("Please specify separator (%s) for category", "mod_rewrite"); + $sMsg = i18n("Please specify separator (%s) for category", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $separatorInfo); $this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif (!preg_match($separatorPattern, $categorySeperator)) { - $sMsg = i18n("Invalid separator for category, allowed one of following characters: %s", "mod_rewrite"); + $sMsg = i18n("Invalid separator for category, allowed one of following characters: %s", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $separatorInfo); $this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // category word seperator } elseif ($categoryWordSeperator == '') { - $sMsg = i18n("Please specify separator (%s) for category words", "mod_rewrite"); + $sMsg = i18n("Please specify separator (%s) for category words", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $wordSeparatorInfo); $this->_oView->category_word_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif (!preg_match($wordSeparatorPattern, $categoryWordSeperator)) { - $sMsg = i18n("Invalid separator for category words, allowed one of following characters: %s", "mod_rewrite"); + $sMsg = i18n("Invalid separator for category words, allowed one of following characters: %s", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $wordSeparatorInfo); $this->_oView->category_word_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // article seperator } elseif ($articleSeperator == '') { - $sMsg = i18n("Please specify separator (%s) for article", "mod_rewrite"); + $sMsg = i18n("Please specify separator (%s) for article", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $separatorInfo); $this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif (!preg_match($separatorPattern, $articleSeperator)) { - $sMsg = i18n("Invalid separator for article, allowed is one of following characters: %s", "mod_rewrite"); + $sMsg = i18n("Invalid separator for article, allowed is one of following characters: %s", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $separatorInfo); $this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // article word seperator } elseif ($articleWordSeperator == '') { - $sMsg = i18n("Please specify separator (%s) for article words", "mod_rewrite"); + $sMsg = i18n("Please specify separator (%s) for article words", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $wordSeparatorInfo); $this->_oView->article_word_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif (!preg_match($wordSeparatorPattern, $articleWordSeperator)) { - $sMsg = i18n("Invalid separator for article words, allowed is one of following characters: %s", "mod_rewrite"); + $sMsg = i18n("Invalid separator for article words, allowed is one of following characters: %s", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $wordSeparatorInfo); $this->_oView->article_word_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // category_seperator - category_word_seperator } elseif ($categorySeperator == $categoryWordSeperator) { - $sMsg = i18n("Separator for category and category words must not be identical", "mod_rewrite"); + $sMsg = i18n("Separator for category and category words must not be identical", "cl-mod-rewrite"); $this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // category_seperator - article_word_seperator } elseif ($categorySeperator == $articleWordSeperator) { - $sMsg = i18n("Separator for category and article words must not be identical", "mod_rewrite"); + $sMsg = i18n("Separator for category and article words must not be identical", "cl-mod-rewrite"); $this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; // article_seperator - article_word_seperator } elseif ($articleSeperator == $articleWordSeperator) { - $sMsg = i18n("Separator for category-article and article words must not be identical", "mod_rewrite"); + $sMsg = i18n("Separator for category-article and article words must not be identical", "cl-mod-rewrite"); $this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg); $bError = true; } $this->_oView->category_separator = conHtmlentities($categorySeperator); - $aMR['mod_rewrite']['category_seperator'] = $categorySeperator; + $aMR['cl-mod-rewrite']['category_seperator'] = $categorySeperator; $this->_oView->category_word_separator = conHtmlentities($categoryWordSeperator); - $aMR['mod_rewrite']['category_word_seperator'] = $categoryWordSeperator; + $aMR['cl-mod-rewrite']['category_word_seperator'] = $categoryWordSeperator; $this->_oView->article_separator = conHtmlentities($articleSeperator); - $aMR['mod_rewrite']['article_seperator'] = $articleSeperator; + $aMR['cl-mod-rewrite']['article_seperator'] = $articleSeperator; $this->_oView->article_word_separator = conHtmlentities($articleWordSeperator); - $aMR['mod_rewrite']['article_word_seperator'] = $articleWordSeperator; + $aMR['cl-mod-rewrite']['article_word_seperator'] = $articleWordSeperator; // file extension if (mr_arrayValue($request, 'file_extension', '') !== '') { if (!preg_match('/^\.([a-zA-Z0-9\-_\/])*$/', $request['file_extension'])) { - $sMsg = i18n("The file extension has a invalid format, allowed are the chars \.([a-zA-Z0-9\-_\/])", "mod_rewrite"); + $sMsg = i18n("The file extension has a invalid format, allowed are the chars \.([a-zA-Z0-9\-_\/])", "cl-mod-rewrite"); $this->_oView->file_extension_error = $this->_notifyBox('error', $sMsg); $bError = true; } $this->_oView->file_extension = conHtmlentities($request['file_extension']); - $aMR['mod_rewrite']['file_extension'] = $request['file_extension']; + $aMR['cl-mod-rewrite']['file_extension'] = $request['file_extension']; } else { $this->_oView->file_extension = '.html'; - $aMR['mod_rewrite']['file_extension'] = '.html'; + $aMR['cl-mod-rewrite']['file_extension'] = '.html'; } // category resolve min percentage if (isset($request['category_resolve_min_percentage'])) { if (!is_numeric($request['category_resolve_min_percentage'])) { - $sMsg = i18n("Value has to be numeric.", "mod_rewrite"); + $sMsg = i18n("Value has to be numeric.", "cl-mod-rewrite"); $this->_oView->category_resolve_min_percentage_error = $this->_notifyBox('error', $sMsg); $bError = true; } elseif ($request['category_resolve_min_percentage'] < 0 || $request['category_resolve_min_percentage'] > 100) { - $sMsg = i18n("Value has to be between 0 an 100.", "mod_rewrite"); + $sMsg = i18n("Value has to be between 0 an 100.", "cl-mod-rewrite"); $this->_oView->category_resolve_min_percentage_error = $this->_notifyBox('error', $sMsg); $bError = true; } $this->_oView->category_resolve_min_percentage = $request['category_resolve_min_percentage']; - $aMR['mod_rewrite']['category_resolve_min_percentage'] = $request['category_resolve_min_percentage']; + $aMR['cl-mod-rewrite']['category_resolve_min_percentage'] = $request['category_resolve_min_percentage']; } else { $this->_oView->category_resolve_min_percentage = '75'; - $aMR['mod_rewrite']['category_resolve_min_percentage'] = '75'; + $aMR['cl-mod-rewrite']['category_resolve_min_percentage'] = '75'; } // add start article name to url if (mr_arrayValue($request, 'add_startart_name_to_url') == 1) { $this->_oView->add_startart_name_to_url_chk = ' checked="checked"'; - $aMR['mod_rewrite']['add_startart_name_to_url'] = 1; + $aMR['cl-mod-rewrite']['add_startart_name_to_url'] = 1; if (mr_arrayValue($request, 'add_startart_name_to_url', '') !== '') { if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/', $request['default_startart_name'])) { - $sMsg = i18n("The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\-_\/\.]*$/", "mod_rewrite"); + $sMsg = i18n("The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\-_\/\.]*$/", "cl-mod-rewrite"); $this->_oView->add_startart_name_to_url_error = $this->_notifyBox('error', $sMsg); $bError = true; } $this->_oView->default_startart_name = conHtmlentities($request['default_startart_name']); - $aMR['mod_rewrite']['default_startart_name'] = $request['default_startart_name']; + $aMR['cl-mod-rewrite']['default_startart_name'] = $request['default_startart_name']; } else { $this->_oView->default_startart_name = ''; - $aMR['mod_rewrite']['default_startart_name'] = ''; + $aMR['cl-mod-rewrite']['default_startart_name'] = ''; } } else { $this->_oView->add_startart_name_to_url_chk = ''; - $aMR['mod_rewrite']['add_startart_name_to_url'] = 0; + $aMR['cl-mod-rewrite']['add_startart_name_to_url'] = 0; $this->_oView->default_startart_name = ''; - $aMR['mod_rewrite']['default_startart_name'] = ''; + $aMR['cl-mod-rewrite']['default_startart_name'] = ''; } // rewrite urls at if (mr_arrayValue($request, 'rewrite_urls_at') == 'congeneratecode') { $this->_oView->rewrite_urls_at_congeneratecode_chk = ' checked="checked"'; $this->_oView->rewrite_urls_at_front_content_output_chk = ''; - $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode'] = 1; - $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'] = 0; + $aMR['cl-mod-rewrite']['rewrite_urls_at_congeneratecode'] = 1; + $aMR['cl-mod-rewrite']['rewrite_urls_at_front_content_output'] = 0; } else { $this->_oView->rewrite_urls_at_congeneratecode_chk = ''; $this->_oView->rewrite_urls_at_front_content_output_chk = ' checked="checked"'; - $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode'] = 0; - $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'] = 1; + $aMR['cl-mod-rewrite']['rewrite_urls_at_congeneratecode'] = 0; + $aMR['cl-mod-rewrite']['rewrite_urls_at_front_content_output'] = 1; } // routing @@ -336,23 +336,23 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { $aRouting[$routingDef[0]] = $routingDef[1]; } $this->_oView->rewrite_routing = conHtmlentities($request['rewrite_routing']); - $aMR['mod_rewrite']['routing'] = $aRouting; + $aMR['cl-mod-rewrite']['routing'] = $aRouting; } else { $this->_oView->rewrite_routing = ''; - $aMR['mod_rewrite']['routing'] = array(); + $aMR['cl-mod-rewrite']['routing'] = array(); } // redirect invalid article to errorsite if (isset($request['redirect_invalid_article_to_errorsite'])) { $this->_oView->redirect_invalid_article_to_errorsite_chk = ' checked="checked"'; - $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 1; + $aMR['cl-mod-rewrite']['redirect_invalid_article_to_errorsite'] = 1; } else { $this->_oView->redirect_invalid_article_to_errorsite_chk = ''; - $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; + $aMR['cl-mod-rewrite']['redirect_invalid_article_to_errorsite'] = 0; } if ($bError) { - $sMsg = i18n("Please check your input", "mod_rewrite"); + $sMsg = i18n("Please check your input", "cl-mod-rewrite"); $this->_oView->content_before .= $this->_notifyBox('error', $sMsg); return; } @@ -360,23 +360,23 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { if ($bDebug == true) { echo $this->_notifyBox('info', 'Debug'); echo '
';
-            print_r($aMR['mod_rewrite']);
+            print_r($aMR['cl-mod-rewrite']);
             echo '
'; - $sMsg = i18n("Configuration has not been saved, because of enabled debugging", "mod_rewrite"); + $sMsg = i18n("Configuration has not been saved, because of enabled debugging", "cl-mod-rewrite"); echo $this->_notifyBox('info', $sMsg); return; } - $bSeparatorModified = $this->_separatorModified($aMR['mod_rewrite']); + $bSeparatorModified = $this->_separatorModified($aMR['cl-mod-rewrite']); if (mr_setConfiguration($this->_client, $aMR)) { - $sMsg = i18n("Configuration has been saved", "mod_rewrite"); + $sMsg = i18n("Configuration has been saved", "cl-mod-rewrite"); if ($bSeparatorModified) { mr_loadConfiguration($this->_client, true); } $this->_oView->content_before .= $this->_notifyBox('info', $sMsg); } else { - $sMsg = i18n("Configuration could not saved. Please check write permissions for %s ", "mod_rewrite"); + $sMsg = i18n("Configuration could not saved. Please check write permissions for %s ", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, $options['key']); $this->_oView->content_before .= $this->_notifyBox('error', $sMsg); } @@ -409,7 +409,7 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { protected function _doChecks() { // Check for not supported '$cfg["is_start_compatible"] = true;' mode if (!empty($this->_cfg['is_start_compatible']) && true === $this->_cfg['is_start_compatible']) { - $sMsg = i18n("Your Contenido installation runs with the setting 'is_start_compatible'. This plugin will not work properly in this mode.
Please check following topic in Contenido forum to change this:

is_start_compatible auf neue Version umstellen", "mod_rewrite"); + $sMsg = i18n("Your Contenido installation runs with the setting 'is_start_compatible'. This plugin will not work properly in this mode.
Please check following topic in Contenido forum to change this:

is_start_compatible auf neue Version umstellen", "cl-mod-rewrite"); $this->_oView->content_before .= $this->_notifyBox('warning', $sMsg); } @@ -417,7 +417,7 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { $db = new DB_Contenido(); $sql = "SELECT idcatlang FROM " . $this->_cfg['tab']['cat_lang'] . " WHERE urlpath = ''"; if ($db->query($sql) && $db->next_record()) { - $sMsg = i18n("It seems as if some categories don't have a set 'urlpath' entry in the database. Please reset empty aliases in %sFunctions%s area.", "mod_rewrite"); + $sMsg = i18n("It seems as if some categories don't have a set 'urlpath' entry in the database. Please reset empty aliases in %sFunctions%s area.", "cl-mod-rewrite"); $sMsg = sprintf($sMsg, '', ''); $this->_oView->content_before .= $this->_notifyBox('warning', $sMsg); } diff --git a/classes/controller/class.modrewrite_contentexpert_controller.php b/classes/controller/class.modrewrite_contentexpert_controller.php index 8c647dc..a0ae01f 100644 --- a/classes/controller/class.modrewrite_contentexpert_controller.php +++ b/classes/controller/class.modrewrite_contentexpert_controller.php @@ -45,7 +45,7 @@ class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract { public function init() { $this->_oView->content_before = ''; - $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/'; + $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'cl-mod-rewrite/'; $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt'; $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt'; } diff --git a/classes/controller/class.modrewrite_controller_abstract.php b/classes/controller/class.modrewrite_controller_abstract.php index 8f8d06c..cf1bb01 100644 --- a/classes/controller/class.modrewrite_controller_abstract.php +++ b/classes/controller/class.modrewrite_controller_abstract.php @@ -18,7 +18,7 @@ if (!defined('CON_FRAMEWORK')) { } /** - * Abstract controller for all concrete mod_rewrite controller implementations. + * Abstract controller for all concrete cl-mod-rewrite controller implementations. * * @author Murat Purc * @package plugin @@ -104,7 +104,7 @@ abstract class ModRewrite_ControllerAbstract { $this->_oView->frame = $this->_frame; $this->_oView->contenido = $this->_contenido; $this->_oView->sessid = $sess->id; - $this->_oView->lng_more_informations = i18n("More informations", "mod_rewrite"); + $this->_oView->lng_more_informations = i18n("More informations", "cl-mod-rewrite"); $this->init(); } diff --git a/includes/config.mod_rewrite_default.php b/includes/config.mod_rewrite_default.php index 3476a5b..99c3b30 100644 --- a/includes/config.mod_rewrite_default.php +++ b/includes/config.mod_rewrite_default.php @@ -31,56 +31,56 @@ if (!defined('CON_FRAMEWORK')) { global $cfg; // Use advanced mod_rewrites ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use'] = 0; +$cfg['cl-mod-rewrite']['use'] = 0; // Path to the htaccess file with trailling slash from domain-root! -$cfg['mod_rewrite']['rootdir'] = '/'; +$cfg['cl-mod-rewrite']['rootdir'] = '/'; // Check path to the htaccess file ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['checkrootdir'] = 1; +$cfg['cl-mod-rewrite']['checkrootdir'] = 1; // Start TreeLocation from Root Tree (set to 1) or get location from first category (set to 0) -$cfg['mod_rewrite']['startfromroot'] = 0; +$cfg['cl-mod-rewrite']['startfromroot'] = 0; // Prevent Duplicated Content, if startfromroot is enabled ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['prevent_duplicated_content'] = 0; +$cfg['cl-mod-rewrite']['prevent_duplicated_content'] = 0; // is multilanguage? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_language'] = 0; +$cfg['cl-mod-rewrite']['use_language'] = 0; // use language name in url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_language_name'] = 0; +$cfg['cl-mod-rewrite']['use_language_name'] = 0; // is multiclient in only one directory? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_client'] = 0; +$cfg['cl-mod-rewrite']['use_client'] = 0; // use client name in url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_client_name'] = 0; +$cfg['cl-mod-rewrite']['use_client_name'] = 0; // use lowercase url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_lowercase_uri'] = 1; +$cfg['cl-mod-rewrite']['use_lowercase_uri'] = 1; // file extension for article links -$cfg['mod_rewrite']['file_extension'] = '.html'; +$cfg['cl-mod-rewrite']['file_extension'] = '.html'; // The percentage if the category name have to match with database names. -$cfg['mod_rewrite']['category_resolve_min_percentage'] = '75'; +$cfg['cl-mod-rewrite']['category_resolve_min_percentage'] = '75'; // Add start article name to url (1 = yes, 0 = none) -$cfg['mod_rewrite']['add_startart_name_to_url'] = 1; +$cfg['cl-mod-rewrite']['add_startart_name_to_url'] = 1; // Default start article name to use, depends on active add_startart_name_to_url -$cfg['mod_rewrite']['default_startart_name'] = 'index'; +$cfg['cl-mod-rewrite']['default_startart_name'] = 'index'; // Rewrite urls on generating the code for the page. If active, the responsibility will be // outsourced to moduleoutputs and you have to adapt the moduleoutputs manually. Each output of // internal article/category links must be processed by using $sess->url. (1 = yes, 0 = none) -$cfg['mod_rewrite']['rewrite_urls_at_congeneratecode'] = 0; +$cfg['cl-mod-rewrite']['rewrite_urls_at_congeneratecode'] = 0; // Rewrite urls on output of htmlcode at front_content.php. Is the old way, and doesn't require // adapting of moduleoutputs. On the other hand usage of this way will be slower than rewriting // option above. (1 = yes, 0 = none) -$cfg['mod_rewrite']['rewrite_urls_at_front_content_output'] = 1; +$cfg['cl-mod-rewrite']['rewrite_urls_at_front_content_output'] = 1; // Following five settings write urls like this one: @@ -89,26 +89,26 @@ $cfg['mod_rewrite']['rewrite_urls_at_front_content_output'] = 1; // backend. // NOTE: category_seperator and article_seperator must contain different character. // Separator for categories -$cfg['mod_rewrite']['category_seperator'] = '/'; +$cfg['cl-mod-rewrite']['category_seperator'] = '/'; // Separator between category and article -$cfg['mod_rewrite']['article_seperator'] = '/'; +$cfg['cl-mod-rewrite']['article_seperator'] = '/'; // Word seperator in category names -$cfg['mod_rewrite']['category_word_seperator'] = '-'; +$cfg['cl-mod-rewrite']['category_word_seperator'] = '-'; // Word seperator in article names -$cfg['mod_rewrite']['article_word_seperator'] = '-'; +$cfg['cl-mod-rewrite']['article_word_seperator'] = '-'; // Routing settings for incomming urls. Here you can define routing rules as follows: -// $cfg['mod_rewrite']['routing'] = array( +// $cfg['cl-mod-rewrite']['routing'] = array( // '/a_incomming/url/foobar.html' => '/new_url/foobar.html', # route /a_incomming/url/foobar.html to /new_url/foobar.html // '/cms/' => '/' # route /cms/ to / (doc root of client) // ); -$cfg['mod_rewrite']['routing'] = array(); +$cfg['cl-mod-rewrite']['routing'] = array(); // Redirect invalid articles to errorpage (1 = yes, 0 = none) -$cfg['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; +$cfg['cl-mod-rewrite']['redirect_invalid_article_to_errorsite'] = 0; diff --git a/includes/config.plugin.php b/includes/config.plugin.php index 2cb5754..b00024b 100644 --- a/includes/config.plugin.php +++ b/includes/config.plugin.php @@ -52,25 +52,25 @@ if (isset($client) && (int) $client > 0) { // include necessary sources cInclude('classes', 'Debug/DebuggerFactory.class.php'); -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php'); -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_content_controller.php'); -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contentexpert_controller.php'); -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contenttest_controller.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.modrewritedebugger.php'); -plugin_include('mod_rewrite', 'classes/class.modrewritetest.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'); +plugin_include('cl-mod-rewrite', 'classes/controller/class.modrewrite_controller_abstract.php'); +plugin_include('cl-mod-rewrite', 'classes/controller/class.modrewrite_content_controller.php'); +plugin_include('cl-mod-rewrite', 'classes/controller/class.modrewrite_contentexpert_controller.php'); +plugin_include('cl-mod-rewrite', 'classes/controller/class.modrewrite_contenttest_controller.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewritebase.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewrite.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewritecontroller.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewritedebugger.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewritetest.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewriteurlstack.php'); +plugin_include('cl-mod-rewrite', 'classes/class.modrewriteurlutil.php'); +plugin_include('cl-mod-rewrite', 'includes/functions.mod_rewrite.php'); global $lngAct; -$lngAct['mod_rewrite']['mod_rewrite'] = i18n("Advanced Mod Rewrite", "mod_rewrite"); -$lngAct['mod_rewrite']['mod_rewrite_expert'] = i18n("Advanced Mod Rewrite functions", "mod_rewrite"); -$lngAct['mod_rewrite']['mod_rewrite_test'] = i18n("Advanced Mod Rewrite test", "mod_rewrite"); +$lngAct['cl-mod-rewrite']['mod_rewrite'] = i18n("Advanced Mod Rewrite", "cl-mod-rewrite"); +$lngAct['cl-mod-rewrite']['mod_rewrite_expert'] = i18n("Advanced Mod Rewrite functions", "cl-mod-rewrite"); +$lngAct['cl-mod-rewrite']['mod_rewrite_test'] = i18n("Advanced Mod Rewrite test", "cl-mod-rewrite"); // set debug configuration diff --git a/includes/functions.mod_rewrite.php b/includes/functions.mod_rewrite.php index 76d32dc..28bc291 100644 --- a/includes/functions.mod_rewrite.php +++ b/includes/functions.mod_rewrite.php @@ -1,4 +1,5 @@ * @copyright www.polycoder.de @@ -22,16 +23,14 @@ * @link http://www.4fb.de * @link http://www.contenido.org */ - if (!defined('CON_FRAMEWORK')) { die('Illegal call'); } cInclude('classes', 'contenido/class.articlelanguage.php'); - /** - * Processes mod_rewrite related job for created new tree. + * Processes cl-mod-rewrite related job for created new tree. * * Will be called by chain 'Contenido.Action.str_newtree.AfterCall'. * @@ -54,7 +53,7 @@ function mr_strNewTree(array $data) { } /** - * Processes mod_rewrite related job for created new category. + * Processes cl-mod-rewrite related job for created new category. * * Will be called by chain 'Contenido.Action.str_newcat.AfterCall'. * @@ -77,7 +76,7 @@ function mr_strNewCategory(array $data) { } /** - * Processes mod_rewrite related job for renamed category + * Processes cl-mod-rewrite related job for renamed category * 2010-02-01: and now all existing subcategories and modify their paths too... * 2010-02-01: max 50 recursion level * @@ -130,7 +129,7 @@ function mr_strRenameCategory(array $data) { } /** - * Processes mod_rewrite related job after moving a category up. + * Processes cl-mod-rewrite related job after moving a category up. * * Will be called by chain 'Contenido.Action.str_moveupcat.AfterCall'. * @@ -164,7 +163,7 @@ function mr_strMoveUpCategory($idcat) { } /** - * Processes mod_rewrite related job after moving a category down. + * Processes cl-mod-rewrite related job after moving a category down. * * Will be called by chain 'Contenido.Action.str_movedowncat.AfterCall'. * @@ -197,7 +196,7 @@ function mr_strMovedownCategory($idcat) { } /** - * Processes mod_rewrite related job after moving a category subtree. + * Processes cl-mod-rewrite related job after moving a category subtree. * * Will be called by chain 'Contenido.Action.str_movesubtree.AfterCall'. * @@ -239,7 +238,7 @@ function mr_strMoveSubtree(array $data) { } /** - * Processes mod_rewrite related job after copying a category subtree. + * Processes cl-mod-rewrite related job after copying a category subtree. * * Will be called by chain 'Contenido.Category.strCopyCategory'. * @@ -267,7 +266,7 @@ function mr_strCopyCategory(array $data) { } /** - * Processes mod_rewrite related job during structure synchronisation process, + * Processes cl-mod-rewrite related job during structure synchronisation process, * sets the urlpath of current category. * * Will be called by chain 'Contenido.Category.strSyncCategory_Loop'. @@ -282,7 +281,7 @@ function mr_strSyncCategory(array $data) { } /** - * Processes mod_rewrite related job for saved articles (new or modified article). + * Processes cl-mod-rewrite related job for saved articles (new or modified article). * * Will be called by chain 'Contenido.Action.con_saveart.AfterCall'. * @@ -322,7 +321,7 @@ function mr_conSaveArticle(array $data) { } /** - * Processes mod_rewrite related job for articles beeing moved. + * Processes cl-mod-rewrite related job for articles beeing moved. * * Will be called by chain 'Contenido.Article.conMoveArticles_Loop'. * @@ -350,7 +349,7 @@ function mr_conMoveArticles($data) { } /** - * Processes mod_rewrite related job for duplicated articles. + * Processes cl-mod-rewrite related job for duplicated articles. * * Will be called by chain 'Contenido.Article.conCopyArtLang_AfterInsert'. * @@ -377,7 +376,7 @@ function mr_conCopyArtLang($data) { } /** - * Processes mod_rewrite related job for synchronized articles. + * Processes cl-mod-rewrite related job for synchronized articles. * * Will be called by chain 'Contenido.Article.conSyncArticle_AfterInsert'. * @@ -465,7 +464,7 @@ function mr_buildNewUrl($url) { * Replaces existing ancors inside passed code, while rebuilding the urls. * * Will be called by chain 'Contenido.Content.conGenerateCode' or - * 'Contenido.Frontend.HTMLCodeOutput' depening on mod_rewrite settings. + * 'Contenido.Frontend.HTMLCodeOutput' depening on cl-mod-rewrite settings. * * @param string $code Code to prepare * @return string New code @@ -481,9 +480,9 @@ function mr_buildGeneratedCode($code) { // anchor hack $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$matches', 'return ModRewrite::rewriteHtmlAnchor($matches);'), - $code + "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", + create_function('$matches', 'return ModRewrite::rewriteHtmlAnchor($matches);'), + $code ); // remove tinymce single quote entities: @@ -495,9 +494,9 @@ function mr_buildGeneratedCode($code) { // IE hack with wrong base href interpretation $code = preg_replace_callback( - "/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/i", - create_function('$matches', 'return stripslashes($matches[1]' . $sBaseUri . ' . "upload/" . $matches[2] . $matches[3]);'), - $code + "/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/i", + create_function('$matches', 'return stripslashes($matches[1]' . $sBaseUri . ' . "upload/" . $matches[2] . $matches[3]);'), + $code ); // define some preparations to replace /front_content.php & ./front_content.php @@ -529,9 +528,9 @@ function mr_buildGeneratedCode($code) { $code = str_replace('"front_content.php"', '"' . mr_buildNewUrl('front_content.php') . '"', $code); $code = str_replace("'front_content.php'", "'" . mr_buildNewUrl('front_content.php') . "'", $code); $code = preg_replace_callback( - "/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", - create_function('$aMatches', 'return $aMatches[1] . mr_buildNewUrl("front_content.php" . $aMatches[2]) . $aMatches[3];'), - $code + "/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", + create_function('$aMatches', 'return $aMatches[1] . mr_buildNewUrl("front_content.php" . $aMatches[2]) . $aMatches[3];'), + $code ); ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() out'); @@ -540,9 +539,9 @@ function mr_buildGeneratedCode($code) { } else { // anchor hack for non modrewrite websites $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$matches', 'return ModRewrite::contenidoHtmlAnchor($matches, $GLOBALS["is_XHTML"]);'), - $code + "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", + create_function('$matches', 'return ModRewrite::contenidoHtmlAnchor($matches, $GLOBALS["is_XHTML"]);'), + $code ); } @@ -590,7 +589,7 @@ function mr_setClientLanguageId($client) { * Loads Advanced Mod Rewrite configuration for passed client using serialized * file containing the settings. * - * File is placed in /contenido/mod_rewrite/includes/and is named like + * File is placed in /contenido/cl-mod-rewrite/includes/and is named like * config.mod_rewrite_{client_id}.php. * * @param int $clientId Id of client @@ -615,16 +614,22 @@ function mr_loadConfiguration($clientId, $forceReload = false) { $cfg = array_merge($cfg, $mrConfig); } else { // couldn't load configuration, set defaults - include_once($cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_default.php'); + include_once($cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/includes/config.mod_rewrite_default.php'); } $aLoaded[$clientId] = true; } +function mr_getConfigurationFilePath($clientId) { + $clientConfig = cRegistry::getClientConfig((int) $clientId); + $fePath = $clientConfig['path']['frontend']; + return $fePath . 'data/config/' . CON_ENVIRONMENT . '/config.mod_rewrite.php'; +} + /** * Returns the mod rewrite configuration array of an client. * - * File is placed in /contenido/mod_rewrite/includes/and is named like + * File is placed in /contenido/cl-mod-rewrite/includes/and is named like * config.mod_rewrite_{client_id}.php. * * @param int $clientId Id of client @@ -633,12 +638,31 @@ function mr_loadConfiguration($clientId, $forceReload = false) { function mr_getConfiguration($clientId) { global $cfg; - $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; + $clientId = (int) $clientId; + + $file = mr_getConfigurationFilePath($clientId); + + if (!is_file($file) || !is_readable($file)) { + $backendPath = cRegistry::getBackendPath(); + $file = $cfg['path']['config'] . 'config.mod_rewrite_' . $clientId . '.php'; + } + + if (!is_file($file) || !is_readable($file)) { + $backendPath = cRegistry::getBackendPath(); + $file = $backendPath . $cfg['path']['plugins'] . 'cl-mod-rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; + } + if (!is_file($file) || !is_readable($file)) { return null; } + if ($content = file_get_contents($file)) { - return unserialize($content); + $content = unserialize($content); + if (array_key_exists("mod_rewrite", $content)) { + $content['cl-mod-rewrite'] = $content['mod_rewrite']; + unset($content['mod_rewrite']); + } + return $content; } else { return null; } @@ -647,7 +671,7 @@ function mr_getConfiguration($clientId) { /** * Saves the mod rewrite configuration array of an client. * - * File is placed in /contenido/mod_rewrite/includes/and is named like + * File is placed in /contenido/cl-mod-rewrite/includes/and is named like * config.mod_rewrite_{client_id}.php. * * @param int $clientId Id of client @@ -657,7 +681,7 @@ function mr_getConfiguration($clientId) { function mr_setConfiguration($clientId, array $config) { global $cfg; - $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; + $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; $result = file_put_contents($file, serialize($config)); return ($result) ? true : false; } @@ -673,10 +697,10 @@ function mr_setConfiguration($clientId, array $config) { function mr_runFrontendController() { $iStartTime = getmicrotime(); - plugin_include('mod_rewrite', 'includes/config.plugin.php'); + plugin_include('cl-mod-rewrite', 'includes/config.plugin.php'); if (ModRewrite::isEnabled() == true) { - plugin_include('mod_rewrite', 'includes/front_content_controller.php'); + plugin_include('cl-mod-rewrite', 'includes/front_content_controller.php'); $totalTime = sprintf('%.4f', (getmicrotime() - $iStartTime)); ModRewriteDebugger::add($totalTime, 'mr_runFrontendController() total time'); @@ -891,8 +915,7 @@ function mr_header($header) { */ function mr_debugOutput($print = true) { global $DB_Contenido_QueryCache; - if (isset($DB_Contenido_QueryCache) && is_array($DB_Contenido_QueryCache) && - count($DB_Contenido_QueryCache) > 0) { + if (isset($DB_Contenido_QueryCache) && is_array($DB_Contenido_QueryCache) && count($DB_Contenido_QueryCache) > 0) { ModRewriteDebugger::add($DB_Contenido_QueryCache, 'sql statements'); // calculate total time consumption of queries diff --git a/includes/include.mod_rewrite_content.php b/includes/include.mod_rewrite_content.php index 23fcc74..05227e0 100644 --- a/includes/include.mod_rewrite_content.php +++ b/includes/include.mod_rewrite_content.php @@ -1,6 +1,6 @@ rewrite_routing = $data; $oView->redirect_invalid_article_to_errorsite_chk = ($aMrCfg['redirect_invalid_article_to_errorsite'] == 1) ? ' checked="checked"' : ''; -$oView->lng_version = i18n("Version", "mod_rewrite"); -$oView->lng_author = i18n("Author", "mod_rewrite"); -$oView->lng_mail_to_author = i18n("E-Mail to author", "mod_rewrite"); -$oView->lng_pluginpage = i18n("Plugin page", "mod_rewrite"); -$oView->lng_visit_pluginpage = i18n("Visit plugin page", "mod_rewrite"); -$oView->lng_opens_in_new_window = i18n("opens page in new window", "mod_rewrite"); -$oView->lng_contenido_forum = i18n("CONTENIDO forum", "mod_rewrite"); -$oView->lng_pluginthread_in_contenido_forum = i18n("Plugin thread in CONTENIDO forum", "mod_rewrite"); -$oView->lng_plugin_settings = i18n("Plugin settings", "mod_rewrite"); -$oView->lng_note = i18n("Note", "mod_rewrite"); +$oView->lng_version = i18n("Version", "cl-mod-rewrite"); +$oView->lng_author = i18n("Author", "cl-mod-rewrite"); +$oView->lng_mail_to_author = i18n("E-Mail to author", "cl-mod-rewrite"); +$oView->lng_pluginpage = i18n("Plugin page", "cl-mod-rewrite"); +$oView->lng_visit_pluginpage = i18n("Visit plugin page", "cl-mod-rewrite"); +$oView->lng_opens_in_new_window = i18n("opens page in new window", "cl-mod-rewrite"); +$oView->lng_contenido_forum = i18n("CONTENIDO forum", "cl-mod-rewrite"); +$oView->lng_pluginthread_in_contenido_forum = i18n("Plugin thread in CONTENIDO forum", "cl-mod-rewrite"); +$oView->lng_plugin_settings = i18n("Plugin settings", "cl-mod-rewrite"); +$oView->lng_note = i18n("Note", "cl-mod-rewrite"); // @todo copy htacccess check into ModRewrite_ContentController->_doChecks() -$sMsg = i18n("The .htaccess file could not found either in CONTENIDO installation directory nor in client directory.
It should set up in %sFunctions%s area, if needed.", "mod_rewrite"); +$sMsg = i18n("The .htaccess file could not found either in CONTENIDO installation directory nor in client directory.
It should set up in %sFunctions%s area, if needed.", "cl-mod-rewrite"); $oView->lng_msg_no_htaccess_found = sprintf($sMsg, '', ''); -$sMsg = i18n("Found", "mod_rewrite"); +$sMsg = i18n("Found", "cl-mod-rewrite"); $oView->lng_msg_no_emptyaliases_found = sprintf($sMsg, '', ''); -$oView->lng_enable_amr = i18n("Enable Advanced Mod Rewrite", "mod_rewrite"); +$oView->lng_enable_amr = i18n("Enable Advanced Mod Rewrite", "cl-mod-rewrite"); -$oView->lng_msg_enable_amr_info = i18n("Disabling of plugin does not result in disabling mod rewrite module of the web server - This means,
all defined rules in the .htaccess are still active and could create unwanted side effects.

Apache mod rewrite could be enabled/disabled by setting the RewriteEngine directive.
Any defined rewrite rules could remain in the .htaccess and they will not processed,
if the mod rewrite module is disabled", "mod_rewrite"); +$oView->lng_msg_enable_amr_info = i18n("Disabling of plugin does not result in disabling mod rewrite module of the web server - This means,
all defined rules in the .htaccess are still active and could create unwanted side effects.

Apache mod rewrite could be enabled/disabled by setting the RewriteEngine directive.
Any defined rewrite rules could remain in the .htaccess and they will not processed,
if the mod rewrite module is disabled", "cl-mod-rewrite"); -$oView->lng_example = i18n("Example", "mod_rewrite"); +$oView->lng_example = i18n("Example", "cl-mod-rewrite"); -$oView->lng_msg_enable_amr_info_example = i18n("# enable apache mod rewrite module\nRewriteEngine on\n\n# disable apache mod rewrite module\nRewriteEngine off", "mod_rewrite"); +$oView->lng_msg_enable_amr_info_example = i18n("# enable apache mod rewrite module\nRewriteEngine on\n\n# disable apache mod rewrite module\nRewriteEngine off", "cl-mod-rewrite"); -$oView->lng_rootdir = i18n("Path to .htaccess from DocumentRoot", "mod_rewrite"); -$oView->lng_rootdir_info = i18n("Type '/' if the .htaccess file lies inside the wwwroot (DocumentRoot) folder.
Type the path to the subfolder fromm wwwroot, if CONTENIDO is installed in a subfolder within the wwwroot
(e. g. http://domain/mycontenido -> path = '/mycontenido/')", "mod_rewrite"); +$oView->lng_rootdir = i18n("Path to .htaccess from DocumentRoot", "cl-mod-rewrite"); +$oView->lng_rootdir_info = i18n("Type '/' if the .htaccess file lies inside the wwwroot (DocumentRoot) folder.
Type the path to the subfolder fromm wwwroot, if CONTENIDO is installed in a subfolder within the wwwroot
(e. g. http://domain/mycontenido -> path = '/mycontenido/')", "cl-mod-rewrite"); -$oView->lng_checkrootdir = i18n("Check path to .htaccess", "mod_rewrite"); -$oView->lng_checkrootdir_info = i18n("The path will be checked, if this option is enabled.
But this could result in an error in some cases, even if the specified path is valid and
clients DocumentRoot differs from CONTENIDO backend DocumentRoot.", "mod_rewrite"); +$oView->lng_checkrootdir = i18n("Check path to .htaccess", "cl-mod-rewrite"); +$oView->lng_checkrootdir_info = i18n("The path will be checked, if this option is enabled.
But this could result in an error in some cases, even if the specified path is valid and
clients DocumentRoot differs from CONTENIDO backend DocumentRoot.", "cl-mod-rewrite"); -$oView->lng_startfromroot = i18n("Should the name of root category be displayed in the URL?", "mod_rewrite"); -$oView->lng_startfromroot_lbl = i18n("Start from root category", "mod_rewrite"); -$oView->lng_startfromroot_info = i18n("If enabled, the name of the root category (e. g. 'Mainnavigation' in a CONTENIDO default installation), will be preceded to the URL.", "mod_rewrite"); +$oView->lng_startfromroot = i18n("Should the name of root category be displayed in the URL?", "cl-mod-rewrite"); +$oView->lng_startfromroot_lbl = i18n("Start from root category", "cl-mod-rewrite"); +$oView->lng_startfromroot_info = i18n("If enabled, the name of the root category (e. g. 'Mainnavigation' in a CONTENIDO default installation), will be preceded to the URL.", "cl-mod-rewrite"); -$oView->lng_use_client = i18n("Are several clients maintained in one directory?", "mod_rewrite"); -$oView->lng_use_client_lbl = i18n("Prepend client to the URL", "mod_rewrite"); -$oView->lng_use_client_name_lbl = i18n("Use client name instead of the id", "mod_rewrite"); +$oView->lng_use_client = i18n("Are several clients maintained in one directory?", "cl-mod-rewrite"); +$oView->lng_use_client_lbl = i18n("Prepend client to the URL", "cl-mod-rewrite"); +$oView->lng_use_client_name_lbl = i18n("Use client name instead of the id", "cl-mod-rewrite"); -$oView->lng_use_language = i18n("Should the language appear in the URL (required for multi language websites)?", "mod_rewrite"); -$oView->lng_use_language_lbl = i18n("Prepend language to the URL", "mod_rewrite"); -$oView->lng_use_language_name_lbl = i18n("Use language name instead of the id", "mod_rewrite"); +$oView->lng_use_language = i18n("Should the language appear in the URL (required for multi language websites)?", "cl-mod-rewrite"); +$oView->lng_use_language_lbl = i18n("Prepend language to the URL", "cl-mod-rewrite"); +$oView->lng_use_language_name_lbl = i18n("Use language name instead of the id", "cl-mod-rewrite"); -$oView->lng_userdefined_separators_header = i18n("Configure your own separators with following 4 settings
to control generated URLs to your own taste", "mod_rewrite"); -$oView->lng_userdefined_separators_example = i18n("www.domain.com/category1-category2.articlename.html\nwww.domain.com/category1/category2-articlename.html\nwww.domain.com/category.name1~category2~articlename.html\nwww.domain.com/category_name1-category2-articlename.foo", "mod_rewrite"); -$oView->lng_userdefined_separators_example_a = i18n("Category separator has to be different from category-word separator", "mod_rewrite"); -$oView->lng_userdefined_separators_example_a_example = i18n("# Example: Category separator (/) and category-word separator (_)\ncategory_one/category_two/articlename.html", "mod_rewrite"); -$oView->lng_userdefined_separators_example_b = i18n("Category separator has to be different from article-word separator", "mod_rewrite"); -$oView->lng_userdefined_separators_example_b_example = i18n("# Example: Category separator (/) and article-word separator (-)\ncategory_one/category_two/article-description.html", "mod_rewrite"); -$oView->lng_userdefined_separators_example_c = i18n("Category-article separator has to be different from article-word separator", "mod_rewrite"); -$oView->lng_userdefined_separators_example_c_example = i18n("# Example: Category-article separator (/) and article-word separator (-)\ncategory_one/category_two/article-description.html", "mod_rewrite"); +$oView->lng_userdefined_separators_header = i18n("Configure your own separators with following 4 settings
to control generated URLs to your own taste", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example = i18n("www.domain.com/category1-category2.articlename.html\nwww.domain.com/category1/category2-articlename.html\nwww.domain.com/category.name1~category2~articlename.html\nwww.domain.com/category_name1-category2-articlename.foo", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_a = i18n("Category separator has to be different from category-word separator", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_a_example = i18n("# Example: Category separator (/) and category-word separator (_)\ncategory_one/category_two/articlename.html", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_b = i18n("Category separator has to be different from article-word separator", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_b_example = i18n("# Example: Category separator (/) and article-word separator (-)\ncategory_one/category_two/article-description.html", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_c = i18n("Category-article separator has to be different from article-word separator", "cl-mod-rewrite"); +$oView->lng_userdefined_separators_example_c_example = i18n("# Example: Category-article separator (/) and article-word separator (-)\ncategory_one/category_two/article-description.html", "cl-mod-rewrite"); -$oView->lng_category_separator = i18n("Category separator (delemiter between single categories)", "mod_rewrite"); -$oView->lng_catart_separator_info = sprintf(i18n("(possible values: %s)", "mod_rewrite"), $aSeparator['info']); -$oView->lng_word_separator_info = sprintf(i18n("(possible values: %s)", "mod_rewrite"), $aWordSeparator['info']); -$oView->lng_category_word_separator = i18n("Category-word separator (delemiter between category words)", "mod_rewrite"); -$oView->lng_article_separator = i18n("Category-article separator (delemiter between category-block and article)", "mod_rewrite"); -$oView->lng_article_word_separator = i18n("Article-word separator (delemiter between article words)", "mod_rewrite"); +$oView->lng_category_separator = i18n("Category separator (delemiter between single categories)", "cl-mod-rewrite"); +$oView->lng_catart_separator_info = sprintf(i18n("(possible values: %s)", "cl-mod-rewrite"), $aSeparator['info']); +$oView->lng_word_separator_info = sprintf(i18n("(possible values: %s)", "cl-mod-rewrite"), $aWordSeparator['info']); +$oView->lng_category_word_separator = i18n("Category-word separator (delemiter between category words)", "cl-mod-rewrite"); +$oView->lng_article_separator = i18n("Category-article separator (delemiter between category-block and article)", "cl-mod-rewrite"); +$oView->lng_article_word_separator = i18n("Article-word separator (delemiter between article words)", "cl-mod-rewrite"); -$oView->lng_add_startart_name_to_url = i18n("Append article name to URLs", "mod_rewrite"); -$oView->lng_add_startart_name_to_url_lbl = i18n("Append article name always to URLs (even at URLs to categories)", "mod_rewrite"); -$oView->lng_default_startart_name = i18n("Default article name without extension", "mod_rewrite"); -$oView->lng_default_startart_name_info = i18n("e. g. 'index' for index.ext
In case of selected 'Append article name always to URLs' option and a empty field,
the name of the start article will be used", "mod_rewrite"); +$oView->lng_add_startart_name_to_url = i18n("Append article name to URLs", "cl-mod-rewrite"); +$oView->lng_add_startart_name_to_url_lbl = i18n("Append article name always to URLs (even at URLs to categories)", "cl-mod-rewrite"); +$oView->lng_default_startart_name = i18n("Default article name without extension", "cl-mod-rewrite"); +$oView->lng_default_startart_name_info = i18n("e. g. 'index' for index.ext
In case of selected 'Append article name always to URLs' option and a empty field,
the name of the start article will be used", "cl-mod-rewrite"); -$oView->lng_file_extension = i18n("File extension at the end of the URL", "mod_rewrite"); -$oView->lng_file_extension_info = i18n("Specification of file extension with a preceded dot
e.g. '.html' for http://host/foo/bar.html", "mod_rewrite"); -$oView->lng_file_extension_info2 = i18n("It's strongly recommended to specify a extension here,
if the option 'Append article name always to URLs' was not selected.

Otherwise URLs to categories and articles would have the same format
which may result in unresolvable categories/articles in some cases.", "mod_rewrite"); -$oView->lng_file_extension_info3 = i18n("It's necessary to specify a file extension at the moment, due do existing issues, which are not solved until yet. An not defined extension may result in invalid article detection in some cases.", "mod_rewrite"); +$oView->lng_file_extension = i18n("File extension at the end of the URL", "cl-mod-rewrite"); +$oView->lng_file_extension_info = i18n("Specification of file extension with a preceded dot
e.g. '.html' for http://host/foo/bar.html", "cl-mod-rewrite"); +$oView->lng_file_extension_info2 = i18n("It's strongly recommended to specify a extension here,
if the option 'Append article name always to URLs' was not selected.

Otherwise URLs to categories and articles would have the same format
which may result in unresolvable categories/articles in some cases.", "cl-mod-rewrite"); +$oView->lng_file_extension_info3 = i18n("It's necessary to specify a file extension at the moment, due do existing issues, which are not solved until yet. An not defined extension may result in invalid article detection in some cases.", "cl-mod-rewrite"); -$oView->lng_use_lowercase_uri = i18n("Should the URLs be written in lower case?", "mod_rewrite"); -$oView->lng_use_lowercase_uri_lbl = i18n("URLs in lower case", "mod_rewrite"); +$oView->lng_use_lowercase_uri = i18n("Should the URLs be written in lower case?", "cl-mod-rewrite"); +$oView->lng_use_lowercase_uri_lbl = i18n("URLs in lower case", "cl-mod-rewrite"); -$oView->lng_prevent_duplicated_content = i18n("Duplicated content", "mod_rewrite"); -$oView->lng_prevent_duplicated_content_lbl = i18n("Prevent duplicated content", "mod_rewrite"); +$oView->lng_prevent_duplicated_content = i18n("Duplicated content", "cl-mod-rewrite"); +$oView->lng_prevent_duplicated_content_lbl = i18n("Prevent duplicated content", "cl-mod-rewrite"); -$oView->lng_prevent_duplicated_content_info = i18n("Depending on configuration, pages could be found thru different URLs.
Enabling of this option prevents this. Examples for duplicated content", "mod_rewrite"); -$oView->lng_prevent_duplicated_content_info2 = i18n("Name of the root category in the URL: Feasible is /maincategory/subcategory/ and /subcategory/\nLanguage in the URL: Feasible is /german/category/ and /1/category/\nClient in the URL: Feasible is /client/category/ und /1/category/", "mod_rewrite"); +$oView->lng_prevent_duplicated_content_info = i18n("Depending on configuration, pages could be found thru different URLs.
Enabling of this option prevents this. Examples for duplicated content", "cl-mod-rewrite"); +$oView->lng_prevent_duplicated_content_info2 = i18n("Name of the root category in the URL: Feasible is /maincategory/subcategory/ and /subcategory/\nLanguage in the URL: Feasible is /german/category/ and /1/category/\nClient in the URL: Feasible is /client/category/ und /1/category/", "cl-mod-rewrite"); $oView->lng_prevent_duplicated_content_info2 = '
  • ' . str_replace("\n", '
  • ', $oView->lng_prevent_duplicated_content_info2) . '
  • '; -$oView->lng_category_resolve_min_percentage = i18n("Percentage for similar category paths in URLs", "mod_rewrite"); -$oView->lng_category_resolve_min_percentage_info = i18n("This setting refers only to the category path of a URL. If AMR is configured
    to prepend e. g. the root category, language and/or client to the URL,
    the specified percentage will not applied to those parts of the URL.
    An incoming URL will be cleaned from those values and the remaining path (urlpath of the category)
    will be checked against similarities.", "mod_rewrite"); -$oView->lng_category_resolve_min_percentage_example = i18n("100 = exact match with no tolerance\n85 = paths with little errors will match to similar ones\n0 = matching will work even for total wrong paths", "mod_rewrite"); +$oView->lng_category_resolve_min_percentage = i18n("Percentage for similar category paths in URLs", "cl-mod-rewrite"); +$oView->lng_category_resolve_min_percentage_info = i18n("This setting refers only to the category path of a URL. If AMR is configured
    to prepend e. g. the root category, language and/or client to the URL,
    the specified percentage will not applied to those parts of the URL.
    An incoming URL will be cleaned from those values and the remaining path (urlpath of the category)
    will be checked against similarities.", "cl-mod-rewrite"); +$oView->lng_category_resolve_min_percentage_example = i18n("100 = exact match with no tolerance\n85 = paths with little errors will match to similar ones\n0 = matching will work even for total wrong paths", "cl-mod-rewrite"); -$oView->lng_redirect_invalid_article_to_errorsite = i18n("Redirect in case of invalid articles", "mod_rewrite"); -$oView->lng_redirect_invalid_article_to_errorsite_lbl = i18n("Redirect to error page in case of invaid articles", "mod_rewrite"); -$oView->lng_redirect_invalid_article_to_errorsite_info = i18n("The start page will be displayed if this option is not enabled", "mod_rewrite"); +$oView->lng_redirect_invalid_article_to_errorsite = i18n("Redirect in case of invalid articles", "cl-mod-rewrite"); +$oView->lng_redirect_invalid_article_to_errorsite_lbl = i18n("Redirect to error page in case of invaid articles", "cl-mod-rewrite"); +$oView->lng_redirect_invalid_article_to_errorsite_info = i18n("The start page will be displayed if this option is not enabled", "cl-mod-rewrite"); -$oView->lng_rewrite_urls_at = i18n("Moment of URL generation", "mod_rewrite"); -$oView->lng_rewrite_urls_at_front_content_output_lbl = i18n("a.) During the output of HTML code of the page", "mod_rewrite"); -$oView->lng_rewrite_urls_at_front_content_output_info = i18n("Clean-URLs will be generated during page output. Modules/Plugins are able to generate URLs to frontend
    as usual as in previous CONTENIDO versions using a format like 'front_content.php?idcat=1&idart=2'.
    The URLs will be replaced by the plugin to Clean-URLs before sending the HTML output.", "mod_rewrite"); -$oView->lng_rewrite_urls_at_front_content_output_info2 = i18n("Differences to variant b.)", "mod_rewrite"); -$oView->lng_rewrite_urls_at_front_content_output_info3 = i18n("Still compatible to old modules/plugins, since no changes in codes are required\nAll occurring URLs in HTML code, even those set by wysiwyg, will be switched to Clean-URLs\nAll URLs will usually be collected and converted to Clean-URLs at once.
    Doing it this way reduces the amount of executed database significantly.", "mod_rewrite"); +$oView->lng_rewrite_urls_at = i18n("Moment of URL generation", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_front_content_output_lbl = i18n("a.) During the output of HTML code of the page", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_front_content_output_info = i18n("Clean-URLs will be generated during page output. Modules/Plugins are able to generate URLs to frontend
    as usual as in previous CONTENIDO versions using a format like 'front_content.php?idcat=1&idart=2'.
    The URLs will be replaced by the plugin to Clean-URLs before sending the HTML output.", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_front_content_output_info2 = i18n("Differences to variant b.)", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_front_content_output_info3 = i18n("Still compatible to old modules/plugins, since no changes in codes are required\nAll occurring URLs in HTML code, even those set by wysiwyg, will be switched to Clean-URLs\nAll URLs will usually be collected and converted to Clean-URLs at once.
    Doing it this way reduces the amount of executed database significantly.", "cl-mod-rewrite"); $oView->lng_rewrite_urls_at_front_content_output_info3 = '
  • ' . str_replace("\n", '
  • ', $oView->rewrite_urls_at_front_content_output_info3) . '
  • '; -$oView->lng_rewrite_urls_at_congeneratecode_lbl = i18n("b.) In modules or plugins", "mod_rewrite"); -$oView->lng_rewrite_urls_at_congeneratecode_info = i18n("By using this option, all Clean-URLs will be generated directly in module or plugins.
    This means, all areas in modules/plugins, who generate internal URLs to categories/articles, have to be adapted manually.
    All Clean-URLs have to be generated by using following function:", "mod_rewrite"); -$oView->lng_rewrite_urls_at_congeneratecode_example = i18n("# structure of a normal url\n\$url = 'front_content.php?idart=123&lang=2&client=1';\n\n# creation of a url by using the CONTENIDOs Url-Builder (since 4.8.9),\n# wich expects the parameter as a assoziative array\n\$params = array('idart'=>123, 'lang'=>2, 'client'=>1);\n\$newUrl = Contenido_Url::getInstance()->build(\$params);", "mod_rewrite"); -$oView->lng_rewrite_urls_at_congeneratecode_info2 = i18n("Differences to variant a.)", "mod_rewrite"); -$oView->lng_rewrite_urls_at_congeneratecode_info3 = i18n("The default way to generate URLs to fronend pages\nEach URL in modules/plugins has to be generated by UriBuilder\nEach generated Clean-Url requires a database query", "mod_rewrite"); +$oView->lng_rewrite_urls_at_congeneratecode_lbl = i18n("b.) In modules or plugins", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_congeneratecode_info = i18n("By using this option, all Clean-URLs will be generated directly in module or plugins.
    This means, all areas in modules/plugins, who generate internal URLs to categories/articles, have to be adapted manually.
    All Clean-URLs have to be generated by using following function:", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_congeneratecode_example = i18n("# structure of a normal url\n\$url = 'front_content.php?idart=123&lang=2&client=1';\n\n# creation of a url by using the CONTENIDOs Url-Builder (since 4.8.9),\n# wich expects the parameter as a assoziative array\n\$params = array('idart'=>123, 'lang'=>2, 'client'=>1);\n\$newUrl = Contenido_Url::getInstance()->build(\$params);", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_congeneratecode_info2 = i18n("Differences to variant a.)", "cl-mod-rewrite"); +$oView->lng_rewrite_urls_at_congeneratecode_info3 = i18n("The default way to generate URLs to fronend pages\nEach URL in modules/plugins has to be generated by UriBuilder\nEach generated Clean-Url requires a database query", "cl-mod-rewrite"); $oView->lng_rewrite_urls_at_congeneratecode_info3 = '
  • ' . str_replace("\n", '
  • ', $oView->lng_rewrite_urls_at_congeneratecode_info3) . '
  • '; -$oView->lng_rewrite_routing = i18n("Routing", "mod_rewrite"); -$oView->lng_rewrite_routing_info = i18n("Routing definitions for incoming URLs", "mod_rewrite"); -$oView->lng_rewrite_routing_info2 = i18n("Type one routing definition per line as follows:", "mod_rewrite"); -$oView->lng_rewrite_routing_example = i18n("# {incoming_url}>>>{new_url}\n/incoming_url/name.html>>>new_url/new_name.html\n\n# route a specific incoming url to a new page\n/campaign/20_percent_on_everything_except_animal_food.html>>>front_content.php?idcat=23\n\n# route request to wwwroot to a specific page\n/>>>front_content.php?idart=16", "mod_rewrite"); -$oView->lng_rewrite_routing_info3 = i18n("The routing does not sends a HTTP header redirection to the destination URL, the redirection will happen internally by
    replacing the detected incoming URL against the new destination URL (overwriting of article- categoryid)\nIncoming URLs can point to non existing resources (category/article), but the desttination URLs should point
    to valid CONTENIDO articles/categories\nDestination URLs should point to real URLs to categories/articles,
    e. g.front_content.php?idcat=23 or front_content.php?idart=34\nThe language id should attached to the URL in multi language sites
    e. g. front_content.php?idcat=23&lang=1\nThe client id should attached to the URL in multi client sites sharing the same folder
    e. g. front_content.php?idcat=23&client=2\nThe destination URL should not start with '/' or './' (wrong: /front_content.php, correct: front_content.php)", "mod_rewrite"); +$oView->lng_rewrite_routing = i18n("Routing", "cl-mod-rewrite"); +$oView->lng_rewrite_routing_info = i18n("Routing definitions for incoming URLs", "cl-mod-rewrite"); +$oView->lng_rewrite_routing_info2 = i18n("Type one routing definition per line as follows:", "cl-mod-rewrite"); +$oView->lng_rewrite_routing_example = i18n("# {incoming_url}>>>{new_url}\n/incoming_url/name.html>>>new_url/new_name.html\n\n# route a specific incoming url to a new page\n/campaign/20_percent_on_everything_except_animal_food.html>>>front_content.php?idcat=23\n\n# route request to wwwroot to a specific page\n/>>>front_content.php?idart=16", "cl-mod-rewrite"); +$oView->lng_rewrite_routing_info3 = i18n("The routing does not sends a HTTP header redirection to the destination URL, the redirection will happen internally by
    replacing the detected incoming URL against the new destination URL (overwriting of article- categoryid)\nIncoming URLs can point to non existing resources (category/article), but the desttination URLs should point
    to valid CONTENIDO articles/categories\nDestination URLs should point to real URLs to categories/articles,
    e. g.front_content.php?idcat=23 or front_content.php?idart=34\nThe language id should attached to the URL in multi language sites
    e. g. front_content.php?idcat=23&lang=1\nThe client id should attached to the URL in multi client sites sharing the same folder
    e. g. front_content.php?idcat=23&client=2\nThe destination URL should not start with '/' or './' (wrong: /front_content.php, correct: front_content.php)", "cl-mod-rewrite"); $oView->lng_rewrite_routing_info3 = '
  • ' . str_replace("\n", '
  • ', $oView->lng_rewrite_routing_info3) . '
  • '; -$oView->lng_discard_changes = i18n("Discard changes", "mod_rewrite"); -$oView->lng_save_changes = i18n("Save changes", "mod_rewrite"); +$oView->lng_discard_changes = i18n("Discard changes", "cl-mod-rewrite"); +$oView->lng_save_changes = i18n("Save changes", "cl-mod-rewrite"); ################################################################################ @@ -307,6 +307,6 @@ if ($action == 'index') { ##### Output $oMrController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/content.html' + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/templates/content.html' ); diff --git a/includes/include.mod_rewrite_contentexpert.php b/includes/include.mod_rewrite_contentexpert.php index 50d88ce..f6581bc 100644 --- a/includes/include.mod_rewrite_contentexpert.php +++ b/includes/include.mod_rewrite_contentexpert.php @@ -1,6 +1,6 @@ content_after = ''; $oMrController->setProperty('htaccessInfo', $aHtaccessInfo); // view language variables -$oView->lng_plugin_functions = i18n("Plugin functions", "mod_rewrite"); +$oView->lng_plugin_functions = i18n("Plugin functions", "cl-mod-rewrite"); -$oView->lng_copy_htaccess_type = i18n("Copy/Download .htaccess template", "mod_rewrite"); -$oView->lng_copy_htaccess_type_lbl = i18n("Select .htaccess template", "mod_rewrite"); -$oView->lng_copy_htaccess_type1 = i18n("Restrictive .htaccess", "mod_rewrite"); -$oView->lng_copy_htaccess_type2 = i18n("Simple .htaccess", "mod_rewrite"); -$oView->lng_copy_htaccess_type_info1 = i18n("Contains rules with restrictive settings.
    All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, mov,
    mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom rewriting.
    Remaining requests will be rewritten to front_content.php,
    except requests to 'contenido/', 'setup/', 'cms/upload', 'cms/front_content.php', etc.
    Each resource, which has to be excluded from rewriting must be specified explicitly.", "mod_rewrite"); +$oView->lng_copy_htaccess_type = i18n("Copy/Download .htaccess template", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_type_lbl = i18n("Select .htaccess template", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_type1 = i18n("Restrictive .htaccess", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_type2 = i18n("Simple .htaccess", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_type_info1 = i18n("Contains rules with restrictive settings.
    All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, mov,
    mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom rewriting.
    Remaining requests will be rewritten to front_content.php,
    except requests to 'contenido/', 'setup/', 'cms/upload', 'cms/front_content.php', etc.
    Each resource, which has to be excluded from rewriting must be specified explicitly.", "cl-mod-rewrite"); -$oView->lng_copy_htaccess_type_info2 = i18n("Contains a simple collection of rules. Each requests pointing to valid symlinks, folders or
    files, will be excluded from rewriting. Remaining requests will be rewritten to front_content.php", "mod_rewrite"); +$oView->lng_copy_htaccess_type_info2 = i18n("Contains a simple collection of rules. Each requests pointing to valid symlinks, folders or
    files, will be excluded from rewriting. Remaining requests will be rewritten to front_content.php", "cl-mod-rewrite"); -$oView->lng_copy_htaccess_to = i18n("and copy to", "mod_rewrite"); -$oView->lng_copy_htaccess_to_contenido = i18n("CONTENIDO installation directory", "mod_rewrite"); -$oView->lng_copy_htaccess_to_contenido_info = i18n("Copy the selected .htaccess template into CONTENIDO installation directory

        {CONTENIDO_FULL_PATH}.

    This is the recommended option for a CONTENIDO installation with one or more clients
    who are running on the same domain.", "mod_rewrite"); +$oView->lng_copy_htaccess_to = i18n("and copy to", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_to_contenido = i18n("CONTENIDO installation directory", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_to_contenido_info = i18n("Copy the selected .htaccess template into CONTENIDO installation directory

        {CONTENIDO_FULL_PATH}.

    This is the recommended option for a CONTENIDO installation with one or more clients
    who are running on the same domain.", "cl-mod-rewrite"); $oView->lng_copy_htaccess_to_contenido_info = str_replace('{CONTENIDO_FULL_PATH}', $oView->contenido_full_path, $oView->lng_copy_htaccess_to_contenido_info); -$oView->lng_copy_htaccess_to_client = i18n("client directory", "mod_rewrite"); -$oView->lng_copy_htaccess_to_client_info = i18n("Copy the selected .htaccess template into client's directory

        {CLIENT_FULL_PATH}.

    This is the recommended option for a multiple client system
    where each client has it's own domain/subdomain", "mod_rewrite"); +$oView->lng_copy_htaccess_to_client = i18n("client directory", "cl-mod-rewrite"); +$oView->lng_copy_htaccess_to_client_info = i18n("Copy the selected .htaccess template into client's directory

        {CLIENT_FULL_PATH}.

    This is the recommended option for a multiple client system
    where each client has it's own domain/subdomain", "cl-mod-rewrite"); $oView->lng_copy_htaccess_to_client_info = str_replace('{CLIENT_FULL_PATH}', $oView->client_full_path, $oView->lng_copy_htaccess_to_client_info); -$oView->lng_or = i18n("or", "mod_rewrite"); -$oView->lng_download = i18n("Download", "mod_rewrite"); -$oView->lng_download_info = i18n("Download selected .htaccess template to copy it to the destination folder
    or to take over the settings manually.", "mod_rewrite"); +$oView->lng_or = i18n("or", "cl-mod-rewrite"); +$oView->lng_download = i18n("Download", "cl-mod-rewrite"); +$oView->lng_download_info = i18n("Download selected .htaccess template to copy it to the destination folder
    or to take over the settings manually.", "cl-mod-rewrite"); -$oView->lng_resetaliases = i18n("Reset category-/ and article aliases", "mod_rewrite"); -$oView->lng_resetempty_link = i18n("Reset only empty aliases", "mod_rewrite"); -$oView->lng_resetempty_info = i18n("Only empty aliases will be reset, existing aliases, e. g. manually set aliases, will not be changed.", "mod_rewrite"); -$oView->lng_resetall_link = i18n("Reset all aliases", "mod_rewrite"); -$oView->lng_resetall_info = i18n("Reset all category-/article aliases. Existing aliases will be overwritten.", "mod_rewrite"); -$oView->lng_note = i18n("Note", "mod_rewrite"); -$oView->lng_resetaliases_note = i18n("This process could require some time depending on amount of categories/articles.
    The aliases will not contain the configured plugin separators, but the CONTENIDO default separators '/' und '-', e. g. '/category-word/article-word'.
    Execution of this function ma be helpful to prepare all or empty aliases for the usage by the plugin.", "mod_rewrite"); +$oView->lng_resetaliases = i18n("Reset category-/ and article aliases", "cl-mod-rewrite"); +$oView->lng_resetempty_link = i18n("Reset only empty aliases", "cl-mod-rewrite"); +$oView->lng_resetempty_info = i18n("Only empty aliases will be reset, existing aliases, e. g. manually set aliases, will not be changed.", "cl-mod-rewrite"); +$oView->lng_resetall_link = i18n("Reset all aliases", "cl-mod-rewrite"); +$oView->lng_resetall_info = i18n("Reset all category-/article aliases. Existing aliases will be overwritten.", "cl-mod-rewrite"); +$oView->lng_note = i18n("Note", "cl-mod-rewrite"); +$oView->lng_resetaliases_note = i18n("This process could require some time depending on amount of categories/articles.
    The aliases will not contain the configured plugin separators, but the CONTENIDO default separators '/' und '-', e. g. '/category-word/article-word'.
    Execution of this function ma be helpful to prepare all or empty aliases for the usage by the plugin.", "cl-mod-rewrite"); -$oView->lng_discard_changes = i18n("Discard changes", "mod_rewrite"); -$oView->lng_save_changes = i18n("Save changes", "mod_rewrite"); +$oView->lng_discard_changes = i18n("Discard changes", "cl-mod-rewrite"); +$oView->lng_save_changes = i18n("Save changes", "cl-mod-rewrite"); ################################################################################ @@ -114,6 +114,6 @@ if ($action == 'index') { ##### Output $oMrController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contentexpert.html' + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/templates/contentexpert.html' ); diff --git a/includes/include.mod_rewrite_contenttest.php b/includes/include.mod_rewrite_contenttest.php index 9bff07f..90a1032 100644 --- a/includes/include.mod_rewrite_contenttest.php +++ b/includes/include.mod_rewrite_contenttest.php @@ -52,14 +52,14 @@ $oMrTestController = new ModRewrite_ContentTestController(); // view language variables $oView = $oMrTestController->getView(); -$oView->lng_form_info = i18n("Define options to genereate the URLs by using the form below and run the test.", "mod_rewrite"); -$oView->lng_form_label = i18n("Parameter to use", "mod_rewrite"); -$oView->lng_maxitems_lbl = i18n("Number of URLs to generate", "mod_rewrite"); -$oView->lng_run_test = i18n("Run test", "mod_rewrite"); +$oView->lng_form_info = i18n("Define options to genereate the URLs by using the form below and run the test.", "cl-mod-rewrite"); +$oView->lng_form_label = i18n("Parameter to use", "cl-mod-rewrite"); +$oView->lng_maxitems_lbl = i18n("Number of URLs to generate", "cl-mod-rewrite"); +$oView->lng_run_test = i18n("Run test", "cl-mod-rewrite"); -$oView->lng_result_item_tpl = i18n("{pref}{name}
    {pref}Builder in: {url_in}
    {pref}Builder out: {url_out}
    {pref}Resolved URL: {url_res}
    {pref}Resolver err: {err}
    {pref}Resolved data: {data}", "mod_rewrite"); +$oView->lng_result_item_tpl = i18n("{pref}{name}
    {pref}Builder in: {url_in}
    {pref}Builder out: {url_out}
    {pref}Resolved URL: {url_res}
    {pref}Resolver err: {err}
    {pref}Resolved data: {data}", "cl-mod-rewrite"); -$oView->lng_result_message_tpl = i18n("Duration of test run: {time} seconds.
    Number of processed URLs: {num_urls}
    Successful resolved: {num_success}
    Errors during resolving: {num_fail}", "mod_rewrite"); +$oView->lng_result_message_tpl = i18n("Duration of test run: {time} seconds.
    Number of processed URLs: {num_urls}
    Successful resolved: {num_success}
    Errors during resolving: {num_fail}", "cl-mod-rewrite"); ################################################################################ @@ -79,5 +79,5 @@ $oView->content .= mr_debugOutput(false); ##### Output $oMrTestController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contenttest.html' + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'cl-mod-rewrite/templates/contenttest.html' ); diff --git a/locale/de_DE/LC_MESSAGES/mod_rewrite.mo b/locale/de_DE/LC_MESSAGES/cl-mod-rewrite.mo similarity index 100% rename from locale/de_DE/LC_MESSAGES/mod_rewrite.mo rename to locale/de_DE/LC_MESSAGES/cl-mod-rewrite.mo diff --git a/locale/de_DE/LC_MESSAGES/mod_rewrite.po b/locale/de_DE/LC_MESSAGES/cl-mod-rewrite.po similarity index 100% rename from locale/de_DE/LC_MESSAGES/mod_rewrite.po rename to locale/de_DE/LC_MESSAGES/cl-mod-rewrite.po diff --git a/templates/content.html b/templates/content.html index fb5fb68..87de490 100644 --- a/templates/content.html +++ b/templates/content.html @@ -6,11 +6,11 @@ - - + + - - + + - + diff --git a/templates/contentexpert.html b/templates/contentexpert.html index c30c08c..f672bbb 100644 --- a/templates/contentexpert.html +++ b/templates/contentexpert.html @@ -6,11 +6,11 @@ - - + + - - + +