From 0941e0b25ddc02ffedd7bcdd0d98c871094f8f47 Mon Sep 17 00:00:00 2001 From: Oldperl <44996956+oldperl@users.noreply.github.com> Date: Sun, 16 Jul 2017 11:42:13 +0000 Subject: [PATCH] update amr to version from latest contenido 4.8 --- .../mod_rewrite/classes/class.modrewrite.php | 2097 +++++++++-------- .../classes/class.modrewritebase.php | 186 +- .../classes/class.modrewritecontroller.php | 1310 +++++----- .../classes/class.modrewritedebugger.php | 162 +- .../classes/class.modrewritetest.php | 625 +++-- .../classes/class.modrewriteurlstack.php | 657 +++--- .../classes/class.modrewriteurlutil.php | 646 +++-- .../class.modrewrite_content_controller.php | 833 +++---- ...ss.modrewrite_contentexpert_controller.php | 280 +-- ...lass.modrewrite_contenttest_controller.php | 337 +-- .../class.modrewrite_controller_abstract.php | 374 +-- .../external/aToolTip/css/atooltip.css | 86 +- .../external/aToolTip/css/style.css | 348 +-- .../mod_rewrite/external/aToolTip/demos.html | 160 +- .../external/aToolTip/js/atooltip.jquery.js | 234 +- .../aToolTip/js/atooltip.min.jquery.js | 2 +- .../external/aToolTip/js/jquery.min.js | 36 +- .../files/htaccess_restrictive.txt | 140 +- .../mod_rewrite/files/htaccess_simple.txt | 138 +- .../includes/config.mod_rewrite_default.php | 242 +- .../mod_rewrite/includes/config.plugin.php | 345 ++- .../includes/front_content_controller.php | 217 +- .../includes/functions.mod_rewrite.php | 1879 +++++++-------- .../includes/include.mod_rewrite_content.php | 636 +++-- .../include.mod_rewrite_content_top.php | 18 + .../include.mod_rewrite_contentexpert.php | 288 +-- .../include.mod_rewrite_contenttest.php | 191 +- .../locale/de_DE/LC_MESSAGES/mod_rewrite.mo | Bin 29426 -> 30156 bytes .../locale/de_DE/LC_MESSAGES/mod_rewrite.po | 1037 ++++---- .../mod_rewrite/locale/mod_rewrite.pot | 674 +++--- .../plugins/mod_rewrite/locale/potfiles.txt | 40 +- conlite/plugins/mod_rewrite/readme.txt | 294 --- .../mod_rewrite/scripts/mod_rewrite.js | 183 +- conlite/plugins/mod_rewrite/styles/styles.css | 201 +- .../mod_rewrite/templates/content.html | 732 +++--- .../mod_rewrite/templates/content_top.html | 36 + .../mod_rewrite/templates/contentexpert.html | 302 ++- .../mod_rewrite/templates/contenttest.html | 127 +- .../plugins/mod_rewrite/xml/lang_de_DE.xml | 28 +- .../plugins/mod_rewrite/xml/lang_en_US.xml | 28 +- 40 files changed, 7928 insertions(+), 8221 deletions(-) create mode 100755 conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content_top.php delete mode 100644 conlite/plugins/mod_rewrite/readme.txt create mode 100755 conlite/plugins/mod_rewrite/templates/content_top.html diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewrite.php b/conlite/plugins/mod_rewrite/classes/class.modrewrite.php index 67bf45d..260715f 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewrite.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewrite.php @@ -1,1025 +1,1072 @@ - - * @copyright � www.polycoder.de - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2004-12-04 - * modified 2005-12-28 - * modified 2011-05-19 Murat Purc, fixed wrong code in function recreateArticlesAliases() - * - * $Id: class.modrewrite.php 312 2014-06-18 11:01:08Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Class to create websafe names - * - * @author Stefan Seifarth / stese - * @author Murat Purc - * @package Contenido Backend plugins - * @subpackage ModRewrite - */ -class ModRewrite extends ModRewriteBase -{ - - /** - * Database instance - * - * @var DB_ConLite - */ - private static $_db; - - - /** - * 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. - * - * @param int $clientId Client id - */ - public static function initialize($clientId) - { - mr_loadConfiguration($clientId, true); - self::$_db = new DB_ConLite(); - } - - - /** - * Check categories on websafe name - * - * Check all categories in the main parent category on existing same websafe name - * - * @param string $sName Websafe name to check - * @param int $iCatId Current category id - * @param int $iLangId Current language id - * @return bool True if websafename already exists, false if not - */ - public static function isInCategories($sName = '', $iCatId = 0, $iLangId = 0) - { - global $cfg; - - $sName = self::$_db->escape($sName); - $iCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - - // get parentid - $iParentId = 0; - $sql = "SELECT parentid FROM " . $cfg['tab']['cat'] . " WHERE idcat = '$iCatId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $iParentId = ($aData['parentid'] > 0 ) ? (int) $aData['parentid'] : 0; - } - - // check if websafe name is in this category - $sql = "SELECT count(cl.idcat) as numcats FROM " . $cfg['tab']['cat_lang'] . " cl " - . "LEFT JOIN " . $cfg['tab']['cat'] . " c ON cl.idcat = c.idcat WHERE " - . "c.parentid = '$iParentId' AND cl.idlang = '" . $iLangId . "' AND " - . "cl.urlname = '" . $sName . "' AND cl.idcat <> '$iCatId'"; - ModRewriteDebugger::log($sql, 'ModRewrite::isInCategories $sql'); - - if ($aData = mr_queryAndNextRecord($sql)) { - return ($aData['numcats'] > 0) ? true : false; - } - - return false; - } - - - /** - * Check articles on websafe name. - * - * Check all articles in the current category on existing same websafe name. - * - * @param string $sName Websafe name to check - * @param int $iArtId Current article id - * @param int $iLangId Current language id - * @param int $iCatId Category id - * @return bool True if websafename already exists, false if not - */ - public static function isInCatArticles($sName = '', $iArtId = 0, $iLangId = 0, $iCatId = 0) - { - global $cfg; - - $sName = self::$_db->escape($sName); - $iArtId = (int) $iArtId; - $iLangId = (int) $iLangId; - $iCatId = (int) $iCatId; - - // handle multipages - if ($iCatId == 0) { - // get category id if not set - $sql = "SELECT idcat FROM " . $cfg['tab']['cat_art'] . " WHERE idart = '$iArtId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $iCatId = ($aData['idcat'] > 0) ? (int) $aData['idcat'] : 0; - } - } - - // check if websafe name is in this category - $sql = "SELECT count(al.idart) as numcats FROM " . $cfg['tab']['art_lang'] . " al " - . "LEFT JOIN " . $cfg['tab']['cat_art'] . " ca ON al.idart = ca.idart WHERE " - . " ca.idcat='$iCatId' AND al.idlang='" . $iLangId . "' AND " - . "al.urlname='" . $sName . "' AND al.idart <> '$iArtId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return ($aData['numcats'] > 0) ? true : false; - } - - return false; - } - - - /** - * Set websafe name in article list. - * - * Insert new websafe name in article list - * - * @param string $sName Original name (will be converted) - * @param int $iArtId Current article id - * @param int $iLangId Current language id - * @param int $iCatId Category id - * @return bool True if insert was successfully - */ - public static function setArtWebsafeName($sName = '', $iArtId = 0, $iLangId = 0, $iCatId = 0) - { - global $cfg; - - $iArtId = (int) $iArtId; - $iLangId = (int) $iLangId; - $iCatId = (int) $iCatId; - - // get websafe name - $sNewName = capiStrCleanURLCharacters(clHtmlEntityDecode($sName)); - - // remove double or more separators - $sNewName = mr_removeMultipleChars('-', $sNewName); - - $sNewName = self::$_db->escape($sNewName); - - // check if websafe name already exists - if (self::isInCatArticles($sNewName, $iArtId, $iLangId, $iCatId)) { - // create new websafe name if exists - $sNewName = $sNewName . $iArtId; - } - - // check again - and set name - if (!self::isInCatArticles($sNewName, $iArtId, $iLangId, $iCatId)) { - // insert websafe name in article list - $sql = "UPDATE " . $cfg['tab']['art_lang'] . " SET urlname = '$sNewName' " - . "WHERE idart = '$iArtId' AND idlang = '$iLangId'"; - return self::$_db->query($sql); - } else { - return false; - } - } - - - /** - * Set websafe name in category list. - * - * Insert new websafe name in category list. - * - * @param string $sName Original name (will be converted) or alias - * @param int $iCatId Category id - * @param int $iLangId Language id - * @return bool True if insert was successfully - */ - public static function setCatWebsafeName($sName = '', $iCatId = 0, $iLangId = 0) - { - global $cfg; - - $iCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - - // create websafe name - $sNewName = capiStrCleanURLCharacters(clHtmlEntityDecode($sName)); - - // remove double or more separators - $sNewName = mr_removeMultipleChars('-', $sNewName); - - $sNewName = self::$_db->escape($sNewName); - - // check if websafe name already exists - if (self::isInCategories($sNewName, $iCatId, $iLangId)) { - // create new websafe name if exists - $sNewName = $sNewName . $iCatId; - } - - // check again - and set name - if (!self::isInCategories($sNewName, $iCatId, $iLangId)) { - // insert websafe name in article list - $sql = "UPDATE " . $cfg['tab']['cat_lang'] . " SET urlname = '$sNewName' " - . "WHERE idcat = '$iCatId' AND idlang = '$iLangId'"; - - ModRewriteDebugger::log(array( - 'sName' => $sName, - 'iCatId' => $iCatId, - 'iLangId' => $iLangId, - 'sNewName' => $sNewName - ), 'ModRewrite::setCatWebsafeName $data' - ); - - return self::$_db->query($sql); - - } else { - return false; - } - } - - - /** - * Set urlpath of category - * - * @param int $iCatId Category id - * @param int $iLangId Language id - * @return bool True if insert was successfully - */ - public static function setCatUrlPath($iCatId = 0, $iLangId = 0) - { - global $cfg; - - $sPath = self::buildRecursivPath($iCatId, $iLangId); - - $iCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - - // insert websafe name in article list - $sql = "UPDATE " . $cfg['tab']['cat_lang'] . " SET urlpath = '$sPath' " - . "WHERE idcat = '$iCatId' AND idlang = '$iLangId'"; - - ModRewriteDebugger::log(array( - 'iCatId' => $iCatId, - 'iLangId' => $iLangId, - 'sPath' => $sPath - ), 'ModRewrite::setCatUrlPath $data' - ); - - return self::$_db->query($sql); - } - - - /** - * Get article id and language id from article language id - * - * @param int $iArtlangId Current article id - * @return array Array with idart and idlang of current article - */ - public static function getArtIdByArtlangId($iArtlangId = 0) - { - global $cfg; - - $iArtlangId = (int) $iArtlangId; - $sql = "SELECT idart, idlang FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = '$iArtlangId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return $aData; - } - return array(); - } - - - /** - * Get article id by article websafe name - * - * @param string Websafe name - * @param int Category id - * @return int|null Recent article id or null - */ - public static function getArtIdByWebsafeName($sArtName = '', $iCatId = 0, $iLangId = 0) - { - global $cfg; - - $sArtName = self::$_db->escape($sArtName); - $iCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - - $sWhere = ''; - if ($iLangId !== 0) { - $sWhere = ' AND al.idlang=' . $iLangId; - } - // only article name were given - if ($iCatId == 0) { - // get all basic category ids with parentid=0 - $aCatIds = array(); - $sql = "SELECT idcat FROM " . $cfg['tab']['cat'] . " WHERE parentid = '0'"; - self::$_db->query($sql); - while (self::$_db->next_record()) { - $aCatIds[] = "idcat = '" . self::$_db->f('idcat') . "'"; - } - $sWhere .= " AND ( " . join(" OR ", $aCatIds) . ")"; - } else { - $sWhere .= " AND ca.idcat = '$iCatId'"; - } - - $sql = "SELECT al.idart FROM " . $cfg['tab']['art_lang'] . " al " - . "LEFT JOIN " . $cfg['tab']['cat_art'] . " ca ON al.idart = ca.idart " - . "WHERE al.urlname = '$sArtName'" . $sWhere; - - if ($aData = mr_queryAndNextRecord($sql)) { - return $aData['idart']; - } else { - return null; - } - } - - - /** - * Get category name from category id and language id. - * - * @param int $iCatId Category id - * @param int $iLangId Language id - * @return string Category name - */ - public static function getCatName($iCatId = 0, $iLangId = 0) - { - global $cfg, $mr_statics; - - $iCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - $key = 'catname_by_catid_idlang_' . $iCatId . '_' . $iLangId; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $sql = "SELECT name FROM " . $cfg['tab']['cat_lang'] . " WHERE idcat = '$iCatId' AND idlang = '$iLangId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $catName = $aData['name']; - } else { - $catName = ''; - } - - $mr_statics[$key] = $catName; - return $catName; - } - - - /** - * Funcion to return cat id by path. - * - * Caches the paths at first call to provode faster processing at further calls. - * - * @todo add support for more than one hit for idcat, happens if u have same name for different idcats - * maybe one can check for on or offline cat or redirect in start-article - * @param string $path Category path - * @return int Category id - */ - public static function getCatIdByUrlPath($path) - { - global $cfg, $client, $lang, $mr_statics; - - if (strpos($path, '/') === 0) { - $path = substr($path, 1); - } - if (strrpos($path, '/') === strlen($path)-1) { - $path = substr($path, 0, -1); - } - - $catSeperator = '/'; - $startFromRoot = parent::getConfig('startfromroot'); - $urls2lowercase = parent::getConfig('use_lowercase_uri'); - - $path = str_replace('/', parent::getConfig('category_seperator'), $path); - - $key = 'cat_ids_and_urlpath'; - - if (isset($mr_statics[$key])) { - $aPathsCache = $mr_statics[$key]; - } else { - $aPathsCache = array(); - } - - if (count($aPathsCache) == 0) { - $sql = "SELECT cl.idcat, cl.urlpath FROM " . $cfg['tab']['cat_lang'] - . " AS cl, " . $cfg['tab']['cat'] . " AS c WHERE c.idclient = " . $client - . " AND c.idcat = cl.idcat AND cl.idlang = " . $lang; - self::$_db->query($sql); - while (self::$_db->next_record()) { - $urlPath = self::$_db->f('urlpath'); - if ($startFromRoot == 0 && strpos($urlPath, $catSeperator) > 0) { - // paths are stored with prefixed main category, but created - // urls doesn't contain the main cat, remove it... - $urlPath = substr($urlPath, strpos($urlPath, $catSeperator)+1); - } - if ($urls2lowercase) { - $urlPath = strtolower($urlPath); - } - - // store path - $aPathsCache[self::$_db->f('idcat')] = $urlPath; - } - } - $mr_statics[$key] = $aPathsCache; - - // compare paths using the similar_text algorithm - $fPercent = 0; - $aResults = array(); - foreach ($aPathsCache as $id => $pathItem) { - similar_text($path, $pathItem, $fPercent); - $aResults[$id] = $fPercent; - } - - arsort($aResults, SORT_NUMERIC); - reset($aResults); - - ModRewriteDebugger::add($path, 'ModRewrite::getCatIdByUrlPath() $path'); - ModRewriteDebugger::add($aPathsCache, 'ModRewrite::getCatIdByUrlPath() $aPathsCache'); - ModRewriteDebugger::add($aResults, 'ModRewrite::getCatIdByUrlPath() $aResults'); - - $iMinPercentage = (int) parent::getConfig('category_resolve_min_percentage', 0); - $catId = key($aResults); - if ($iMinPercentage > 0 && $aResults[$catId] < $iMinPercentage) { - return 0; - } else { - return $catId; - } - } - - - /** - * Get article name from article id and language id - * - * @NOTE: seems to be not used??? - * - * @param int $iArtId Article id - * @param int $iLangId Language id - * @return string Article name - */ - public static function getArtTitle($iArtId = 0, $iLangId = 0) - { - global $cfg; - - $iArtId = (int) $iArtId; - $iLangId = (int) $iLangId; - - $sql = "SELECT title FROM " . $cfg['tab']['art_lang'] . " WHERE " - . "idart = '$iArtId' AND idlang = '$iLangId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return $aData['title']; - } - return ''; - } - - - /** - * Get language ids from category id - * - * @param int $iCatId Category id - * @return array Used language ids - */ - public static function getCatLanguages($iCatId = 0) - { - global $cfg, $mr_statics; - - $iCatId = (int) $iCatId; - $key = 'cat_idlang_by_catid_' . $iCatId; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $aLanguages = array(); - - $sql = "SELECT idlang FROM " . $cfg['tab']['cat_lang'] . " WHERE idcat = '$iCatId'"; - self::$_db->query($sql); - while (self::$_db->next_record()) { - $aLanguages[] = self::$_db->f('idlang'); - } - - $mr_statics[$key] = $aLanguages; - return $aLanguages; - } - - - /** - * Get article urlname and language id - * - * @param int $iArtlangId idartlang - * @return array Urlname, idlang of empty array - */ - public static function getArtIds($iArtlangId = 0) - { - global $cfg; - - $iArtlangId = (int) $iArtlangId; - $sql = "SELECT urlname, idlang FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = '$iArtlangId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return $aData; - } - return array(); - } - - - /** - * Build a recursiv path for mod_rewrite rule like server directories - * (dir1/dir2/dir3) - * - * @param int $iCatId Latest category id - * @param int $iLangId Language id - * @param int $iLastId Last category id - * @return string linkpath with correct uri - */ - public static function buildRecursivPath($iCatId = 0, $iLangId = 0, $iLastId = 0) - { - global $cfg; - - $aDirectories = array(); - $bFinish = false; - $iTmpCatId = (int) $iCatId; - $iLangId = (int) $iLangId; - $iLastId = (int) $iLastId; - - while ($bFinish == false) { - $sql = "SELECT cl.urlname, c.parentid FROM " . $cfg['tab']['cat_lang'] . " cl " - . "LEFT JOIN " . $cfg['tab']['cat'] . " c ON cl.idcat = c.idcat " - . "WHERE cl.idcat = '$iTmpCatId' AND cl.idlang = '$iLangId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $aDirectories[] = $aData['urlname']; - $iTmpCatId = (int) $aData['parentid']; - - if ($aData['parentid'] == 0 || $aData['parentid'] == $iLastId) { - $bFinish = true; - } - } else { - $bFinish = true; - } - } - - // reverse array entries and create directory string - $sPath = join('/', array_reverse($aDirectories)); - - return $sPath; - } - - - /** - * Return full contenido url from single anchor - * - * @param array $aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments - * @return string New anchor - */ - public static function rewriteHtmlAnchor(array $aMatches = array()) - { - global $artname, $sess, $idart, $idcat, $client, $lang; - - // set article name - $sArtParam = ''; - if (isset($artname) && strlen($artname) > 0) { - $sArtParam = '&idart=' . (int) $idart; - } - - // check for additional parameter in url - $aParamsToIgnore = array ('idcat', 'idart', 'lang', 'client', 'idcatart', 'changelang', 'changeclient', 'idartlang', 'parts', 'artname'); - $sOtherParams = ''; - - if (isset($_GET) && count($_GET) > 0) { - foreach ($_GET as $key => $value) { - if (!in_array($key, $aParamsToIgnore) && strlen(trim($value)) > 0) { - $aNoAnchor = explode('#', $value); - $sOtherParams .= '&' . urlencode(urldecode($key)) . '=' . urlencode(urldecode($value)); - } - } - } - - $url = $sess->url( - 'front_content.php?' . 'idcat=' . (int) $idcat . '&client=' . (int) $client . - '&changelang=' . (int) $lang . $sArtParam . $sOtherParams . '#' . $aMatches[2] - ); - - $sNewUrl = ''; - - return $sNewUrl; - } - - - /** - * Return full contenido url from single anchor - * - * @param array $aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments - * @return string New anchor - */ - public static function contenidoHtmlAnchor(array $aMatches = array(), $bXHTML = true) - { - global $artname, $sess; - - $aParams = array(); - $sAmpersand = $bXHTML ? '&' : '&'; - - foreach ($_GET as $key => $value) { - $aNoAnchor = explode('#', $value); - $aParams[] = urlencode(urldecode($key)) . '=' . urlencode(urldecode($aNoAnchor[0])); - } - - $url = $sess->url( 'front_content.php?' . implode($sAmpersand, $aParams) . '#' . $aMatches[2]); - $sNewUrl = ''; - - return $sNewUrl; - } - - - /** - * Get article websafe name from article id and language id. - * - * @param int $iArtId Article id - * @param int $iLangId Language id - * @return string Article websafe name - */ - public static function getArtWebsafeName($iArtId = 0, $iLangId = 0) - { - global $cfg; - - $iArtId = (int) $iArtId; - $iLangId = (int) $iLangId; - $sql = "SELECT urlname FROM " . $cfg['tab']['art_lang'] . " WHERE " - . "idart = '" . $iArtId . "' AND idlang = '" . $iLangId . "'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return urldecode($aData['urlname']); - } - return null; - } - - - /** - * Get article websafe name from idartlang. - * - * @param int $iArtLangId idartlang - * @return string Article websafe name - */ - public static function getArtLangWebsafeName($iArtLangId = 0) - { - global $cfg; - - $iArtLangId = (int) $iArtLangId; - $sql = "SELECT urlname FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = '". $iArtLangId . "'"; - if ($aData = mr_queryAndNextRecord($sql)) { - return urldecode($aData['urlname']); - } - return null; - } - - - /** - * Get name of client by id. - * - * @param int $clientId Client id - * @return string Client name - */ - public static function getClientName($clientId = 0) - { - global $cfg, $mr_statics; - - $clientId = (int) $clientId; - $key = 'clientname_by_clientid_' . $clientId; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $sql = "SELECT name FROM " . $cfg['tab']['clients'] . " WHERE idclient = '$clientId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $clientName = $aData['name']; - } else { - $clientName = ''; - } - - $mr_statics[$key] = $clientName; - return $clientName; - } - - - /** - * Get client id from client name - * - * @param string Client name - * @return integer Client id - */ - public static function getClientId($sClientName = '') - { - global $cfg, $mr_statics; - - $sClientName = self::$_db->escape($sClientName); - $key = 'clientid_by_name_' . $sClientName; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $sql = "SELECT idclient FROM " . $cfg['tab']['clients'] . " WHERE name = '" . urldecode($sClientName) . "'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $clientId = $aData['idclient']; - } else { - $clientId = false; - } - - $mr_statics[$key] = $clientId; - return $clientId; - } - - - /** - * Returns name of language by id. - * - * @param int $languageId Language id - * @return string Lanuage name - */ - public static function getLanguageName($languageId = 0) - { - global $cfg, $mr_statics; - - $languageId = (int) $languageId; - $key = 'languagename_by_id_' . $languageId; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $sql = "SELECT name FROM " . $cfg['tab']['lang'] . " WHERE idlang = '$languageId'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $languageName = $aData['name']; - } else { - $languageName = ''; - } - - $mr_statics[$key] = $languageName; - return $languageName; - } - - - /** - * Get language id from language name thanks to Nicolas Dickinson for multi - * Client/Language BugFix - * - * @param string $sLanguageName Language name - * @param int $iClientId Client id - * @return integer Language id - */ - public static function getLanguageId($sLanguageName = '', $iClientId = 1) - { - global $cfg, $mr_statics; - - $sLanguageName = self::$_db->escape($sLanguageName); - $iClientId = (int) $iClientId; - $key = 'langid_by_langname_clientid_' . $sLanguageName . '_' . $iClientId; - - if (isset($mr_statics[$key])) { - return $mr_statics[$key]; - } - - $sql = "SELECT l.idlang FROM " . $cfg['tab']['lang'] . " as l " - . "LEFT JOIN " . $cfg['tab']['clients_lang'] . " AS cl ON l.idlang = cl.idlang " - . "WHERE cl.idclient = '". $iClientId . "' AND l.name = '" . urldecode($sLanguageName) . "'"; - if ($aData = mr_queryAndNextRecord($sql)) { - $languageId = $aData['idlang']; - } else { - $languageId = false; - } - - $mr_statics[$key] = $languageId; - return $languageId; - } - - - /** - * 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') - * - * @param string $url URL to split - * @return array Assoziative array including the two parts: - * - array('htmlpath' => $path, 'url' => $url) - */ - public static function getClientFullUrlParts($url) - { - global $cfg, $cfgClient; - - $clientPath = $cfgClient[$client]['path']['htmlpath']; - - if (stristr($url, $clientPath) !== false) { - // url includes full html path (scheme host path, etc.) - $url = str_replace($clientPath, '', $url); - $htmlPath = $clientPath; - $aComp = parse_url($htmlPath); - - // check if path matches to defined rootdir from 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/" - $htmlPath = str_replace($aComp['path'], parent::getConfig('rootdir'), $htmlPath); - if (substr($htmlPath, strlen($htmlPath)-1) == '/') { - // remove last slash - $htmlPath = substr($htmlPath, 0, strlen($htmlPath)-1); - } - } - } else { - $htmlPath = ''; - } - return array('htmlpath' => $htmlPath, 'url' => $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' - * - * @param string $url Url to clean - * @return string Cleaned Url - */ - public static function urlPreClean($url) - { - // some preparation of different front_content.php occurence - if (strpos($url, './front_content.php') === 0) { - $url = str_replace('./front_content.php', 'front_content.php', $url); - } elseif (strpos($url, '/front_content.php') === 0) { - $url = str_replace('/front_content.php', 'front_content.php', $url); - } - $url = str_replace('&', '&', $url); - return $url; - } - - - /** - * Method to reset all aliases in categories. - * - * Clears all urlname entries in cat_lang table, and sets the value for all - * existing entries. - * - * @deprecated see ModRewrite::recreateCategoriesAliases(); - */ - public static function resetCategoriesAliases() - { - self::recreateCategoriesAliases(); - } - - - /** - * Recreates all or only empty aliases in categories table. - * - * @param bool $bOnlyEmpty Flag to reset only empty items - */ - public static function recreateCategoriesAliases($bOnlyEmpty = false) - { - global $cfg; - - $db = new DB_ConLite(); - - $aCats = array(); - - // get all or only empty categories - $sql = "SELECT name, idcat, idlang FROM " . $cfg['tab']['cat_lang']; - if ($bOnlyEmpty === true) { - $sql .= " WHERE urlname IS NULL OR urlname = '' OR urlpath IS NULL OR urlpath = ''"; - } - - $db->query($sql); - while ($db->next_record()) { - //set new alias - self::setCatWebsafeName($db->f('name'), $db->f('idcat'), $db->f('idlang')); - $aCats[] = array('idcat' => $db->f('idcat'), 'idlang' => $db->f('idlang')); - } - - foreach ($aCats as $p => $item) { - self::setCatUrlPath($item['idcat'], $item['idlang']); - } - - unset($db, $aCats); - } - - - /** - * Method to reset all aliases in articles. - * - * Clears all urlname entries in art_lang table, and sets the value for all - * existing entries. - * - * @deprecated see ModRewrite::recreateArticlesAliases(); - */ - public static function resetArticlesAliases() - { - self::recreateArticlesAliases(); - } - - - /** - * Recreates all or only empty urlname entries in art_lang table. - * - * @param bool $bOnlyEmpty Flag to reset only empty items - */ - public static function recreateArticlesAliases($bOnlyEmpty = false) - { - global $cfg; - - $db = new DB_ConLite(); - - // get all or only empty articles - $sql = "SELECT title, idart, idlang FROM " . $cfg['tab']['art_lang']; - if ($bOnlyEmpty === true) { - $sql .= " WHERE urlname IS NULL OR urlname = ''"; - } - $db->query($sql); - - while ($db->next_record()) { - //set new alias - self::setArtWebsafeName($db->f('title'), $db->f('idart'), $db->f('idlang')); - } - - unset ($db); - } - - - /** - * Method to reset all aliases (categories and articles). - * - * Shortcut to recreateCategoriesAliases() and recreateArticlesAliases() - */ - public static function resetAliases() - { - self::recreateCategoriesAliases(); - self::recreateArticlesAliases(); - } - - - /** - * Recreate all or only empty aliases (categories and articles). - * - * Shortcut to recreateCategoriesAliases() and recreateArticlesAliases() - * - * @param bool $bOnlyEmpty Flag to reset only empty items - */ - public static function recreateAliases($bOnlyEmpty = false) - { - self::recreateCategoriesAliases($bOnlyEmpty); - self::recreateArticlesAliases($bOnlyEmpty); - } - - - /** - * Used to postprocess resolved path - * - * Error site handling if category not found - * - * if percentage == 100 and there is no 100 percentage result value, - * error site will be shown - can be adjust by user settings for - * smooth similar effects - 80 to 95 will be best but have to check by user - * - * @deprecated Is no more used - * - * @param array $results Pathresolver results array - * @return mixed Categoryid or false - */ - public static function getIdFromPathresolverResult($results) - { - $iMinPercentage = (int) parent::getConfig('category_resolve_min_percentage', 0); - $catId = key($results); - if ($iMinPercentage > 0 && $results[$catId] < $iMinPercentage) { - return false; - } else { - return $catId; - } - } - - /** - * Returns .htaccess related assoziative info array - * - * @return array - */ - public static function getHtaccessInfo() - { - global $cfg, $client, $cfgClient; - - $arr = array( - 'contenido_full_path' => str_replace('\\', '/', realpath($cfg['path']['contenido'] . '../') . '/'), - 'client_full_path' => $cfgClient[$client]['path']['frontend'], - ); - $arr['in_contenido_path'] = is_file($arr['contenido_full_path'] . '.htaccess'); - $arr['in_client_path'] = is_file($arr['client_full_path'] . '.htaccess'); - $arr['has_htaccess'] = ($arr['in_contenido_path'] || $arr['in_client_path']); - - return $arr; - } -} + + * @copyright www.polycoder.de + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Class to create websafe names, it also provides several helper functions + * + * @author Stefan Seifarth / stese + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewrite extends ModRewriteBase { + + /** + * Database instance + * + * @var DB_Contenido + */ + private static $_db; + + /** + * Lookup table to cache some internal data such as db query results + * + * @var array + */ + protected static $_lookupTable; + + /** + * 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. + * + * @param int $clientId Client id + */ + public static function initialize($clientId) { + mr_loadConfiguration($clientId, true); + parent::initialize(); + self::$_db = new DB_Contenido(); + self::$_lookupTable = array(); + } + + /** + * Check categories on websafe name + * + * Check all categories in the main parent category on existing same websafe name + * + * @param string $sName Websafe name to check + * @param int $iCatId Current category id + * @param int $iLangId Current language id + * @return bool True if websafename already exists, false if not + */ + public static function isInCategories($sName = '', $iCatId = 0, $iLangId = 0) { + global $cfg; + + $sName = self::$_db->escape($sName); + $iCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + + // get parentid + $iParentId = 0; + $sql = "SELECT parentid FROM " . $cfg['tab']['cat'] . " WHERE idcat = " . $iCatId; + if ($aData = mr_queryAndNextRecord($sql)) { + $iParentId = ($aData['parentid'] > 0 ) ? (int) $aData['parentid'] : 0; + } + + // check if websafe name is in this category + $sql = "SELECT count(cl.idcat) as numcats FROM " . $cfg['tab']['cat_lang'] . " cl " + . "LEFT JOIN " . $cfg['tab']['cat'] . " c ON cl.idcat = c.idcat WHERE " + . "c.parentid = '$iParentId' AND cl.idlang = " . $iLangId . " AND " + . "LOWER(cl.urlname) = LOWER('" . $sName . "') AND cl.idcat <> " . $iCatId; + ModRewriteDebugger::log($sql, 'ModRewrite::isInCategories $sql'); + + if ($aData = mr_queryAndNextRecord($sql)) { + return ($aData['numcats'] > 0) ? true : false; + } + + return false; + } + + /** + * Check articles on websafe name. + * + * Check all articles in the current category on existing same websafe name. + * + * @param string $sName Websafe name to check + * @param int $iArtId Current article id + * @param int $iLangId Current language id + * @param int $iCatId Category id + * @return bool True if websafename already exists, false if not + */ + public static function isInCatArticles($sName = '', $iArtId = 0, $iLangId = 0, $iCatId = 0) { + global $cfg; + + $sName = self::$_db->escape($sName); + $iArtId = (int) $iArtId; + $iLangId = (int) $iLangId; + $iCatId = (int) $iCatId; + + // handle multipages + if ($iCatId == 0) { + // get category id if not set + $sql = "SELECT idcat FROM " . $cfg['tab']['cat_art'] . " WHERE idart = " . $iArtId; + if ($aData = mr_queryAndNextRecord($sql)) { + $iCatId = ($aData['idcat'] > 0) ? (int) $aData['idcat'] : 0; + } + } + + // check if websafe name is in this category + $sql = "SELECT count(al.idart) as numcats FROM " . $cfg['tab']['art_lang'] . " al " + . "LEFT JOIN " . $cfg['tab']['cat_art'] . " ca ON al.idart = ca.idart WHERE " + . " ca.idcat='$iCatId' AND al.idlang=" . $iLangId . " AND " + . "LOWER(al.urlname) = LOWER('" . $sName . "') AND al.idart <> " . $iArtId; + if ($aData = mr_queryAndNextRecord($sql)) { + return ($aData['numcats'] > 0) ? true : false; + } + + return false; + } + + /** + * Set websafe name in article list. + * + * Insert new websafe name in article list + * + * @param string $sName Original name (will be converted) + * @param int $iArtId Current article id + * @param int $iLangId Current language id + * @param int $iCatId Category id + * @return bool True if insert was successfully + */ + public static function setArtWebsafeName($sName = '', $iArtId = 0, $iLangId = 0, $iCatId = 0) { + global $cfg; + + $iArtId = (int) $iArtId; + $iLangId = (int) $iLangId; + $iCatId = (int) $iCatId; + + // get websafe name + $sNewName = cApiStrCleanURLCharacters(conHtmlEntityDecode($sName)); + + // remove double or more separators + $sNewName = mr_removeMultipleChars('-', $sNewName); + + $sNewName = self::$_db->escape($sNewName); + + // check if websafe name already exists + if (self::isInCatArticles($sNewName, $iArtId, $iLangId, $iCatId)) { + // create new websafe name if exists + $sNewName = $sNewName . $iArtId; + } + + // check again - and set name + if (!self::isInCatArticles($sNewName, $iArtId, $iLangId, $iCatId)) { + // insert websafe name in article list + $sql = "UPDATE " . $cfg['tab']['art_lang'] . " SET urlname = '$sNewName' " + . "WHERE idart = " . $iArtId . " AND idlang = " . $iLangId; + return self::$_db->query($sql); + } else { + return false; + } + } + + /** + * Set websafe name in category list. + * + * Insert new websafe name in category list. + * + * @param string $sName Original name (will be converted) or alias + * @param int $iCatId Category id + * @param int $iLangId Language id + * @return bool True if insert was successfully + */ + public static function setCatWebsafeName($sName = '', $iCatId = 0, $iLangId = 0) { + global $cfg; + + $iCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + + // create websafe name + $sNewName = cApiStrCleanURLCharacters(conHtmlEntityDecode($sName)); + + // remove double or more separators + $sNewName = mr_removeMultipleChars('-', $sNewName); + + $sNewName = self::$_db->escape($sNewName); + + // check if websafe name already exists + if (self::isInCategories($sNewName, $iCatId, $iLangId)) { + // create new websafe name if exists + $sNewName = $sNewName . $iCatId; + } + + // check again - and set name + if (!self::isInCategories($sNewName, $iCatId, $iLangId)) { + // insert websafe name in article list + $sql = "UPDATE " . $cfg['tab']['cat_lang'] . " SET urlname = '$sNewName' " + . "WHERE idcat = " . $iCatId . " AND idlang = " . $iLangId; + + ModRewriteDebugger::log(array( + 'sName' => $sName, + 'iCatId' => $iCatId, + 'iLangId' => $iLangId, + 'sNewName' => $sNewName + ), 'ModRewrite::setCatWebsafeName $data'); + + return self::$_db->query($sql); + } else { + return false; + } + } + + /** + * Set urlpath of category + * + * @param int $iCatId Category id + * @param int $iLangId Language id + * @return bool True if insert was successfully + */ + public static function setCatUrlPath($iCatId = 0, $iLangId = 0) { + global $cfg; + + $sPath = self::buildRecursivPath($iCatId, $iLangId); + + $iCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + + // insert websafe name in article list + $sql = "UPDATE " . $cfg['tab']['cat_lang'] . " SET urlpath = '$sPath' " + . "WHERE idcat = " . $iCatId . " AND idlang = " . $iLangId; + + ModRewriteDebugger::log(array( + 'iCatId' => $iCatId, + 'iLangId' => $iLangId, + 'sPath' => $sPath + ), 'ModRewrite::setCatUrlPath $data'); + + return self::$_db->query($sql); + } + + /** + * Get article id and language id from article language id + * + * @param int $iArtlangId Current article id + * @return array Array with idart and idlang of current article + */ + public static function getArtIdByArtlangId($iArtlangId = 0) { + global $cfg; + + $iArtlangId = (int) $iArtlangId; + $sql = "SELECT idart, idlang FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = " . $iArtlangId; + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData; + } + return array(); + } + + /** + * Get article id by article websafe name + * + * @param string $sArtName Websafe name + * @param int $iCatId Category id + * @param int $iLangId Language id + * @return int|null Recent article id or null + */ + public static function getArtIdByWebsafeName($sArtName = '', $iCatId = 0, $iLangId = 0) { + global $cfg, $lang; + + $sArtName = self::$_db->escape($sArtName); + $iCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + if (0 === $iLangId && is_int($lang)) { + $iLangId = $lang; + } + + $sWhere = ''; + if ($iLangId !== 0) { + $sWhere = ' AND al.idlang = ' . $iLangId; + } + // only article name were given + if ($iCatId == 0) { + // get all basic category ids with parentid=0 + $aCatIds = array(); + $sql = "SELECT idcat FROM " . $cfg['tab']['cat'] . " WHERE parentid = 0"; + self::$_db->query($sql); + while (self::$_db->next_record()) { + $aCatIds[] = "idcat = " . (int) self::$_db->f('idcat'); + } + $sWhere .= " AND ( " . join(" OR ", $aCatIds) . ")"; + } else { + $sWhere .= " AND ca.idcat = " . $iCatId; + } + + $sql = "SELECT al.idart FROM " . $cfg['tab']['art_lang'] . " al " + . "LEFT JOIN " . $cfg['tab']['cat_art'] . " ca ON al.idart = ca.idart " + . "WHERE LOWER(al.urlname) = LOWER('$sArtName')" . $sWhere; + + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData['idart']; + } else { + return null; + } + } + + /** + * Get category name from category id and language id. + * + * @param int $iCatId Category id + * @param int $iLangId Language id + * @return string Category name + */ + public static function getCatName($iCatId = 0, $iLangId = 0) { + global $cfg; + + $iCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + $key = 'catname_by_catid_idlang_' . $iCatId . '_' . $iLangId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT name FROM " . $cfg['tab']['cat_lang'] . " WHERE idcat = " . $iCatId . " AND idlang = " . $iLangId; + if ($aData = mr_queryAndNextRecord($sql)) { + $catName = $aData['name']; + } else { + $catName = ''; + } + + self::$_lookupTable[$key] = $catName; + return $catName; + } + + /** + * Funcion to return cat id by path. + * + * Caches the paths at first call to provode faster processing at further calls. + * + * @param string $path Category path + * @return int Category id + */ + public static function getCatIdByUrlPath($path) { + global $cfg, $client, $lang; + + if (strpos($path, '/') === 0) { + $path = substr($path, 1); + } + if (strrpos($path, '/') === strlen($path) - 1) { + $path = substr($path, 0, -1); + } + + $catSeperator = '/'; + $startFromRoot = parent::getConfig('startfromroot'); + $urls2lowercase = parent::getConfig('use_lowercase_uri'); + + $path = str_replace('/', parent::getConfig('category_seperator'), $path); + + $key = 'cat_ids_and_urlpath_' . $client . '_' . $lang; + + if (isset(self::$_lookupTable[$key])) { + $aPathsCache = self::$_lookupTable[$key]; + } else { + $aPathsCache = array(); + } + + if (count($aPathsCache) == 0) { + $sql = "SELECT cl.idcat, cl.urlpath FROM " . $cfg['tab']['cat_lang'] + . " AS cl, " . $cfg['tab']['cat'] . " AS c WHERE c.idclient = " . $client + . " AND c.idcat = cl.idcat AND cl.idlang = " . $lang; + + self::$_db->query($sql); + while (self::$_db->next_record()) { + $urlPath = self::$_db->f('urlpath'); + if ($startFromRoot == 0 && strpos($urlPath, $catSeperator) > 0) { + // paths are stored with prefixed main category, but created + // urls doesn't contain the main cat, remove it... + $urlPath = substr($urlPath, strpos($urlPath, $catSeperator) + 1); + } + if ($urls2lowercase) { + $urlPath = strtolower($urlPath); + } + + // store path + $aPathsCache[self::$_db->f('idcat')] = $urlPath; + } + } + self::$_lookupTable[$key] = $aPathsCache; + + // compare paths using the similar_text algorithm + $fPercent = 0; + $aResults = array(); + foreach ($aPathsCache as $id => $pathItem) { + similar_text($path, $pathItem, $fPercent); + $aResults[$id] = $fPercent; + } + + arsort($aResults, SORT_NUMERIC); + reset($aResults); + + ModRewriteDebugger::add($path, 'ModRewrite::getCatIdByUrlPath() $path'); + ModRewriteDebugger::add($aPathsCache, 'ModRewrite::getCatIdByUrlPath() $aPathsCache'); + ModRewriteDebugger::add($aResults, 'ModRewrite::getCatIdByUrlPath() $aResults'); + + $iMinPercentage = (int) parent::getConfig('category_resolve_min_percentage', 0); + $catId = key($aResults); + if ($iMinPercentage > 0 && $aResults[$catId] < $iMinPercentage) { + return 0; + } else { + return $catId; + } + } + + /** + * Get article name from article id and language id + * + * @NOTE: seems to be not used??? + * + * @param int $iArtId Article id + * @param int $iLangId Language id + * @return string Article name + */ + public static function getArtTitle($iArtId = 0, $iLangId = 0) { + global $cfg; + + $iArtId = (int) $iArtId; + $iLangId = (int) $iLangId; + + $sql = "SELECT title FROM " . $cfg['tab']['art_lang'] . " WHERE " + . "idart = " . $iArtId . " AND idlang = " . $iLangId; + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData['title']; + } + return ''; + } + + /** + * Get language ids from category id + * + * @param int $iCatId Category id + * @return array Used language ids + */ + public static function getCatLanguages($iCatId = 0) { + global $cfg; + + $iCatId = (int) $iCatId; + $key = 'cat_idlang_by_catid_' . $iCatId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $aLanguages = array(); + + $sql = "SELECT idlang FROM " . $cfg['tab']['cat_lang'] . " WHERE idcat = " . $iCatId; + self::$_db->query($sql); + while (self::$_db->next_record()) { + $aLanguages[] = self::$_db->f('idlang'); + } + + self::$_lookupTable[$key] = $aLanguages; + return $aLanguages; + } + + /** + * Get article urlname and language id + * + * @param int $iArtlangId idartlang + * @return array Urlname, idlang of empty array + */ + public static function getArtIds($iArtlangId = 0) { + global $cfg; + + $iArtlangId = (int) $iArtlangId; + $sql = "SELECT urlname, idlang FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = " . $iArtlangId; + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData; + } + return array(); + } + + /** + * Build a recursiv path for mod_rewrite rule like server directories + * (dir1/dir2/dir3) + * + * @param int $iCatId Latest category id + * @param int $iLangId Language id + * @param int $iLastId Last category id + * @return string linkpath with correct uri + */ + public static function buildRecursivPath($iCatId = 0, $iLangId = 0, $iLastId = 0) { + global $cfg; + + $aDirectories = array(); + $bFinish = false; + $iTmpCatId = (int) $iCatId; + $iLangId = (int) $iLangId; + $iLastId = (int) $iLastId; + + while ($bFinish == false) { + $sql = "SELECT cl.urlname, c.parentid FROM " . $cfg['tab']['cat_lang'] . " cl " + . "LEFT JOIN " . $cfg['tab']['cat'] . " c ON cl.idcat = c.idcat " + . "WHERE cl.idcat = " . $iTmpCatId . " AND cl.idlang = " . $iLangId; + if ($aData = mr_queryAndNextRecord($sql)) { + $aDirectories[] = $aData['urlname']; + $iTmpCatId = (int) $aData['parentid']; + + if ($aData['parentid'] == 0 || $aData['parentid'] == $iLastId) { + $bFinish = true; + } + } else { + $bFinish = true; + } + } + + // reverse array entries and create directory string + $sPath = join('/', array_reverse($aDirectories)); +# echo "
" . print_r($sPath, true) . "
"; + + return $sPath; + } + + /** + * Return full CONTENIDO url from single anchor + * + * @param array $aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments + * @return string New anchor + */ + public static function rewriteHtmlAnchor(array $aMatches = array()) { + global $artname, $sess, $idart, $idcat, $client, $lang; + + // set article name + $sArtParam = ''; + if (isset($artname) && strlen($artname) > 0) { + $sArtParam = '&idart=' . (int) $idart; + } + + // check for additional parameter in url + $aParamsToIgnore = array('idcat', 'idart', 'lang', 'client', 'idcatart', 'changelang', 'changeclient', 'idartlang', 'parts', 'artname'); + $sOtherParams = ''; + + if (isset($_GET) && count($_GET) > 0) { + foreach ($_GET as $key => $value) { + if (!in_array($key, $aParamsToIgnore) && strlen(trim($value)) > 0) { + $aNoAnchor = explode('#', $value); + $sOtherParams .= '&' . urlencode(urldecode($key)) . '=' . urlencode(urldecode($value)); + } + } + } + + $url = $sess->url( + 'front_content.php?' . 'idcat=' . (int) $idcat . '&client=' . (int) $client . + '&changelang=' . (int) $lang . $sArtParam . $sOtherParams . '#' . $aMatches[2] + ); + + $sNewUrl = ''; + + return $sNewUrl; + } + + /** + * Return full CONTENIDO url from single anchor + * + * @param array $aMatches [0] = complete anchor, [1] = pre arguments, [2] = anchor name, [3] = post arguments + * @param bool $bXHTML Flag to return XHTML valid url + * @return string New anchor + */ + public static function contenidoHtmlAnchor(array $aMatches = array(), $bXHTML = true) { + global $sess; + + $aParams = array(); + $sAmpersand = $bXHTML ? '&' : '&'; + + foreach ($_GET as $key => $value) { + $aNoAnchor = explode('#', $value); + $aParams[] = urlencode(urldecode($key)) . '=' . urlencode(urldecode($aNoAnchor[0])); + } + + $url = $sess->url('front_content.php?' . implode($sAmpersand, $aParams) . '#' . $aMatches[2]); + $sNewUrl = ''; + + return $sNewUrl; + } + + /** + * Get article websafe name from article id and language id. + * + * @param int $iArtId Article id + * @param int $iLangId Language id + * @return string Article websafe name + */ + public static function getArtWebsafeName($iArtId = 0, $iLangId = 0) { + global $cfg; + + $iArtId = (int) $iArtId; + $iLangId = (int) $iLangId; + $sql = "SELECT urlname FROM " . $cfg['tab']['art_lang'] . " WHERE " + . "idart = " . $iArtId . " AND idlang = " . $iLangId; + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData['urlname']; + } + return null; + } + + /** + * Get article websafe name from idartlang. + * + * @param int $iArtLangId idartlang + * @return string Article websafe name + */ + public static function getArtLangWebsafeName($iArtLangId = 0) { + global $cfg; + + $iArtLangId = (int) $iArtLangId; + $sql = "SELECT urlname FROM " . $cfg['tab']['art_lang'] . " WHERE idartlang = " . $iArtLangId; + if ($aData = mr_queryAndNextRecord($sql)) { + return $aData['urlname']; + } + return null; + } + + /** + * Get name of client by id. + * + * @param int $clientId Client id + * @return string Client name + */ + public static function getClientName($clientId = 0) { + global $cfg; + + $clientId = (int) $clientId; + $key = 'clientname_by_clientid_' . $clientId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT name FROM " . $cfg['tab']['clients'] . " WHERE idclient = " . $clientId; + if ($aData = mr_queryAndNextRecord($sql)) { + $clientName = $aData['name']; + } else { + $clientName = ''; + } + + self::$_lookupTable[$key] = $clientName; + return $clientName; + } + + /** + * Get client id from client name + * + * @param string $sClientName Client name + * @return int Client id + */ + public static function getClientId($sClientName = '') { + global $cfg; + + $sClientName = strtolower(self::$_db->escape($sClientName)); + $key = 'clientid_by_name_' . $sClientName; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT idclient FROM " . $cfg['tab']['clients'] . " WHERE LOWER(name) = '" . $sClientName . "' OR LOWER(name) = '" . urldecode($sClientName) . "'"; + + if ($aData = mr_queryAndNextRecord($sql)) { + $clientId = $aData['idclient']; + } else { + $clientId = false; + } + + self::$_lookupTable[$key] = $clientId; + return $clientId; + } + + /** + * Checks if client id exists + * + * @param int $clientId + * @return bool + */ + public static function clientIdExists($clientId) { + global $cfg; + + $clientId = (int) $clientId; + $key = 'clientid_exists_' . $clientId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT idclient FROM " . $cfg['tab']['clients'] . " WHERE idclient = " . $clientId; + if ($aData = mr_queryAndNextRecord($sql)) { + $exists = true; + } else { + $exists = false; + } + + self::$_lookupTable[$key] = $exists; + return $exists; + } + + /** + * Returns name of language by id. + * + * @param int $languageId Language id + * @return string Lanuage name + */ + public static function getLanguageName($languageId = 0) { + global $cfg; + + $languageId = (int) $languageId; + $key = 'languagename_by_id_' . $languageId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT name FROM " . $cfg['tab']['lang'] . " WHERE idlang = " . $languageId; + if ($aData = mr_queryAndNextRecord($sql)) { + $languageName = $aData['name']; + } else { + $languageName = ''; + } + + self::$_lookupTable[$key] = $languageName; + return $languageName; + } + + /** + * Checks if language id exists + * + * @param int $languageId Language id + * @return bool + */ + public static function languageIdExists($languageId) { + global $cfg; + + $languageId = (int) $languageId; + $key = 'languageid_exists_' . $languageId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT idlang FROM " . $cfg['tab']['lang'] . " WHERE idlang = " . $languageId; + if ($aData = mr_queryAndNextRecord($sql)) { + $exists = true; + } else { + $exists = false; + } + + self::$_lookupTable[$key] = $exists; + return $exists; + } + + /** + * Get language id from language name thanks to Nicolas Dickinson for multi + * Client/Language BugFix + * + * @param string $sLanguageName Language name + * @param int $iClientId Client id + * @return int Language id + */ + public static function getLanguageId($sLanguageName = '', $iClientId = 1) { + global $cfg; + + $sLanguageName = strtolower(self::$_db->escape($sLanguageName)); + $iClientId = (int) $iClientId; + $key = 'langid_by_langname_clientid_' . $sLanguageName . '_' . $iClientId; + + if (isset(self::$_lookupTable[$key])) { + return self::$_lookupTable[$key]; + } + + $sql = "SELECT l.idlang FROM " . $cfg['tab']['lang'] . " as l " + . "LEFT JOIN " . $cfg['tab']['clients_lang'] . " AS cl ON l.idlang = cl.idlang " + . "WHERE cl.idclient = " . $iClientId . " AND (LOWER(l.name) = '" . $sLanguageName . "' " + . "OR LOWER(l.name) = '" . urldecode($sLanguageName) . "')"; + if ($aData = mr_queryAndNextRecord($sql)) { + $languageId = $aData['idlang']; + } else { + $languageId = 0; + } + + self::$_lookupTable[$key] = $languageId; + return $languageId; + } + + /** + * 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') + * + * @param string $url URL to split + * @return array Assoziative array including the two parts: + * - array('htmlpath' => $path, 'url' => $url) + */ + public static function getClientFullUrlParts($url) { + global $cfgClient, $client; + + $clientPath = $cfgClient[$client]['path']['htmlpath']; + + if (stristr($url, $clientPath) !== false) { + // url includes full html path (scheme host path, etc.) + $url = str_replace($clientPath, '', $url); + $htmlPath = $clientPath; + $aComp = parse_url($htmlPath); + + // check if path matches to defined rootdir from 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/" + $htmlPath = str_replace($aComp['path'], parent::getConfig('rootdir'), $htmlPath); + if (substr($htmlPath, strlen($htmlPath) - 1) == '/') { + // remove last slash + $htmlPath = substr($htmlPath, 0, strlen($htmlPath) - 1); + } + } + } else { + $htmlPath = ''; + } + return array('htmlpath' => $htmlPath, 'url' => $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' + * + * @param string $url Url to clean + * @return string Cleaned Url + */ + public static function urlPreClean($url) { + // some preparation of different front_content.php occurence + if (strpos($url, './front_content.php') === 0) { + $url = str_replace('./front_content.php', 'front_content.php', $url); + } elseif (strpos($url, '/front_content.php') === 0) { + $url = str_replace('/front_content.php', 'front_content.php', $url); + } + $url = str_replace('&', '&', $url); + return $url; + } + + /** + * Method to reset all aliases in categories. + * + * Clears all urlname entries in cat_lang table, and sets the value for all + * existing entries. + * + * @deprecated see ModRewrite::recreateCategoriesAliases(); + */ + public static function resetCategoriesAliases() { + self::recreateCategoriesAliases(); + } + + /** + * Recreates all or only empty aliases in categories table. + * + * @param bool $bOnlyEmpty Flag to reset only empty items + */ + public static function recreateCategoriesAliases($bOnlyEmpty = false) { + global $cfg; + + $db = new DB_Contenido(); + + $aCats = array(); + + // get all or only empty categories + $sql = "SELECT name, idcat, idlang FROM " . $cfg['tab']['cat_lang']; + if ($bOnlyEmpty === true) { + $sql .= " WHERE urlname IS NULL OR urlname = '' OR urlpath IS NULL OR urlpath = ''"; + } + + $db->query($sql); + while ($db->next_record()) { + //set new alias + self::setCatWebsafeName($db->f('name'), $db->f('idcat'), $db->f('idlang')); + $aCats[] = array('idcat' => $db->f('idcat'), 'idlang' => $db->f('idlang')); + } + + foreach ($aCats as $p => $item) { + self::setCatUrlPath($item['idcat'], $item['idlang']); + } + + unset($db, $aCats); + } + + /** + * Returns list of all empty category aliases + * + * @param bool $bOnlyNumber + * @return array|int + */ + public static function getEmptyCategoriesAliases($bOnlyNumber = true) { + global $cfg; + + $db = new DB_Contenido(); + $return = ($bOnlyNumber) ? 0 : array(); + + // get all empty categories + $sql = "SELECT name, idcat, idlang FROM " . $cfg['tab']['cat_lang']; + $sql .= " WHERE urlname IS NULL OR urlname = '' OR urlpath IS NULL OR urlpath = ''"; + + $db->query($sql); + + if ($bOnlyNumber) { + $return = (int) $db->num_rows(); + } else { + while ($db->next_record()) { + $return[] = array($db->f('name'), $db->f('idcat'), $db->f('idlang')); + } + } + + unset($db); + return $return; + } + + /** + * Method to reset all aliases in articles. + * + * Clears all urlname entries in art_lang table, and sets the value for all + * existing entries. + * + * @deprecated see ModRewrite::recreateArticlesAliases(); + */ + public static function resetArticlesAliases() { + self::recreateArticlesAliases(); + } + + /** + * Recreates all or only empty urlname entries in art_lang table. + * + * @param bool $bOnlyEmpty Flag to reset only empty items + */ + public static function recreateArticlesAliases($bOnlyEmpty = false) { + global $cfg; + + $db = new DB_Contenido(); + + // get all or only empty articles + $sql = "SELECT title, idart, idlang FROM " . $cfg['tab']['art_lang']; + if ($bOnlyEmpty === true) { + $sql .= " WHERE urlname IS NULL OR urlname = ''"; + } + $db->query($sql); + + while ($db->next_record()) { + //set new alias + self::setArtWebsafeName($db->f('title'), $db->f('idart'), $db->f('idlang')); + } + + unset($db); + } + + /** + * Returns list of all empty article aliases + * + * @param bool $bOnlyNumber + * @return array|int + */ + public static function getEmptyArticlesAliases($bOnlyNumber = true) { + global $cfg; + + $db = new DB_Contenido(); + $return = ($bOnlyNumber) ? 0 : array(); + + // get all empty articles + $sql = "SELECT title, idart, idlang FROM " . $cfg['tab']['art_lang']; + $sql .= " WHERE urlname IS NULL OR urlname = ''"; + + $db->query($sql); + if ($bOnlyNumber) { + $return = (int) $db->num_rows(); + } else { + while ($db->next_record()) { + $return[] = array($db->f('title'), $db->f('idart'), $db->f('idlang')); + } + } + + unset($db); + return $return; + } + + /** + * Method to reset all aliases (categories and articles). + * + * Shortcut to recreateCategoriesAliases() and recreateArticlesAliases() + */ + public static function resetAliases() { + self::recreateCategoriesAliases(); + self::recreateArticlesAliases(); + } + + /** + * Recreate all or only empty aliases (categories and articles). + * + * Shortcut to recreateCategoriesAliases() and recreateArticlesAliases() + * + * @param bool $bOnlyEmpty Flag to reset only empty items + */ + public static function recreateAliases($bOnlyEmpty = false) { + self::recreateCategoriesAliases($bOnlyEmpty); + self::recreateArticlesAliases($bOnlyEmpty); + } + + /** + * Used to postprocess resolved path + * + * Error site handling if category not found + * + * if percentage == 100 and there is no 100 percentage result value, + * error site will be shown - can be adjust by user settings for + * smooth similar effects - 80 to 95 will be best but have to check by user + * + * @deprecated Is no more used + * + * @param array $results Pathresolver results array + * @return mixed Categoryid or false + */ + public static function getIdFromPathresolverResult($results) { + $iMinPercentage = (int) parent::getConfig('category_resolve_min_percentage', 0); + $catId = key($results); + if ($iMinPercentage > 0 && $results[$catId] < $iMinPercentage) { + return false; + } else { + return $catId; + } + } + + /** + * Returns .htaccess related assoziative info array + * + * @return array + */ + public static function getHtaccessInfo() { + global $cfgClient, $client, $cfg; + + $arr = array( + 'contenido_full_path' => str_replace('\\', '/', realpath($cfg['path']['contenido'] . '../') . '/'), + 'client_full_path' => $cfgClient[$client]['path']['frontend'], + ); + $arr['in_contenido_path'] = is_file($arr['contenido_full_path'] . '.htaccess'); + $arr['in_client_path'] = is_file($arr['client_full_path'] . '.htaccess'); + $arr['has_htaccess'] = ($arr['in_contenido_path'] || $arr['in_client_path']); + + return $arr; + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewritebase.php b/conlite/plugins/mod_rewrite/classes/class.modrewritebase.php index c35b556..39c29ef 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewritebase.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewritebase.php @@ -1,99 +1,87 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-09-24 - * - * $Id: class.modrewritebase.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Abstract base mod rewrite class. - * - * Provides some common features such as common debugging, globals/configuration - * access for childs. - * - * @author Murat Purc - * @package Contenido Backend plugins - * @subpackage ModRewrite - */ -abstract class ModRewriteBase -{ - - /** - * Returns enabled state of mod rewrite plugin - * - * @return bool - */ - public static function isEnabled() - { - return (self::getConfig('use', 0) == 1) ? true : false; - } - - /** - * Sets the enabled state of mod rewrite plugin - * - * @pparam bool $bEnabled - */ - public static function setEnabled($bEnabled) - { - self::setConfig('use', (bool) $bEnabled); - } - - - /** - * Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite'] - * - * @param string $key Name of configuration key - * @return mixed Desired value mr configuration, either the full configuration - * or one of the desired subpart - */ - public static function getConfig($key=null, $default=null) - { - global $cfg; - if ($key == null) { - return $cfg['mod_rewrite']; - } elseif ((string) $key !== '') { - return (isset($cfg['mod_rewrite'][$key])) ? $cfg['mod_rewrite'][$key] : $default; - } else { - return $default; - } - } - - /** - * Sets the configuration of mod rewrite, content of gobal $cfg['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; - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Abstract base mod rewrite class. + * + * Provides some common features such as common debugging, globals/configuration + * access for childs. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +abstract class ModRewriteBase { + + /** + * Initialization, is to call at least once by an child. + * @deprecated + */ + protected static function initialize() { + } + + /** + * Returns enabled state of mod rewrite plugin + * + * @return bool + */ + public static function isEnabled() { + return (self::getConfig('use', 0) == 1) ? true : false; + } + + /** + * Sets the enabled state of mod rewrite plugin + * + * @param bool $bEnabled + */ + public static function setEnabled($bEnabled) { + self::setConfig('use', (bool) $bEnabled); + } + + /** + * Returns configuration of mod rewrite, content of gobal $cfg['mod_rewrite'] + * + * @param string $key Name of configuration key + * @param mixed $default Default value to return as a fallback + * @return mixed Desired value mr configuration, either the full configuration + * or one of the desired subpart + */ + public static function getConfig($key = null, $default = null) { + global $cfg; + if ($key == null) { + return $cfg['mod_rewrite']; + } elseif ((string) $key !== '') { + return (isset($cfg['mod_rewrite'][$key])) ? $cfg['mod_rewrite'][$key] : $default; + } else { + return $default; + } + } + + /** + * Sets the configuration of mod rewrite, content of gobal $cfg['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; + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewritecontroller.php b/conlite/plugins/mod_rewrite/classes/class.modrewritecontroller.php index 9d5a022..3f238f1 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewritecontroller.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewritecontroller.php @@ -1,634 +1,678 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-04-16 - * - * $Id: class.modrewritecontroller.php 211 2013-01-25 09:30:14Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Mod Rewrite controller class. Extracts url parts and sets some necessary globals like: - * - $idart - * - $idcat - * - $client - * - $changeclient - * - $lang - * - $changelang - * - * @author Murat Purc - * @package Contenido Backend plugins - * @subpackage ModRewrite - */ -class ModRewriteController extends ModRewriteBase -{ - - /** - * Extracted request uri path parts by path separator '/' - * - * @var array - */ - private $_aParts; - - /** - * Extracted article name from request uri - * - * @var string - */ - private $_sArtName; - - /** - * Remaining path for path resolver (see $GLOBALS['path']) - * - * @var string - */ - private $_sPath; - - /** - * Incomming URL - * - * @var string - */ - private $_sIncommingUrl; - - /** - * Resolved URL - * - * @var string - */ - private $_sResolvedUrl; - - /** - * Client id used by this class - * - * @var int - */ - private $_iClientMR; - - /** - * Flag about occured errors - * - * @var bool - */ - private $_bError = false; - - /** - * Flag about found routing definition - * - * @var bool - */ - private $_bRoutingFound = false; - - - /** - * Constructor, sets several properties. - * - * @param string $incommingUrl Incomming URL - */ - public function __construct($incommingUrl) - { - $this->_sIncommingUrl = $incommingUrl; - $this->_aParts = array(); - } - - - /** - * Getter for overwritten client id (see $GLOBALS['client']) - * - * @return int Client id - */ - public function getClient() - { - return $GLOBALS['client']; - } - - - /** - * Getter for overwritten change client id (see $GLOBALS['changeclient']) - * - * @return int Change client id - */ - public function getChangeClient() - { - return $GLOBALS['changeclient']; - } - - - /** - * Getter for article id (see $GLOBALS['idart']) - * - * @return int Article id - */ - public function getIdArt() - { - return $GLOBALS['idart']; - } - - - /** - * Getter for category id (see $GLOBALS['idcat']) - * - * @return int Category id - */ - public function getIdCat() - { - return $GLOBALS['idcat']; - } - - - /** - * Getter for language id (see $GLOBALS['lang']) - * - * @return int Language id - */ - public function getLang() - { - return $GLOBALS['lang']; - } - - - /** - * Getter for change language id (see $GLOBALS['change_lang']) - * - * @return int Change language id - */ - public function getChangeLang() - { - return $GLOBALS['change_lang']; - } - - - /** - * Getter for path (see $GLOBALS['path']) - * - * @return string Path, used by path resolver - */ - public function getPath() - { - return $this->_sPath; - } - - - /** - * Getter for resolved url - * - * @return string Resolved url - */ - public function getResolvedUrl() - { - return $this->_sResolvedUrl; - } - - - /** - * Returns a flag about found routing definition - * - * return bool Flag about found routing - */ - public function getRoutingFoundState() - { - return $this->_bRoutingFound; - } - - - /** - * Getter for occured error state - * - * @return bool Flag for occured error - */ - public function errorOccured() - { - return $this->_bError; - } - - - /** - * Main function to call for mod rewrite related preprocessing jobs. - * - * Executes some private functions to extract request URI and to set needed membervariables - * (client, language, article id, category id, etc.) - */ - public function execute() - { - if (parent::isEnabled() == false) { - return; - } - - $this->_extractRequestUri(); - - $this->_initializeClientId(); - - $this->_setClientId(); - - mr_loadConfiguration($this->_iClientMR); - - $this->_setLanguageId(); - - // second call after setting client and language - $this->_extractRequestUri(true); - - $this->_setPathresolverSetting(); - - $this->_setIdart(); - - ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::execute() _setIdart'); - - $this->_postValidation(); - } - - - /** - * Extracts request URI and sets member variables $this->_sArtName and $this->_aParts - * - * @param bool $secondCall Flag about second call of this function, is needed - * to re extract url if a routing definition was found - */ - private function _extractRequestUri($secondCall = false) - { - global $client; - - // check for defined rootdir - if (parent::getConfig('rootdir') !== '/' && strpos($_SERVER['REQUEST_URI'], $this->_sIncommingUrl) === 0) { - $this->_sIncommingUrl = str_replace(parent::getConfig('rootdir'), '/', $this->_sIncommingUrl); - } - - $aUrlComponents = $this->_parseUrl($this->_sIncommingUrl); - if (isset($aUrlComponents['path'])) { - if (parent::getConfig('rootdir') !== '/' && strpos($aUrlComponents['path'], parent::getConfig('rootdir')) === 0) { - $aUrlComponents['path'] = str_replace(parent::getConfig('rootdir'), '/', $aUrlComponents['path']); - } - - if ($secondCall == true) { - - // @todo: implement real redirect of old front_content.php style urls - - // check for routing definition - $routings = parent::getConfig('routing'); - if (is_array($routings) && isset($routings[$aUrlComponents['path']])) { - $aUrlComponents['path'] = $routings[$aUrlComponents['path']]; - if (strpos($aUrlComponents['path'], 'front_content.php') !== false) { - // routing destination contains front_content.php - - $this->_bRoutingFound = true; - - // set client language, if not set before - mr_setClientLanguageId($client); - - //rebuild URL - $url = mr_buildNewUrl($aUrlComponents['path']); - - $aUrlComponents = $this->_parseUrl($url); - - // add query parameter to superglobal _GET - if (isset($aUrlComponents['query'])) { - parse_str($aUrlComponents['query'], $vars); - $_GET = array_merge($_GET, $vars); - } - - $this->_aParts = array(); - } - } else { - return; - } - } - $sPath = (parent::getConfig('use_lowercase_uri') == true)?strtolower($aUrlComponents['path']):$aUrlComponents['path']; - $aPaths = explode('/', $aUrlComponents['path']); - foreach ($aPaths as $p => $item) { - if (!empty($item)) { - // pathinfo would also work - $arr = explode('.', $item); - $count = count($arr); - if ($count > 0 && '.' . strtolower($arr[$count-1]) == parent::getConfig('file_extension')) { - array_pop($arr); - $this->_sArtName = implode('.', $arr); - } else { - $this->_aParts[] = $item; - } - } - } - - if ($secondCall == true) { - // reprocess extracting client and language - $this->_setClientId(); - mr_loadConfiguration($this->_iClientMR); - $this->_setLanguageId(); - } - - } - ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::_extractRequestUri() $this->_aParts'); - - // loop parts array and remove existing 'front_content.php' - if ($this->_hasPartArrayItems()) { - foreach($this->_aParts as $p => $item) { - if ($item == 'front_content.php') { - unset($this->_aParts[$p]); - } - } - } - - // set parts property top null, if needed - if ($this->_hasPartArrayItems() == false) { - $this->_aParts = null; - } - - // set artname to null if needed - if (!isset($this->_sArtName) || empty($this->_sArtName) || strlen($this->_sArtName) == 0) { - $this->_sArtName = null; - } - - } - - - /** - * Tries to initialize the client id - */ - private function _initializeClientId() - { - global $client, $changeclient, $load_client; - - $iClient = (isset($client) && (int) $client > 0) ? $client : 0; - $iChangeClient = (isset($changeclient) && (int) $changeclient > 0) ? $changeclient : 0; - $iLoadClient = (isset($load_client) && (int) $load_client > 0) ? $load_client : 0; - - $this->_iClientMR = 0; - if ($iClient > 0 && $iChangeClient == 0) { - $this->_iClientMR = $iClient; - } elseif ($iChangeClient > 0) { - $this->_iClientMR = $iChangeClient; - } else { - $this->_iClientMR = $iLoadClient; - } - - if ((int) $this->_iClientMR > 0) { - // set global client variable - $client = (int) $this->_iClientMR; - } - } - - - /** - * Sets client id - */ - private function _setClientId() - { - global $client, $changeclient, $load_client; - - if ($this->_hasPartArrayItems() == false || parent::getConfig('use_client') !== 1) { - return; - } - - $iClient = (isset($client) && (int) $client > 0) ? $client : 0; - $iLoadClient = (isset($load_client) && (int) $load_client > 0) ? $load_client : 0; - - if (parent::getConfig('use_client_name') == 1) { - $changeclient = ModRewrite::getClientId(array_shift($this->_aParts)); - $this->_iClientMR = $changeclient; - } else { - $changeclient = (int) array_shift($this->_aParts); - $this->_iClientMR = $changeclient; - } - - if (empty($changeclient) || (int) $changeclient <= 0) { - $changeclient = $iLoadClient; - } - if ($iClient > 0 && $changeclient !== $iClient) { - // overwrite existing client variable - $this->_iClientMR = $changeclient; - $client = $changeclient; - } - } - - - /** - * Sets language id - */ - private function _setLanguageId() - { - global $lang, $changelang; - - if ($this->_hasPartArrayItems() == false || parent::getConfig('use_language') !== 1) { - return; - } - - if (parent::getConfig('use_language_name') == 1) { - // thanks to Nicolas Dickinson for multi Client/Language BugFix - $changelang = ModRewrite::getLanguageId(array_shift($this->_aParts) , $this->_iClientMR); - } else { - $changelang = (int) array_shift($this->_aParts); - } - - if ((int) $changelang > 0) { - $lang = $changelang; - $changelang = $changelang; - } - } - - - /** - * Sets path resolver and category id - */ - private function _setPathresolverSetting() - { - global $client, $lang, $load_lang, $idcat; - - if ($this->_hasPartArrayItems() == false) { - return; - } - - $this->_sPath = '/' . implode('/', $this->_aParts) . '/'; - - if (!isset($lang) || (int) $lang <= 0) { - if ((int) $load_lang > 0) { - // load_client is set in frontend/config.php - $lang = (int) $load_lang; - } else { - // get client id from table - cInclude('classes', 'contenido/class.clientslang.php'); - $clCol = new cApiClientLanguageCollection(); - $clCol->setWhere('idclient', $client); - $clCol->query(); - if ($clItem = $clCol->next()) { - $lang = $clItem->get('idlang'); - } - } - } - - $idcat = (int) ModRewrite::getCatIdByUrlPath($this->_sPath); - - if ($idcat == 0) { - // category couldn't resolved - $this->_bError = true; - $idcat = null; - } else { - // unset $this->_sPath if $idcat could set, otherwhise it would be resolved again. - unset($this->_sPath); - } - - ModRewriteDebugger::add($idcat, 'ModRewriteController->_setPathresolverSetting $idcat'); - ModRewriteDebugger::add($this->_sPath, 'ModRewriteController->_setPathresolverSetting $this->_sPath'); - } - - - /** - * Sets article id - */ - private function _setIdart() - { - global $idcat, $idart, $lang; - - // startarticle name in url - if (parent::getConfig('add_startart_name_to_url') && isset($this->_sArtName)) { - if ($this->_sArtName == parent::getConfig('default_startart_name')) { - // stored articlename is the default one, remove it ModRewrite::getArtIdByWebsafeName() - // will find the real article name - $this->_sArtName = null; - } - } - - $idcat = (isset($idcat) && (int) $idcat > 0) ? $idcat : null; - $idart = (isset($idart) && (int) $idart > 0) ? $idart : null; - - if ($idcat !== null && $this->_sArtName && $idart == null) { - // existing idcat with article name and no idart - $idart = ModRewrite::getArtIdByWebsafeName($this->_sArtName, $idcat, $lang); - } elseif ($idcat > 0 && $this->_sArtName == null && $idart == null) { - - if (parent::getConfig('add_startart_name_to_url') && parent::getConfig('default_startart_name') == '') { - - // existing idcat without article name and idart - cInclude('classes', 'class.article.php'); - $artColl = new ArticleCollection(array('idcat' => $idcat, 'start' => 1)); - if ($artItem = $artColl->startArticle()) { - $idart = $artItem->get('idart'); - } - - } - - } elseif ($idcat == null && $idart == null && isset($this->_sArtName)) { - // no idcat and idart but article name - $idart = ModRewrite::getArtIdByWebsafeName($this->_sArtName); - } - - if ($idart !== null && (!$idart || (int) $idart == 0)) { - if (parent::getConfig('redirect_invalid_article_to_errorsite') == 1) { - $this->_bError = true; - $idart = null; - } - } - - ModRewriteDebugger::add($idart, 'ModRewriteController->_setIdart $idart'); - } - - - /** - * Does post validation of the extracted data. - * - * One main goal of this function is to prevent duplicated content, which could happen, if - * the configuration 'startfromroot' is activated. - */ - private function _postValidation() - { - global $idcat, $idart, $client; - - if ($this->_bError || $this->_bRoutingFound || !$this->_hasPartArrayItems()) { - return; - } - - if (parent::getConfig('startfromroot') == 1 && parent::getConfig('prevent_duplicated_content') == 1) { - - // prevention of duplicated content if '/firstcat/' is directly requested! - - $idcat = (isset($idcat) && (int) $idcat > 0) ? $idcat : null; - $idart = (isset($idart) && (int) $idart > 0) ? $idart : null; - - // compose new parameter - $param = ''; - if ($idcat) { - $param .= 'idcat=' . (int) $idcat; - } - if ($idart) { - $param .= ($param !== '') ? '&idart=' . (int) $idart : 'idart=' . (int) $idart; - } - - if ($param == '') { - return; - } - - // set client language, if not set before - mr_setClientLanguageId($client); - - //rebuild url - $url = mr_buildNewUrl('front_content.php?' . $param); - - $aUrlComponents = @parse_url($this->_sIncommingUrl); - $incommingUrl = (isset($aUrlComponents['path'])) ? $aUrlComponents['path'] : ''; - - ModRewriteDebugger::add($url, 'ModRewriteController->_postValidation validate url'); - ModRewriteDebugger::add($incommingUrl, 'ModRewriteController->_postValidation incommingUrl'); - - // now the new generated uri should be identical with the request uri - if ($incommingUrl !== $url) { - $this->_bError = true; - $idcat = null; - } - } - } - - - /** - * Parses the url using defined separators - * - * @param string $url Incoming url - * @return string Parsed url - */ - private function _parseUrl($url) - { - $this->_sResolvedUrl = $url; - - $oMrUrlUtil = ModRewriteUrlUtil::getInstance(); - $url = $oMrUrlUtil->toContenidoUrl($url); - - return @parse_url($url); - } - - - /** - * Returns state of parts property. - * - * @return bool True if $this->_aParts propery is an array and contains items - * @access private - */ - function _hasPartArrayItems() - { - if (is_array($this->_aParts) && count($this->_aParts) > 0) { - return true; - } else { - return false; - } - } - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Mod Rewrite controller class. Extracts url parts and sets some necessary globals like: + * - $idart + * - $idcat + * - $client + * - $changeclient + * - $lang + * - $changelang + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewriteController extends ModRewriteBase { + // Error constants + + const ERROR_CLIENT = 1; + const ERROR_LANGUAGE = 2; + const ERROR_CATEGORY = 3; + const ERROR_ARTICLE = 4; + const ERROR_POST_VALIDATION = 5; + const FRONT_CONTENT = 'front_content.php'; + + /** + * Extracted request uri path parts by path separator '/' + * + * @var array + */ + private $_aParts; + + /** + * Extracted article name from request uri + * + * @var string + */ + private $_sArtName; + + /** + * Remaining path for path resolver (see $GLOBALS['path']) + * + * @var string + */ + private $_sPath; + + /** + * Incomming URL + * + * @var string + */ + private $_sIncommingUrl; + + /** + * Resolved URL + * + * @var string + */ + private $_sResolvedUrl; + + /** + * Client id used by this class + * + * @var int + */ + private $_iClientMR; + + /** + * Language id used by this class + * + * @var int + */ + private $_iLangMR; + + /** + * Flag about occured errors + * + * @var bool + */ + private $_bError = false; + + /** + * One of ERROR_* constants or 0 + * + * @var int + */ + private $_iError = 0; + + /** + * Flag about found routing definition + * + * @var bool + */ + private $_bRoutingFound = false; + + /** + * Constructor, sets several properties. + * + * @param string $incommingUrl Incomming URL + */ + public function __construct($incommingUrl) { + + // CON-1266 make incomming URL lowercase if option "URLS to + // lowercase" is set + if (1 == $this->getConfig('use_lowercase_uri')) { + $incommingUrl = strtolower($incommingUrl); + } + + $this->_sIncommingUrl = $incommingUrl; + $this->_aParts = array(); + $this->_sArtName = ''; + } + + /** + * Getter for overwritten client id (see $GLOBALS['client']) + * + * @return int Client id + */ + public function getClient() { + return $GLOBALS['client']; + } + + /** + * Getter for overwritten change client id (see $GLOBALS['changeclient']) + * + * @return int Change client id + */ + public function getChangeClient() { + return $GLOBALS['changeclient']; + } + + /** + * Getter for article id (see $GLOBALS['idart']) + * + * @return int Article id + */ + public function getIdArt() { + return $GLOBALS['idart']; + } + + /** + * Getter for category id (see $GLOBALS['idcat']) + * + * @return int Category id + */ + public function getIdCat() { + return $GLOBALS['idcat']; + } + + /** + * Getter for language id (see $GLOBALS['lang']) + * + * @return int Language id + */ + public function getLang() { + return $GLOBALS['lang']; + } + + /** + * Getter for change language id (see $GLOBALS['changelang']) + * + * @return int Change language id + */ + public function getChangeLang() { + return $GLOBALS['changelang']; + } + + /** + * Getter for path (see $GLOBALS['path']) + * + * @return string Path, used by path resolver + */ + public function getPath() { + return $this->_sPath; + } + + /** + * Getter for resolved url + * + * @return string Resolved url + */ + public function getResolvedUrl() { + return $this->_sResolvedUrl; + } + + /** + * Returns a flag about found routing definition + * + * return bool Flag about found routing + */ + public function getRoutingFoundState() { + return $this->_bRoutingFound; + } + + /** + * Getter for occured error state + * + * @return bool Flag for occured error + */ + public function errorOccured() { + return $this->_bError; + } + + /** + * Getter for occured error state + * + * @return int Numeric error code + */ + public function getError() { + return $this->_iError; + } + + /** + * Main function to call for mod rewrite related preprocessing jobs. + * + * Executes some private functions to extract request URI and to set needed membervariables + * (client, language, article id, category id, etc.) + */ + public function execute() { + if (parent::isEnabled() == false) { + return; + } + + $this->_extractRequestUri(); + + $this->_initializeClientId(); + + $this->_setClientId(); + + mr_loadConfiguration($this->_iClientMR); + + $this->_setLanguageId(); + + // second call after setting client and language + $this->_extractRequestUri(true); + + $this->_setPathresolverSetting(); + + $this->_setIdart(); + + ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::execute() _setIdart'); + + $this->_postValidation(); + } + + /** + * Extracts request URI and sets member variables $this->_sArtName and $this->_aParts + * + * @param bool $secondCall Flag about second call of this function, is needed + * to re extract url if a routing definition was found + */ + private function _extractRequestUri($secondCall = false) { + global $client; + + // get REQUEST_URI + $requestUri = $_SERVER['REQUEST_URI']; + // CON-1266 make request URL lowercase if option "URLS to + // lowercase" is set + if (1 == $this->getConfig('use_lowercase_uri')) { + $requestUri = strtolower($requestUri); + } + + // check for defined rootdir + if (parent::getConfig('rootdir') !== '/' && strpos($requestUri, $this->_sIncommingUrl) === 0) { + $this->_sIncommingUrl = str_replace(parent::getConfig('rootdir'), '/', $this->_sIncommingUrl); + } + + $aUrlComponents = $this->_parseUrl($this->_sIncommingUrl); + if (isset($aUrlComponents['path'])) { + if (parent::getConfig('rootdir') !== '/' && strpos($aUrlComponents['path'], parent::getConfig('rootdir')) === 0) { + $aUrlComponents['path'] = str_replace(parent::getConfig('rootdir'), '/', $aUrlComponents['path']); + } + + if ($secondCall == true) { + + // @todo: implement real redirect of old front_content.php style urls + // check for routing definition + $routings = parent::getConfig('routing'); + if (is_array($routings) && isset($routings[$aUrlComponents['path']])) { + $aUrlComponents['path'] = $routings[$aUrlComponents['path']]; + if (strpos($aUrlComponents['path'], self::FRONT_CONTENT) !== false) { + // routing destination contains front_content.php + + $this->_bRoutingFound = true; + + // set client language, if not set before + mr_setClientLanguageId($client); + + //rebuild URL + $url = mr_buildNewUrl($aUrlComponents['path']); + + $aUrlComponents = $this->_parseUrl($url); + + // add query parameter to superglobal _GET + if (isset($aUrlComponents['query'])) { + $vars = null; + parse_str($aUrlComponents['query'], $vars); + $_GET = array_merge($_GET, $vars); + } + + $this->_aParts = array(); + } + } else { + return; + } + } + + $aPaths = explode('/', $aUrlComponents['path']); + foreach ($aPaths as $p => $item) { + if (!empty($item)) { + // pathinfo would also work + $arr = explode('.', $item); + $count = count($arr); + if ($count > 0 && '.' . strtolower($arr[$count - 1]) == parent::getConfig('file_extension')) { + array_pop($arr); + $this->_sArtName = trim(implode('.', $arr)); + } else { + $this->_aParts[] = $item; + } + } + } + + if ($secondCall == true) { + // reprocess extracting client and language + $this->_setClientId(); + mr_loadConfiguration($this->_iClientMR); + $this->_setLanguageId(); + } + } + ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::_extractRequestUri() $this->_aParts'); + + // loop parts array and remove existing 'front_content.php' + if ($this->_hasPartArrayItems()) { + foreach ($this->_aParts as $p => $item) { + if ($item == self::FRONT_CONTENT) { + unset($this->_aParts[$p]); + } + } + } + } + + /** + * Tries to initialize the client id. + * This is required to load the proper plugin configuration for current client. + */ + private function _initializeClientId() { + global $client, $changeclient, $load_client; + + $iClient = (isset($client) && (int) $client > 0) ? $client : 0; + $iChangeClient = (isset($changeclient) && (int) $changeclient > 0) ? $changeclient : 0; + $iLoadClient = (isset($load_client) && (int) $load_client > 0) ? $load_client : 0; + + $this->_iClientMR = 0; + if ($iClient > 0 && $iChangeClient == 0) { + $this->_iClientMR = $iClient; + } elseif ($iChangeClient > 0) { + $this->_iClientMR = $iChangeClient; + } else { + $this->_iClientMR = $iLoadClient; + } + + if ((int) $this->_iClientMR > 0) { + // set global client variable + $client = (int) $this->_iClientMR; + } + } + + /** + * Tries to initialize the language id. + */ + private function _initializeLanguageId() { + global $lang, $changelang, $load_lang; + + $iLang = (isset($lang) && (int) $lang > 0) ? $lang : 0; + $iChangeLang = (isset($changelang) && (int) $changelang > 0) ? $changelang : 0; + $iLoadLang = (isset($load_lang) && (int) $load_lang > 0) ? $load_lang : 0; + + $this->_iLangMR = 0; + if ($iLang > 0 && $iChangeLang == 0) { + $this->_iLangMR = $iLang; + } elseif ($iChangeLang > 0) { + $this->_iLangMR = $iChangeLang; + } else { + $this->_iLangMR = $iLoadLang; + } + + if ((int) $this->_iLangMR > 0) { + // set global lang variable + $lang = (int) $this->_iLangMR; + } + } + + /** + * Detects client id from given url + */ + private function _setClientId() { + global $client; + + if ($this->_bError) { + return; + } elseif ($this->_isRootRequest()) { + // request to root + return; + } elseif (parent::getConfig('use_client') !== 1) { + return; + } + + if (parent::getConfig('use_client_name') == 1) { + $detectedClientId = (int) ModRewrite::getClientId(array_shift($this->_aParts)); + } else { + $detectedClientId = (int) array_shift($this->_aParts); + if ($detectedClientId > 0 && !ModRewrite::languageIdExists($detectedClientId)) { + $detectedClientId = 0; + } + } + + if ($detectedClientId > 0) { + // overwrite existing client variables + $this->_iClientMR = $detectedClientId; + $client = $detectedClientId; + } else { + $this->_setError(self::ERROR_CLIENT); + } + } + + /** + * Sets language id + */ + private function _setLanguageId() { + global $lang; + + if ($this->_bError) { + return; + } elseif ($this->_isRootRequest()) { + // request to root + return; + } elseif (parent::getConfig('use_language') !== 1) { + return; + } + + if (parent::getConfig('use_language_name') == 1) { + // thanks to Nicolas Dickinson for multi Client/Language BugFix + $languageName = array_shift($this->_aParts); + $detectedLanguageId = (int) ModRewrite::getLanguageId($languageName, $this->_iClientMR); + } else { + $detectedLanguageId = (int) array_shift($this->_aParts); + if ($detectedLanguageId > 0 && !ModRewrite::clientIdExists($detectedLanguageId)) { + $detectedLanguageId = 0; + } + } + + if ($detectedLanguageId > 0) { + // overwrite existing language variables + $this->_iLangMR = $detectedLanguageId; + $lang = $detectedLanguageId; + } else { + $this->_setError(self::ERROR_LANGUAGE); + } + } + + /** + * Sets path resolver and category id + */ + private function _setPathresolverSetting() { + global $client, $lang, $load_lang, $idcat; + + if ($this->_bError) { + return; + } elseif (!$this->_hasPartArrayItems()) { + return; + } + + $this->_sPath = '/' . implode('/', $this->_aParts) . '/'; + + if (!isset($lang) || (int) $lang <= 0) { + if ((int) $load_lang > 0) { + // load_client is set in frontend/config.php + $lang = (int) $load_lang; + } else { + // get client id from table + cInclude('classes', 'contenido/class.clientslang.php'); + $clCol = new cApiClientLanguageCollection(); + $clCol->setWhere('idclient', $client); + $clCol->query(); + if ($clItem = $clCol->next()) { + $lang = $clItem->get('idlang'); + } + } + } + + $idcat = (int) ModRewrite::getCatIdByUrlPath($this->_sPath); + + if ($idcat == 0) { + // category couldn't resolved + $this->_setError(self::ERROR_CATEGORY); + $idcat = null; + } else { + // unset $this->_sPath if $idcat could set, otherwhise it would be resolved again. + unset($this->_sPath); + } + + ModRewriteDebugger::add($idcat, 'ModRewriteController->_setPathresolverSetting $idcat'); + ModRewriteDebugger::add($this->_sPath, 'ModRewriteController->_setPathresolverSetting $this->_sPath'); + } + + /** + * Sets article id + */ + private function _setIdart() { + global $idcat, $idart, $lang; + + if ($this->_bError) { + return; + } else if ($this->_isRootRequest()) { + return; + } + + $iIdCat = (isset($idcat) && (int) $idcat > 0) ? $idcat : 0; + $iIdArt = (isset($idart) && (int) $idart > 0) ? $idart : 0; + $detectedIdart = 0; + $defaultStartArtName = parent::getConfig('default_startart_name'); + $currArtName = $this->_sArtName; + + // startarticle name in url + if (parent::getConfig('add_startart_name_to_url') && !empty($currArtName)) { + if ($currArtName == $defaultStartArtName) { + // stored articlename is the default one, remove it ModRewrite::getArtIdByWebsafeName() + // will find the real article name + $currArtName = ''; + } + } + + // Last check, before detecting article id + if ($iIdCat == 0 && $iIdArt == 0 && empty($currArtName)) { + // no idcat, idart and article name + // must be a request to root or with language name and/or client name part! + return; + } + + if ($iIdCat > 0 && $iIdArt == 0 && !empty($currArtName)) { + // existing idcat with no idart and with article name + $detectedIdart = (int) ModRewrite::getArtIdByWebsafeName($currArtName, $iIdCat, $lang); + } elseif ($iIdCat > 0 && $iIdArt == 0 && empty($currArtName)) { + if (parent::getConfig('add_startart_name_to_url') && ($currArtName == '' || $defaultStartArtName == '' || $defaultStartArtName == $this->_sArtName)) { + // existing idcat without idart and without article name or with default start article name + cInclude('classes', 'class.article.php'); + $artColl = new ArticleCollection(array('idcat' => $idcat, 'start' => 1)); + if ($artItem = $artColl->startArticle()) { + $detectedIdart = (int) $artItem->get('idart'); + } + } + } elseif ($iIdCat == 0 && $iIdArt == 0 && !empty($currArtName)) { + // no idcat and idart but article name + $detectedIdart = (int) ModRewrite::getArtIdByWebsafeName($currArtName, $iIdCat, $lang); + } + + if ($detectedIdart > 0) { + $idart = $detectedIdart; + } elseif (!empty($currArtName)) { + $this->_setError(self::ERROR_ARTICLE); + } + + ModRewriteDebugger::add($detectedIdart, 'ModRewriteController->_setIdart $detectedIdart'); + } + + /** + * Does post validation of the extracted data. + * + * One main goal of this function is to prevent duplicated content, which could happen, if + * the configuration 'startfromroot' is activated. + */ + private function _postValidation() { + global $idcat, $idart, $client; + + if ($this->_bError || $this->_bRoutingFound || !$this->_hasPartArrayItems()) { + return; + } + + if (parent::getConfig('startfromroot') == 1 && parent::getConfig('prevent_duplicated_content') == 1) { + + // prevention of duplicated content if '/firstcat/' is directly requested! + + $idcat = (isset($idcat) && (int) $idcat > 0) ? $idcat : null; + $idart = (isset($idart) && (int) $idart > 0) ? $idart : null; + + // compose new parameter + $param = ''; + if ($idcat) { + $param .= 'idcat=' . (int) $idcat; + } + if ($idart) { + $param .= ($param !== '') ? '&idart=' . (int) $idart : 'idart=' . (int) $idart; + } + + if ($param == '') { + return; + } + + // set client language, if not set before + mr_setClientLanguageId($client); + + //rebuild url + $url = mr_buildNewUrl(self::FRONT_CONTENT . '?' . $param); + + $aUrlComponents = @parse_url($this->_sIncommingUrl); + $incommingUrl = (isset($aUrlComponents['path'])) ? $aUrlComponents['path'] : ''; + + ModRewriteDebugger::add($url, 'ModRewriteController->_postValidation validate url'); + ModRewriteDebugger::add($incommingUrl, 'ModRewriteController->_postValidation incommingUrl'); + + // now the new generated uri should be identical with the request uri + if ($incommingUrl !== $url) { + $this->_setError(self::ERROR_POST_VALIDATION); + $idcat = null; + } + } + } + + /** + * Parses the url using defined separators + * + * @param string $url Incoming url + * @return string Parsed url + */ + private function _parseUrl($url) { + $this->_sResolvedUrl = $url; + + $oMrUrlUtil = ModRewriteUrlUtil::getInstance(); + $url = $oMrUrlUtil->toContenidoUrl($url); + + return @parse_url($url); + } + + /** + * Returns state of parts property. + * + * @return bool True if $this->_aParts propery contains items + */ + private function _hasPartArrayItems() { + return (!empty($this->_aParts)); + } + + /** + * Checks if current request was a root request. + * + * @return bool + */ + private function _isRootRequest() { + return ($this->_sIncommingUrl == '/' || $this->_sIncommingUrl == ''); + } + + /** + * Sets error code and error flag (everything greater than 0 is an error) + * @param int $errCode + */ + private function _setError($errCode) { + $this->_iError = (int) $errCode; + $this->_bError = ((int) $errCode > 0); + } + } \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewritedebugger.php b/conlite/plugins/mod_rewrite/classes/class.modrewritedebugger.php index e14228e..5e17768 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewritedebugger.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewritedebugger.php @@ -1,74 +1,88 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: class.modrewritedebugger.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -class ModRewriteDebugger -{ - protected static $_bEnabled = false; - - - public static function setEnabled($bEnabled) - { - self::$_bEnabled = (bool) $bEnabled; - } - - public static function add($mVar, $sLabel = '') - { - if (!self::$_bEnabled) { - return; - } - $oDebugger = DebuggerFactory::getDebugger('visible_adv'); - $oDebugger->add($mVar, $sLabel); - } - - public static function getAll() - { - if (!self::$_bEnabled) { - return ''; - } - $oDebugger = DebuggerFactory::getDebugger('visible_adv'); - ob_start(); - $oDebugger->showAll(); - $sOutput = ob_get_contents(); - ob_end_clean(); - return $sOutput; - } - - public static function log($mVar, $sLabel = '') - { - if (!self::$_bEnabled) { - return; - } - $oDebugger = DebuggerFactory::getDebugger('file'); - $oDebugger->show($mVar, $sLabel); - } -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Mod rewrite debugger class. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewriteDebugger { + + /** + * Flag to enable debugger + * @var bool + */ + protected static $_bEnabled = false; + + /** + * Enable debugger setter. + * @param bool $bEnabled + */ + public static function setEnabled($bEnabled) { + self::$_bEnabled = (bool) $bEnabled; + } + + /** + * Adds variable to debugger. + * Wrapper for DebuggerFactory::getDebugger('visible_adv'). + * + * @param mixed $mVar The variable to dump + * @param string $sLabel Describtion for passed $mVar + */ + public static function add($mVar, $sLabel = '') { + if (!self::$_bEnabled) { + return; + } + DebuggerFactory::getDebugger('visible_adv')->add($mVar, $sLabel); + } + + /** + * Returns output of all added variables to debug. + * @return string + */ + public static function getAll() { + if (!self::$_bEnabled) { + return ''; + } + + ob_start(); + DebuggerFactory::getDebugger('visible_adv')->showAll(); + $output = ob_get_contents(); + ob_end_clean(); + return $output; + } + + /** + * Logs variable to debugger. + * Wrapper for cDebug::getDebugger(cDebug::DEBUGGER_FILE). + * + * @param mixed $mVar The variable to log the contents + * @param string $sLabel Describtion for passed $mVar + */ + public static function log($mVar, $sLabel = '') { + if (!self::$_bEnabled) { + return; + } + + DebuggerFactory::getDebugger('file')->show($mVar, $sLabel); + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewritetest.php b/conlite/plugins/mod_rewrite/classes/class.modrewritetest.php index a612309..42f029e 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewritetest.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewritetest.php @@ -1,325 +1,300 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-05-xx - * - * $Id: class.modrewritetest.php 306 2014-03-13 23:03:26Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -class ModRewriteTest -{ - - /** - * @var array Global $cfg array - */ - protected $_aCfg; - - /** - * @var array Global $cfg['tab'] array - */ - protected $_aCfgTab; - - - /** - * @var int Max items to process - */ - protected $_iMaxItems; - - /** - * @var string Actual resolved url - */ - protected $_sResolvedUrl; - - - /** - * @var bool Routing found flag - */ - protected $_bRoutingFound = false; - - - /** - * Constuctor - */ - public function __construct($maxItems) - { - global $cfg; - $this->_aCfg = & $cfg; - $this->_aCfgTab = & $cfg['tab']; - $this->_iMaxItems = $maxItems; - } - - - /** - * Returns resolved URL - * - * @return bool Resolved URL - */ - public function getResolvedUrl() - { - return $this->_sResolvedUrl; - } - - - /** - * Returns flagz about found routing - * - * @return bool - */ - public function getRoutingFoundState() - { - return $this->_bRoutingFound; - } - - - /** - * Fetchs full structure of the installation (categories and articles) and returns it back. - * - * @param int $idclient Client id - * @param int $idlang Language id - * @return array Full structure as follows - * - * $arr[idcat] = Category dataset - * $arr[idcat]['articles'][idart] = Article dataset - * - */ - public function fetchFullStructure($idclient = null, $idlang = null) - { - global $client, $lang; - - $db = new DB_ConLite(); - $db2 = new DB_ConLite(); - - if (!$idclient || (int) $idclient == 0) { - $idclient = $client; - } - if (!$idlang || (int) $idlang == 0) { - $idlang = $lang; - } - - $aTab = $this->_aCfgTab; - - $aStruct = array(); - - $sql = "SELECT - * - FROM - " . $aTab['cat_tree'] . " AS a, - " . $aTab['cat_lang'] . " AS b, - " . $aTab['cat'] . " AS c - WHERE - a.idcat = b.idcat AND - c.idcat = a.idcat AND - c.idclient = '".$idclient."' AND - b.idlang = '".$idlang."' - ORDER BY - a.idtree"; - - $db->query($sql); - - $loop = false; - $counter = 0; - - while ($db->next_record()) { - - if (++$counter == $this->_iMaxItems) { - break; // break this loop - } - - $idcat = $db->f('idcat'); - $aStruct[$idcat] = $db->Record; - $aStruct[$idcat]['articles'] = array(); - - if ($this->_aCfg['is_start_compatible'] == true) { - $compStatement = ' a.is_start DESC, '; - } else { - $compStatement = ''; - } - - $sql2 = "SELECT - * - FROM - ".$aTab['cat_art']." AS a, - ".$aTab['art']." AS b, - ".$aTab['art_lang']." AS c - WHERE - a.idcat = '".$idcat."' AND - b.idart = a.idart AND - c.idart = a.idart AND - c.idlang = '".$idlang."' AND - b.idclient = '".$idclient."' - ORDER BY - " . $compStatement . " - c.title ASC"; - - $db2->query($sql2); - - while ($db2->next_record()) { - $idart = $db2->f('idart'); - $aStruct[$idcat]['articles'][$idart] = $db2->Record; - if (++$counter == $this->_iMaxItems) { - break 2; // break this and also superior loop - } - } - } - - return $aStruct; - } - - - /** - * Creates an URL using passed data. - * - * The result is used to generate seo urls... - * - * @param array $arr Assoziative array with some data as follows: - * - * $arr['idcat'] - * $arr['idart'] - * $arr['idcatart'] - * $arr['idartlang'] - * - * @param string $type Either 'c' or 'a' (category or article). If set to - * 'c' only the parameter idcat will be added to the URL - */ - public function composeURL($arr, $type) - { - $type = ($type == 'a') ? 'a' : 'c'; - - $param = array(); - - if ($type == 'c') { - $param[] = 'idcat=' . $arr['idcat']; - } else { - if (mr_getRequest('idart')) { - $param[] = 'idart=' . $arr['idart']; - } - if (mr_getRequest('idcat')) { - $param[] = 'idcat=' . $arr['idcat']; - } - if (mr_getRequest('idcatart')) { - $param[] = 'idcatart=' . $arr['idcatart']; - } - if (mr_getRequest('idartlang')) { - $param[] = 'idartlang=' . $arr['idartlang']; - } - } - $param[] = 'foo=bar'; - return 'front_content.php?' . implode('&', $param); - } - - - /** - * Resolves variables of an page (idcat, idart, idclient, idlang, etc.) by - * processing passed url using ModRewriteController - * - * @param string $url Url to resolve - * @return array Assoziative array with resolved data - */ - public function resolveUrl($url) - { - // some globals to reset - $aGlobs = array( - 'mr_preprocessedPageError', 'idart', 'idcat' - ); - foreach ($aGlobs as $p => $k) { - if (isset($GLOBALS[$k])) { unset($GLOBALS[$k]); } - } - - $aReturn = array(); - - // create an mod rewrite controller instance and execute processing - $oMRController = new ModRewriteController($url); - $oMRController->execute(); - - if ($oMRController->errorOccured()) { - - // an error occured (idcat and or idart couldn't catched by controller) - $aReturn['mr_preprocessedPageError'] = 1; - - $this->_sResolvedUrl = ''; - $this->_bRoutingFound = false; - - } else { - - // set some global variables - - $this->_sResolvedUrl = $oMRController->getResolvedUrl(); - $this->_bRoutingFound = $oMRController->getRoutingFoundState(); - - if ($oMRController->getClient()) { - $aReturn['client'] = $oMRController->getClient(); - } - - if ($oMRController->getChangeClient()) { - $aReturn['changeclient'] = $oMRController->getChangeClient(); - } - - if ($oMRController->getLang()) { - $aReturn['lang'] = $oMRController->getLang(); - } - - if ($oMRController->getChangeLang()) { - $aReturn['changelang'] = $oMRController->getChangeLang(); - } - - if ($oMRController->getIdArt()) { - $aReturn['idart'] = $oMRController->getIdArt(); - } - - if ($oMRController->getIdCat()) { - $aReturn['idcat'] = $oMRController->getIdCat(); - } - - if ($oMRController->getPath()) { - $aReturn['path'] = $oMRController->getPath(); - } - - } - - return $aReturn; - } - - - /** - * Creates a readable string from passed resolved data array. - * - * @param array Assoziative array with resolved data - * @return string Readable resolved data - */ - public function getReadableResolvedData(array $data) - { - // compose resolved string - $ret = ''; - foreach ($data as $k => $v) { - $ret .= $k . '=' . $v . '; '; - } - $ret = substr($ret, 0, strlen($ret)-2); - return $ret; - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Mod rewrite test class. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewriteTest { + + /** + * Global $cfg array + * @var array + */ + protected $_aCfg; + + /** + * Global $cfg['tab'] array + * @var array + */ + protected $_aCfgTab; + + /** + * Max items to process + * @var int + */ + protected $_iMaxItems; + + /** + * Actual resolved url + * @var string + */ + protected $_sResolvedUrl; + + /** + * Routing found flag + * @var bool + */ + protected $_bRoutingFound = false; + + /** + * Constuctor + * @param int $maxItems Max items (urls to articles/categories) to process + */ + public function __construct($maxItems) { + global $cfg; + $this->_aCfg = & $cfg; + $this->_aCfgTab = & $cfg['tab']; + $this->_iMaxItems = $maxItems; + } + + /** + * Returns resolved URL + * + * @return bool Resolved URL + */ + public function getResolvedUrl() { + return $this->_sResolvedUrl; + } + + /** + * Returns flagz about found routing + * + * @return bool + */ + public function getRoutingFoundState() { + return $this->_bRoutingFound; + } + + /** + * Fetchs full structure of the installation (categories and articles) and returns it back. + * + * @param int $idclient Client id + * @param int $idlang Language id + * @return array Full structure as follows + * + * $arr[idcat] = Category dataset + * $arr[idcat]['articles'][idart] = Article dataset + * + */ + public function fetchFullStructure($idclient = null, $idlang = null) { + global $client, $lang; + + $db = new DB_Contenido(); + $db2 = new DB_Contenido(); + + if (!$idclient || (int) $idclient == 0) { + $idclient = $client; + } + if (!$idlang || (int) $idlang == 0) { + $idlang = $lang; + } + + $aTab = $this->_aCfgTab; + + $aStruct = array(); + + $sql = "SELECT + * + FROM + " . $aTab['cat_tree'] . " AS a, + " . $aTab['cat_lang'] . " AS b, + " . $aTab['cat'] . " AS c + WHERE + a.idcat = b.idcat AND + c.idcat = a.idcat AND + c.idclient = '" . $idclient . "' AND + b.idlang = '" . $idlang . "' + ORDER BY + a.idtree"; + + $db->query($sql); + + $counter = 0; + + while ($db->next_record()) { + + if (++$counter == $this->_iMaxItems) { + break; // break this loop + } + + $idcat = $db->f('idcat'); + $aStruct[$idcat] = $db->Record; + $aStruct[$idcat]['articles'] = array(); + + $sql2 = "SELECT + * + FROM + " . $aTab['cat_art'] . " AS a, + " . $aTab['art'] . " AS b, + " . $aTab['art_lang'] . " AS c + WHERE + a.idcat = '" . $idcat . "' AND + b.idart = a.idart AND + c.idart = a.idart AND + c.idlang = '" . $idlang . "' AND + b.idclient = '" . $idclient . "' + ORDER BY + c.title ASC"; + + $db2->query($sql2); + + while ($db2->next_record()) { + $idart = $db2->f('idart'); + $aStruct[$idcat]['articles'][$idart] = $db2->Record; + if (++$counter == $this->_iMaxItems) { + break 2; // break this and also superior loop + } + } + } + + return $aStruct; + } + + /** + * Creates an URL using passed data. + * + * The result is used to generate seo urls... + * + * @param array $arr Assoziative array with some data as follows: + * + * $arr['idcat'] + * $arr['idart'] + * $arr['idcatart'] + * $arr['idartlang'] + * + * @param string $type Either 'c' or 'a' (category or article). If set to + * 'c' only the parameter idcat will be added to the URL + */ + public function composeURL($arr, $type) { + $type = ($type == 'a') ? 'a' : 'c'; + + $param = array(); + + if ($type == 'c') { + $param[] = 'idcat=' . $arr['idcat']; + } else { + if (mr_getRequest('idart')) { + $param[] = 'idart=' . $arr['idart']; + } + if (mr_getRequest('idcat')) { + $param[] = 'idcat=' . $arr['idcat']; + } + if (mr_getRequest('idcatart')) { + $param[] = 'idcatart=' . $arr['idcatart']; + } + if (mr_getRequest('idartlang')) { + $param[] = 'idartlang=' . $arr['idartlang']; + } + } + $param[] = 'foo=bar'; + return 'front_content.php?' . implode('&', $param); + } + + /** + * Resolves variables of an page (idcat, idart, idclient, idlang, etc.) by + * processing passed url using ModRewriteController + * + * @param string $url Url to resolve + * @return array Assoziative array with resolved data + */ + public function resolveUrl($url) { + // some globals to reset + $aGlobs = array( + 'mr_preprocessedPageError', 'idart', 'idcat' + ); + foreach ($aGlobs as $p => $k) { + if (isset($GLOBALS[$k])) { + unset($GLOBALS[$k]); + } + } + + $aReturn = array(); + + // create an mod rewrite controller instance and execute processing + $oMRController = new ModRewriteController($url); + $oMRController->execute(); + + if ($oMRController->errorOccured()) { + + // an error occured (idcat and or idart couldn't catched by controller) + $aReturn['mr_preprocessedPageError'] = 1; + $aReturn['error'] = $oMRController->getError(); + + $this->_sResolvedUrl = ''; + $this->_bRoutingFound = false; + } else { + + // set some global variables + + $this->_sResolvedUrl = $oMRController->getResolvedUrl(); + $this->_bRoutingFound = $oMRController->getRoutingFoundState(); + + if ($oMRController->getClient()) { + $aReturn['client'] = $oMRController->getClient(); + } + + if ($oMRController->getChangeClient()) { + $aReturn['changeclient'] = $oMRController->getChangeClient(); + } + + if ($oMRController->getLang()) { + $aReturn['lang'] = $oMRController->getLang(); + } + + if ($oMRController->getChangeLang()) { + $aReturn['changelang'] = $oMRController->getChangeLang(); + } + + if ($oMRController->getIdArt()) { + $aReturn['idart'] = $oMRController->getIdArt(); + } + + if ($oMRController->getIdCat()) { + $aReturn['idcat'] = $oMRController->getIdCat(); + } + + if ($oMRController->getPath()) { + $aReturn['path'] = $oMRController->getPath(); + } + } + + return $aReturn; + } + + /** + * Creates a readable string from passed resolved data array. + * + * @param array Assoziative array with resolved data + * @return string Readable resolved data + */ + public function getReadableResolvedData(array $data) { + // compose resolved string + $ret = ''; + foreach ($data as $k => $v) { + $ret .= $k . '=' . $v . '; '; + } + $ret = substr($ret, 0, strlen($ret) - 2); + return $ret; + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewriteurlstack.php b/conlite/plugins/mod_rewrite/classes/class.modrewriteurlstack.php index 4b3b16e..cc24709 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewriteurlstack.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewriteurlstack.php @@ -1,343 +1,314 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-09-10 - * - * $Id: class.modrewriteurlstack.php 306 2014-03-13 23:03:26Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Mod rewrite url stack class. Provides features to collect urls and to get the - * pretty path and names of categories/articles at one go. - * - * Main goal of this class is to collect urls and to get the urlpath and urlname - * of the related categories/articles at one go. This will reduce the queries - * against the database. - * Therefore the full advantage will be taken by rewriting the urls at codeoutput - * in front_content.php, where you will be able to collect all urls at once... - * - * Usage: - * - * // get the instance - * $oMRUrlStack = ModRewriteUrlStack::getInstance(); - * - * // add several urls to fill the stack - * $oMRUrlStack->add('front_content.php?idcat=123'); - * $oMRUrlStack->add('front_content.php?idart=321'); - * $oMRUrlStack->add('front_content.php?idcatart=213'); - * $oMRUrlStack->add('front_content.php?idcatlang=213'); - * $oMRUrlStack->add('front_content.php?idartlang=312'); - * - * // now the first call will get the pretty path and names from database at one go - * $aPrettyParts = $oMRUrlStack->getPrettyUrlParts('front_content.php?idcat=123'); - * echo $aPrettyParts['urlpath']; // something like 'Main-category-name/Category-name/Another-category-name/' - * echo $aPrettyParts['urlname']; // something like 'Name-of-an-article' - * - * - * @author Murat Purc - * @package Contenido Backend plugins - * @subpackage ModRewrite - */ -class ModRewriteUrlStack -{ - - /** - * Self instance - * - * @var ModRewriteUrlStack - */ - private static $_instance; - - /** - * Database object - * - * @var DB_ConLite - */ - private $_oDb; - - /** - * Array for urls - * - * @var array - */ - private $_aUrls = array(); - - /** - * Url stack array - * - * @var array - */ - private $_aStack = array(); - - /** - * Contenido related parameter array - * - * @var array - */ - private $_aConParams = array( - 'idcat' => 1, 'idart' => 1, 'lang' => 1, 'idcatlang' => 1, 'idcatart' => 1, 'idartlang' => 1 - ); - - /** - * Database tables array - * - * @var array - */ - private $_aTab; - - /** - * Language id - * - * @var int - */ - private $_idLang; - - - /** - * Constructor, sets some properties. - */ - private function __construct() - { - global $cfg, $lang; - $this->_oDb = new DB_ConLite(); - $this->_aTab = $cfg['tab']; - $this->_idLang = $lang; - } - - - /** - * Returns a instance of ModRewriteUrlStack (singleton implementation) - * - * @return ModRewriteUrlStack - */ - public static function getInstance() - { - if (self::$_instance == null) { - self::$_instance = new ModRewriteUrlStack(); - } - return self::$_instance; - } - - - /** - * Adds an url to the stack - * - * @param string Url, like front_content.php?idcat=123... - */ - public function add($url) - { - $url = ModRewrite::urlPreClean($url); - if (isset($this->_aUrls[$url])) { - return; - } - - $aUrl = $this->_extractUrl($url); - - // cleanup parameter - foreach ($aUrl['params'] as $p => $v) { - if (!isset($this->_aConParams[$p])) { - unset($aUrl['params'][$p]); - } else { - $aUrl['params'][$p] = (int) $v; - } - } - - // add language id, if not available - if ((int) mr_arrayValue($aUrl['params'], 'lang') == 0) { - $aUrl['params']['lang'] = $this->_idLang; - } - - $sStackId = $this->_makeStackId($aUrl['params']); - $this->_aUrls[$url] = $sStackId; - $this->_aStack[$sStackId] = array('params' => $aUrl['params']); - } - - - /** - * Returns the pretty urlparts (only category path an article name) of the - * desired url. - * - * @param string Url, like front_content.php?idcat=123... - * @return array Assoziative array like - * - * $arr['urlpath'] - * $arr['urlname'] - * - */ - public function getPrettyUrlParts($url) - { - $url = ModRewrite::urlPreClean($url); - if (!isset($this->_aUrls[$url])) { - $this->add($url); - } - - $sStackId = $this->_aUrls[$url]; - if (!isset($this->_aStack[$sStackId]['urlpath'])) { - $this->_chunkSetPrettyUrlParts(); - } - $aPretty = array( - 'urlpath' => $this->_aStack[$sStackId]['urlpath'], - 'urlname' => $this->_aStack[$sStackId]['urlname'] - ); - return $aPretty; - } - - - /** - * Extracts passed url using parse_urla and adds also the 'params' array to it - * - * @param string Url, like front_content.php?idcat=123... - * @return array Components containing result of parse_url with additional - * 'params' array - */ - private function _extractUrl($url) - { - $aUrl = @parse_url($url); - if (isset($aUrl['query'])) { - $aUrl['query'] = str_replace('&', '&', $aUrl['query']); - parse_str($aUrl['query'], $aUrl['params']); - } - if (!isset($aUrl['params']) && !is_array($aUrl['params'])) { - $aUrl['params'] = array(); - } - return $aUrl; - } - - - /** - * Extracts article or category related parameter from passed params array - * and generates an identifier. - * - * @param array $aParams Parameter array - * @return string Composed stack id - */ - private function _makeStackId(array $aParams) - { - # idcatart - if ((int) mr_arrayValue($aParams, 'idart') > 0) { - $sStackId = 'idart_' . $aParams['idart'] . '_lang_' . $aParams['lang']; - } elseif ((int) mr_arrayValue($aParams, 'idartlang') > 0) { - $sStackId = 'idartlang_' . $aParams['idartlang']; - } elseif ((int) mr_arrayValue($aParams, 'idcatart') > 0) { - $sStackId = 'idcatart_' . $aParams['idcatart'] . '_lang_' . $aParams['lang']; - } elseif ((int) mr_arrayValue($aParams, 'idcat') > 0) { - $sStackId = 'idcat_' . $aParams['idcat'] . '_lang_' . $aParams['lang']; - } elseif ((int) mr_arrayValue($aParams, 'idcatlang') > 0) { - $sStackId = 'idcatlang_' . $aParams['idcatlang']; - } else { - $sStackId = 'lang_' . $aParams['lang']; - } - return $sStackId; - } - - - /** - * Main function to get the urlparts of urls. - * - * Composes the query by looping thru stored but non processed urls, executes - * the query and adds the (urlpath and urlname) result to the stack. - */ - private function _chunkSetPrettyUrlParts() - { - // collect stack parameter to get urlpath and urlname - $aStack = array(); - foreach ($this->_aStack as $stackId => $item) { - if (!isset($item['urlpath'])) { - // pretty url is to create - $aStack[$stackId] = $item; - } - } - - // now, it's time to compose the where clause of the query - $sWhere = ''; - foreach ($aStack as $stackId => $item) { - $aP = $item['params']; - if ((int) mr_arrayValue($aP, 'idart') > 0) { - $sWhere .= '(al.idart = ' . $aP['idart'] . ' AND al.idlang = ' . $aP['lang'] . ') OR '; - } elseif ((int) mr_arrayValue($aP, 'idartlang') > 0) { - $sWhere .= '(al.idartlang = ' . $aP['idartlang'] . ') OR '; - } elseif ((int) mr_arrayValue($aP, 'idcat') > 0) { - $sWhere .= '(cl.idcat = ' . $aP['idcat'] . ' AND cl.idlang = ' . $aP['lang'] . ' AND cl.startidartlang = al.idartlang) OR '; - } elseif ((int) mr_arrayValue($aP, 'idcatart') > 0) { - $sWhere .= '(ca.idcatart = ' . $aP['idcatart'] . ' AND ca.idart = al.idart AND al.idlang = ' . $aP['lang'] . ') OR '; - } elseif ((int) mr_arrayValue($aP, 'idcatlang') > 0) { - $sWhere .= '(cl.idcatlang = ' . $aP['idcatlang'] . ' AND cl.startidartlang = al.idartlang) OR '; - } - } - if ($sWhere == '') { - return; - } - $sWhere = substr($sWhere, 0, -4); - $sWhere = str_replace(' OR ', " OR \n", $sWhere); - - // compose query and execute it - $sql = <<_aTab['art_lang']} AS al, {$this->_aTab['cat_lang']} AS cl, {$this->_aTab['cat_art']} AS ca -WHERE - al.idart = ca.idart AND - ca.idcat = cl.idcat AND - al.idlang = cl.idlang AND - ( $sWhere ) -SQL; - ModRewriteDebugger::add($sql, 'ModRewriteUrlStack->_chunkSetPrettyUrlParts() $sql'); - - $aNewStack = array(); - - // create array of fields, which are to reduce step by step from record set below - $aFields = array('', 'idart', 'idartlang', 'idcatart', 'idcat'); - - $this->_oDb->query($sql); - while ($this->_oDb->next_record()) { - $aRS = $this->_oDb->Record; - - // loop thru fields array - foreach ($aFields as $field) { - if (isset($aRS[$field])) { - // reduce existing field - unset($aRS[$field]); - } - $rsStackID = $this->_makeStackId($aRS); - if (isset($aStack[$rsStackID])) { - // matching stack entry found, add urlpath and urlname to the new stack - $aNewStack[$rsStackID]['urlpath'] = $aRS['urlpath']; - $aNewStack[$rsStackID]['urlname'] = $aRS['urlname']; - break; - } - } - } - ModRewriteDebugger::add($aNewStack, 'ModRewriteUrlStack->_chunkSetPrettyUrlParts() $aNewStack'); - - // merge stack data - $this->_aStack = array_merge($this->_aStack, $aNewStack); - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Mod rewrite url stack class. Provides features to collect urls and to get the + * pretty path and names of categories/articles at one go. + * + * Main goal of this class is to collect urls and to get the urlpath and urlname + * of the related categories/articles at one go. This will reduce the queries + * against the database. + * Therefore the full advantage will be taken by rewriting the urls at codeoutput + * in front_content.php, where you will be able to collect all urls at once... + * + * Usage: + * + * // get the instance + * $oMRUrlStack = ModRewriteUrlStack::getInstance(); + * + * // add several urls to fill the stack + * $oMRUrlStack->add('front_content.php?idcat=123'); + * $oMRUrlStack->add('front_content.php?idart=321'); + * $oMRUrlStack->add('front_content.php?idcatart=213'); + * $oMRUrlStack->add('front_content.php?idcatlang=213'); + * $oMRUrlStack->add('front_content.php?idartlang=312'); + * + * // now the first call will get the pretty path and names from database at one go + * $aPrettyParts = $oMRUrlStack->getPrettyUrlParts('front_content.php?idcat=123'); + * echo $aPrettyParts['urlpath']; // something like 'Main-category-name/Category-name/Another-category-name/' + * echo $aPrettyParts['urlname']; // something like 'Name-of-an-article' + * + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewriteUrlStack { + + /** + * Self instance + * + * @var ModRewriteUrlStack + */ + private static $_instance; + + /** + * Database object + * + * @var DB_Contenido + */ + private $_oDb; + + /** + * Array for urls + * + * @var array + */ + private $_aUrls = array(); + + /** + * Url stack array + * + * @var array + */ + private $_aStack = array(); + + /** + * CONTENIDO related parameter array + * + * @var array + */ + private $_aConParams = array( + 'idcat' => 1, 'idart' => 1, 'lang' => 1, 'idcatlang' => 1, 'idcatart' => 1, 'idartlang' => 1 + ); + + /** + * Database tables array + * + * @var array + */ + private $_aTab; + + /** + * Language id + * + * @var int + */ + private $_idLang; + + /** + * Constructor, sets some properties. + */ + private function __construct() { + global $cfg, $lang; + $this->_oDb = new DB_Contenido(); + $this->_aTab = $cfg['tab']; + $this->_idLang = $lang; + } + + /** + * Returns a instance of ModRewriteUrlStack (singleton implementation) + * + * @return ModRewriteUrlStack + */ + public static function getInstance() { + if (self::$_instance == null) { + self::$_instance = new ModRewriteUrlStack(); + } + return self::$_instance; + } + + /** + * Adds an url to the stack + * + * @param string Url, like front_content.php?idcat=123... + */ + public function add($url) { + $url = ModRewrite::urlPreClean($url); + if (isset($this->_aUrls[$url])) { + return; + } + + $aUrl = $this->_extractUrl($url); + + // cleanup parameter + foreach ($aUrl['params'] as $p => $v) { + if (!isset($this->_aConParams[$p])) { + unset($aUrl['params'][$p]); + } else { + $aUrl['params'][$p] = (int) $v; + } + } + + // add language id, if not available + if ((int) mr_arrayValue($aUrl['params'], 'lang') == 0) { + $aUrl['params']['lang'] = $this->_idLang; + } + + $sStackId = $this->_makeStackId($aUrl['params']); + $this->_aUrls[$url] = $sStackId; + $this->_aStack[$sStackId] = array('params' => $aUrl['params']); + } + + /** + * Returns the pretty urlparts (only category path an article name) of the + * desired url. + * + * @param string Url, like front_content.php?idcat=123... + * @return array Assoziative array like + * + * $arr['urlpath'] + * $arr['urlname'] + * + */ + public function getPrettyUrlParts($url) { + $url = ModRewrite::urlPreClean($url); + if (!isset($this->_aUrls[$url])) { + $this->add($url); + } + + $sStackId = $this->_aUrls[$url]; + if (!isset($this->_aStack[$sStackId]['urlpath'])) { + $this->_chunkSetPrettyUrlParts(); + } + $aPretty = array( + 'urlpath' => $this->_aStack[$sStackId]['urlpath'], + 'urlname' => $this->_aStack[$sStackId]['urlname'] + ); + return $aPretty; + } + + /** + * Extracts passed url using parse_urla and adds also the 'params' array to it + * + * @param string Url, like front_content.php?idcat=123... + * @return array Components containing result of parse_url with additional + * 'params' array + */ + private function _extractUrl($url) { + $aUrl = @parse_url($url); + if (isset($aUrl['query'])) { + $aUrl['query'] = str_replace('&', '&', $aUrl['query']); + parse_str($aUrl['query'], $aUrl['params']); + } + if (!isset($aUrl['params']) && !is_array($aUrl['params'])) { + $aUrl['params'] = array(); + } + return $aUrl; + } + + /** + * Extracts article or category related parameter from passed params array + * and generates an identifier. + * + * @param array $aParams Parameter array + * @return string Composed stack id + */ + private function _makeStackId(array $aParams) { + # idcatart + if ((int) mr_arrayValue($aParams, 'idart') > 0) { + $sStackId = 'idart_' . $aParams['idart'] . '_lang_' . $aParams['lang']; + } elseif ((int) mr_arrayValue($aParams, 'idartlang') > 0) { + $sStackId = 'idartlang_' . $aParams['idartlang']; + } elseif ((int) mr_arrayValue($aParams, 'idcatart') > 0) { + $sStackId = 'idcatart_' . $aParams['idcatart'] . '_lang_' . $aParams['lang']; + } elseif ((int) mr_arrayValue($aParams, 'idcat') > 0) { + $sStackId = 'idcat_' . $aParams['idcat'] . '_lang_' . $aParams['lang']; + } elseif ((int) mr_arrayValue($aParams, 'idcatlang') > 0) { + $sStackId = 'idcatlang_' . $aParams['idcatlang']; + } else { + $sStackId = 'lang_' . $aParams['lang']; + } + return $sStackId; + } + + /** + * Main function to get the urlparts of urls. + * + * Composes the query by looping thru stored but non processed urls, executes + * the query and adds the (urlpath and urlname) result to the stack. + */ + private function _chunkSetPrettyUrlParts() { + // collect stack parameter to get urlpath and urlname + $aStack = array(); + foreach ($this->_aStack as $stackId => $item) { + if (!isset($item['urlpath'])) { + // pretty url is to create + $aStack[$stackId] = $item; + } + } + + // now, it's time to compose the where clause of the query + $sWhere = ''; + foreach ($aStack as $stackId => $item) { + $aP = $item['params']; + if ((int) mr_arrayValue($aP, 'idart') > 0) { + $sWhere .= '(al.idart = ' . $aP['idart'] . ' AND al.idlang = ' . $aP['lang'] . ') OR '; + } elseif ((int) mr_arrayValue($aP, 'idartlang') > 0) { + $sWhere .= '(al.idartlang = ' . $aP['idartlang'] . ') OR '; + } elseif ((int) mr_arrayValue($aP, 'idcat') > 0) { + $sWhere .= '(cl.idcat = ' . $aP['idcat'] . ' AND cl.idlang = ' . $aP['lang'] . ' AND cl.startidartlang = al.idartlang) OR '; + } elseif ((int) mr_arrayValue($aP, 'idcatart') > 0) { + $sWhere .= '(ca.idcatart = ' . $aP['idcatart'] . ' AND ca.idart = al.idart AND al.idlang = ' . $aP['lang'] . ') OR '; + } elseif ((int) mr_arrayValue($aP, 'idcatlang') > 0) { + $sWhere .= '(cl.idcatlang = ' . $aP['idcatlang'] . ' AND cl.startidartlang = al.idartlang) OR '; + } + } + if ($sWhere == '') { + return; + } + $sWhere = substr($sWhere, 0, -4); + $sWhere = str_replace(' OR ', " OR \n", $sWhere); + + // compose query and execute it + $sql = <<_aTab['art_lang']} AS al, {$this->_aTab['cat_lang']} AS cl, {$this->_aTab['cat_art']} AS ca +WHERE + al.idart = ca.idart AND + ca.idcat = cl.idcat AND + al.idlang = cl.idlang AND + ( $sWhere ) +SQL; + ModRewriteDebugger::add($sql, 'ModRewriteUrlStack->_chunkSetPrettyUrlParts() $sql'); + + $aNewStack = array(); + + // create array of fields, which are to reduce step by step from record set below + $aFields = array('', 'idart', 'idartlang', 'idcatart', 'idcat'); + + $this->_oDb->query($sql); + while ($this->_oDb->next_record()) { + $aRS = $this->_oDb->Record; + + // loop thru fields array + foreach ($aFields as $field) { + if (isset($aRS[$field])) { + // reduce existing field + unset($aRS[$field]); + } + $rsStackID = $this->_makeStackId($aRS); + if (isset($aStack[$rsStackID])) { + // matching stack entry found, add urlpath and urlname to the new stack + $aNewStack[$rsStackID]['urlpath'] = $aRS['urlpath']; + $aNewStack[$rsStackID]['urlname'] = $aRS['urlname']; + break; + } + } + } + ModRewriteDebugger::add($aNewStack, 'ModRewriteUrlStack->_chunkSetPrettyUrlParts() $aNewStack'); + + // merge stack data + $this->_aStack = array_merge($this->_aStack, $aNewStack); + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/class.modrewriteurlutil.php b/conlite/plugins/mod_rewrite/classes/class.modrewriteurlutil.php index a1bcc13..970e0a9 100644 --- a/conlite/plugins/mod_rewrite/classes/class.modrewriteurlutil.php +++ b/conlite/plugins/mod_rewrite/classes/class.modrewriteurlutil.php @@ -1,342 +1,306 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-05-xx - * - * $Id: class.modrewriteurlutil.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Mod Rewrite url utility class. Handles convertion of Urls from contenido core - * based url composition pattern to AMR (Advanced Mod Rewrite) url composition - * pattern and vice versa. - * - * @author Murat Purc - * @package Contenido Backend plugins - * @subpackage ModRewrite - */ -class ModRewriteUrlUtil extends ModRewriteBase -{ - - /** - * Self instance (singleton implementation) - * @var ModRewriteUrlUtil - */ - private static $_instance; - - /** - * Contenido category word separator - * @var string - */ - private $_catWordSep = '-'; - - /** - * AMR category word separator - * @var string - */ - private $_mrCatWordSep; - - /** - * Contenido category separator - * @var string - */ - private $_catSep = '/'; - - /** - * AMR category separator - * @var string - */ - private $_mrCatSep; - - /** - * Contenido article separator - * @var string - */ - private $_artSep = '/'; - - /** - * AMR article separator - * @var string - */ - private $_mrArtSep; - - /** - * Contenido article word separator - * @var string - */ - private $_artWordSep = '-'; - - /** - * AMR article word separator - * @var string - */ - private $_mrArtWordSep; - - /** - * AMR extension used for articlenames (e. g. .html) - * @var string - */ - private $_mrExt; - - - /** - * Constructor, sets some AMR configuration related properties - */ - private function __construct() - { - $aCfg = parent::getConfig(); - $this->_mrCatWordSep = $aCfg['category_word_seperator']; - $this->_mrCatSep = $aCfg['category_seperator']; - $this->_mrArtSep = $aCfg['article_seperator']; - $this->_mrArtWordSep = $aCfg['article_word_seperator']; - $this->_mrExt = $aCfg['file_extension']; - } - - private function __clone() - { - } - - /** - * Returns self instance (singleton pattern) - * @return ModRewriteUrlUtil - */ - public static function getInstance() - { - if (self::$_instance == null) { - self::$_instance = new ModRewriteUrlUtil(); - } - return self::$_instance; - } - - - /** - * Converts passed AMR url path to Contenido url path. - * - * @param string $urlPath AMR url path - * @return string Contenido url path - */ - public function toContenidoUrlPath($urlPath) - { - $newUrlPath = $this->_toUrlPath( - $urlPath, $this->_mrCatSep, $this->_catSep, $this->_mrCatWordSep, $this->_catWordSep, - $this->_mrArtSep, $this->_artSep - ); - return $newUrlPath; - } - - /** - * Converts passed Contenido url path to AMR url path. - * - * @param string $urlPath Contenido url path - * @return string AMR url path - */ - public function toModRewriteUrlPath($urlPath) - { - $newUrlPath = $this->_toUrlPath( - $urlPath, $this->_catSep, $this->_mrCatSep, $this->_catWordSep, $this->_mrCatWordSep, - $this->_artSep, $this->_mrArtSep - ); - return $newUrlPath; - } - - - /** - * Converts passed url path to a another url path (Contenido to AMR and vice versa). - * - * @param string $urlPath Source url path - * @param string $fromCatSep Source category seperator - * @param string $toCatSep Destination category seperator - * @param string $fromCatWordSep Source category word seperator - * @param string $toCatWordSep Destination category word seperator - * @param string $fromArtSep Source article seperator - * @param string $toArtSep Destination article seperator - * @return string Destination url path - */ - private function _toUrlPath($urlPath, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, - $fromArtSep, $toArtSep) - { - if ((string) $urlPath == '') { - return $urlPath; - } - - if (substr($urlPath, -1) == $fromArtSep) { - $urlPath = substr($urlPath, 0, -1) . '{TAS}'; - } - - // pre replace category word seperator and category seperator - $urlPath = str_replace($fromCatWordSep, '{CWS}', $urlPath); - $urlPath = str_replace($fromCatSep, '{CS}', $urlPath); - - // replace category word seperator - $urlPath = str_replace('{CWS}', $toCatWordSep, $urlPath); - $urlPath = str_replace('{CS}', $toCatSep, $urlPath); - - $urlPath = str_replace('{TAS}', $toArtSep, $urlPath); - - return $urlPath; - } - - - /** - * Converts passed AMR url name to Contenido url name. - * - * @param string $urlName AMR url name - * @return string Contenido url name - */ - public function toContenidoUrlName($urlName) - { - $newUrlName = $this->_toUrlName($urlName, $this->_mrArtWordSep, $this->_artWordSep); - return $newUrlName; - } - - - /** - * Converts passed Contenido url name to AMR url name. - * - * @param string $urlName Contenido url name - * @return string AMR url name - */ - public function toModRewriteUrlName($urlName) - { - $newUrlName = $this->_toUrlName($urlName, $this->_artWordSep, $this->_mrArtWordSep); - return $newUrlName; - } - - - /** - * Converts passed url name to a another url name (Contenido to AMR and vice versa). - * - * @param string $urlName Source url name - * @param string $fromArtWordSep Source article word seperator - * @param string $toArtWordSep Destination article word seperator - * @return string Destination url name - */ - private function _toUrlName($urlName, $fromArtWordSep, $toArtWordSep) - { - if ((string) $urlName == '') { - return $urlName; - } - - $urlName = str_replace($this->_mrExt, '{EXT}', $urlName); - - // replace article word seperator - $urlName = str_replace($fromArtWordSep, $toArtWordSep, $urlName); - - $urlName = str_replace('{EXT}', $this->_mrExt, $urlName); - - return $urlName; - } - - - /** - * Converts passed AMR url to Contenido url. - * - * @param string $url AMR url - * @return string Contenido url - */ - public function toContenidoUrl($url) - { - if (strpos($url, $this->_mrExt) === false) { - $newUrl = $this->toContenidoUrlPath($url); - } else { - // replace category word and article word seperator - $path = substr($url, 0, strrpos($url, $this->_mrArtSep) + 1); - $name = substr($url, strrpos($url, $this->_mrArtSep) + 1); - $newUrl = $this->toContenidoUrlPath($path) . $this->toContenidoUrlName($name); - } - return $newUrl; - } - - - /** - * Converts passed AMR url to Contenido url. - * - * @param string $url AMR url - * @return string Contenido url - */ - public function toModRewriteUrl($url) - { - if (strpos($url, $this->_mrExt) === false) { - $newUrl = $this->toModRewriteUrlPath($url); - } else { - // replace category word and article word seperator - $path = substr($url, 0, strrpos($url, $this->_artSep) + 1); - $name = substr($url, strrpos($url, $this->_artSep) + 1); - $newUrl = $this->toModRewriteUrlPath($path) . $this->toModRewriteUrlName($name); - } - return $newUrl; - } - - - /** - * Converts passed url to a another url (Contenido to AMR and vice versa). - * - * @param string $urlPath Source url path - * @param string $fromCatSep Source category seperator - * @param string $toCatSep Destination category seperator - * @param string $fromCatWordSep Source category word seperator - * @param string $toCatWordSep Destination category word seperator - * @param string $fromArtSep Source article seperator - * @param string $toArtSep Destination article seperator - * @param string $fromArtWordSep Source article word seperator - * @param string $toArtWordSep Destination article word seperator - * @return string Destination url - * - * @deprecated No more used, is to delete - */ - private function _toUrl($url, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, - $fromArtSep, $toArtSep, $fromArtWordSep, $toArtWordSep) - { - if ((string) $url == '') { - return $url; - } - - $url = str_replace($this->_mrExt, '{EXT}', $url); - - // replace category seperator - $url = str_replace($fromCatSep, $toCatSep, $url); - - // replace article seperator - $url = str_replace($fromArtSep, $toArtSep, $url); - - $url = str_replace('{EXT}', $this->_mrExt, $url); - - if (strpos($url, $this->_mrExt) === false) { - // no articlename, replace category word seperator - $url = str_replace($fromCatWordSep, $toCatWordSep, $url); - } else { - // replace category word and article word seperator - $path = str_replace($fromCatWordSep, $toCatWordSep, substr($url, 0, strrpos($url, $toArtSep) + 1)); - $file = str_replace($fromArtWordSep, $toArtWordSep, substr($url, strrpos($url, $toArtSep) + 1)); - $url = $path . $file; - } - - return $url; - } - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Mod Rewrite url utility class. Handles convertion of Urls from CONTENIDO core + * based url composition pattern to AMR (Advanced Mod Rewrite) url composition + * pattern and vice versa. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewriteUrlUtil extends ModRewriteBase { + + /** + * Self instance (singleton implementation) + * @var ModRewriteUrlUtil + */ + private static $_instance; + + /** + * CONTENIDO category word separator + * @var string + */ + private $_catWordSep = '-'; + + /** + * AMR category word separator + * @var string + */ + private $_mrCatWordSep; + + /** + * CONTENIDO category separator + * @var string + */ + private $_catSep = '/'; + + /** + * AMR category separator + * @var string + */ + private $_mrCatSep; + + /** + * CONTENIDO article separator + * @var string + */ + private $_artSep = '/'; + + /** + * AMR article separator + * @var string + */ + private $_mrArtSep; + + /** + * CONTENIDO article word separator + * @var string + */ + private $_artWordSep = '-'; + + /** + * AMR article word separator + * @var string + */ + private $_mrArtWordSep; + + /** + * AMR extension used for articlenames (e. g. .html) + * @var string + */ + private $_mrExt; + + /** + * Constructor, sets some AMR configuration related properties + */ + private function __construct() { + $aCfg = parent::getConfig(); + $this->_mrCatWordSep = $aCfg['category_word_seperator']; + $this->_mrCatSep = $aCfg['category_seperator']; + $this->_mrArtSep = $aCfg['article_seperator']; + $this->_mrArtWordSep = $aCfg['article_word_seperator']; + $this->_mrExt = $aCfg['file_extension']; + } + + /** + * Prevent cloning + */ + private function __clone() { + + } + + /** + * Returns self instance (singleton pattern) + * @return ModRewriteUrlUtil + */ + public static function getInstance() { + if (self::$_instance == null) { + self::$_instance = new ModRewriteUrlUtil(); + } + return self::$_instance; + } + + /** + * Converts passed AMR url path to CONTENIDO url path. + * + * @param string $urlPath AMR url path + * @return string CONTENIDO url path + */ + public function toContenidoUrlPath($urlPath) { + $newUrlPath = $this->_toUrlPath( + $urlPath, $this->_mrCatSep, $this->_catSep, $this->_mrCatWordSep, $this->_catWordSep, $this->_mrArtSep, $this->_artSep + ); + return $newUrlPath; + } + + /** + * Converts passed CONTENIDO url path to AMR url path. + * + * @param string $urlPath CONTENIDO url path + * @return string AMR url path + */ + public function toModRewriteUrlPath($urlPath) { + $newUrlPath = $this->_toUrlPath( + $urlPath, $this->_catSep, $this->_mrCatSep, $this->_catWordSep, $this->_mrCatWordSep, $this->_artSep, $this->_mrArtSep + ); + return $newUrlPath; + } + + /** + * Converts passed url path to a another url path (CONTENIDO to AMR and vice versa). + * + * @param string $urlPath Source url path + * @param string $fromCatSep Source category seperator + * @param string $toCatSep Destination category seperator + * @param string $fromCatWordSep Source category word seperator + * @param string $toCatWordSep Destination category word seperator + * @param string $fromArtSep Source article seperator + * @param string $toArtSep Destination article seperator + * @return string Destination url path + */ + private function _toUrlPath($urlPath, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, $fromArtSep, $toArtSep) { + if ((string) $urlPath == '') { + return $urlPath; + } + + if (substr($urlPath, -1) == $fromArtSep) { + $urlPath = substr($urlPath, 0, -1) . '{TAS}'; + } + + // pre replace category word seperator and category seperator + $urlPath = str_replace($fromCatWordSep, '{CWS}', $urlPath); + $urlPath = str_replace($fromCatSep, '{CS}', $urlPath); + + // replace category word seperator + $urlPath = str_replace('{CWS}', $toCatWordSep, $urlPath); + $urlPath = str_replace('{CS}', $toCatSep, $urlPath); + + $urlPath = str_replace('{TAS}', $toArtSep, $urlPath); + + return $urlPath; + } + + /** + * Converts passed AMR url name to CONTENIDO url name. + * + * @param string $urlName AMR url name + * @return string CONTENIDO url name + */ + public function toContenidoUrlName($urlName) { + $newUrlName = $this->_toUrlName($urlName, $this->_mrArtWordSep, $this->_artWordSep); + return $newUrlName; + } + + /** + * Converts passed CONTENIDO url name to AMR url name. + * + * @param string $urlName CONTENIDO url name + * @return string AMR url name + */ + public function toModRewriteUrlName($urlName) { + $newUrlName = $this->_toUrlName($urlName, $this->_artWordSep, $this->_mrArtWordSep); + return $newUrlName; + } + + /** + * Converts passed url name to a another url name (CONTENIDO to AMR and vice versa). + * + * @param string $urlName Source url name + * @param string $fromArtWordSep Source article word seperator + * @param string $toArtWordSep Destination article word seperator + * @return string Destination url name + */ + private function _toUrlName($urlName, $fromArtWordSep, $toArtWordSep) { + if ((string) $urlName == '') { + return $urlName; + } + + $urlName = str_replace($this->_mrExt, '{EXT}', $urlName); + + // replace article word seperator + $urlName = str_replace($fromArtWordSep, $toArtWordSep, $urlName); + + $urlName = str_replace('{EXT}', $this->_mrExt, $urlName); + + return $urlName; + } + + /** + * Converts passed AMR url to CONTENIDO url. + * + * @param string $url AMR url + * @return string CONTENIDO url + */ + public function toContenidoUrl($url) { + if (strpos($url, $this->_mrExt) === false) { + $newUrl = $this->toContenidoUrlPath($url); + } else { + // replace category word and article word seperator + $path = substr($url, 0, strrpos($url, $this->_mrArtSep) + 1); + $name = substr($url, strrpos($url, $this->_mrArtSep) + 1); + $newUrl = $this->toContenidoUrlPath($path) . $this->toContenidoUrlName($name); + } + return $newUrl; + } + + /** + * Converts passed AMR url to CONTENIDO url. + * + * @param string $url AMR url + * @return string CONTENIDO url + */ + public function toModRewriteUrl($url) { + if (strpos($url, $this->_mrExt) === false) { + $newUrl = $this->toModRewriteUrlPath($url); + } else { + // replace category word and article word seperator + $path = substr($url, 0, strrpos($url, $this->_artSep) + 1); + $name = substr($url, strrpos($url, $this->_artSep) + 1); + $newUrl = $this->toModRewriteUrlPath($path) . $this->toModRewriteUrlName($name); + } + return $newUrl; + } + + /** + * Converts passed url to a another url (CONTENIDO to AMR and vice versa). + * + * @param string $url Source url + * @param string $fromCatSep Source category seperator + * @param string $toCatSep Destination category seperator + * @param string $fromCatWordSep Source category word seperator + * @param string $toCatWordSep Destination category word seperator + * @param string $fromArtSep Source article seperator + * @param string $toArtSep Destination article seperator + * @param string $fromArtWordSep Source article word seperator + * @param string $toArtWordSep Destination article word seperator + * @return string Destination url + * + * @deprecated No more used, is to delete + */ + private function _toUrl($url, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, $fromArtSep, $toArtSep, $fromArtWordSep, $toArtWordSep) { + if ((string) $url == '') { + return $url; + } + + $url = str_replace($this->_mrExt, '{EXT}', $url); + + // replace category seperator + $url = str_replace($fromCatSep, $toCatSep, $url); + + // replace article seperator + $url = str_replace($fromArtSep, $toArtSep, $url); + + $url = str_replace('{EXT}', $this->_mrExt, $url); + + if (strpos($url, $this->_mrExt) === false) { + // no articlename, replace category word seperator + $url = str_replace($fromCatWordSep, $toCatWordSep, $url); + } else { + // replace category word and article word seperator + $path = str_replace($fromCatWordSep, $toCatWordSep, substr($url, 0, strrpos($url, $toArtSep) + 1)); + $file = str_replace($fromArtWordSep, $toArtWordSep, substr($url, strrpos($url, $toArtSep) + 1)); + $url = $path . $file; + } + + return $url; + } + } \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_content_controller.php b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_content_controller.php index 871b1e0..ddba14d 100644 --- a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_content_controller.php +++ b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_content_controller.php @@ -1,407 +1,426 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: class.modrewrite_content_controller.php 312 2014-06-18 11:01:08Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -plugin_include( - 'mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php' -); - - -class ModRewrite_ContentController extends ModRewrite_ControllerAbstract -{ - - public function indexAction() - { - // donut - } - - public function saveAction() - { - $bDebug = $this->getProperty('bDebug'); - $aSeparator = $this->getProperty('aSeparator'); - $aWordSeparator = $this->getProperty('aWordSeparator'); - $routingSeparator = $this->getProperty('routingSeparator'); - - $bError = false; - $aMR = array(); - - $request = (count($_POST) > 0) ? $_POST : $_GET; - mr_requestCleanup($request); - - // use mod_rewrite - if (mr_arrayValue($request, 'use') == 1) { - $this->_oView->use_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use'] = 1; - } else { - $this->_oView->use_chk = ''; - $aMR['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'); - $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 = 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 = sprintf($sMsg, $request['rootdir'], $_SERVER['DOCUMENT_ROOT']); - $this->_oView->rootdir_error = $this->_notifyBox('warning', $sMsg); - } - } - $this->_oView->rootdir = clHtmlEntities($request['rootdir']); - $aMR['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; - } else { - $this->_oView->checkrootdir_chk = ''; - $aMR['mod_rewrite']['checkrootdir'] = 0; - } - - // start from root - if (mr_arrayValue($request, 'startfromroot') == 1) { - $this->_oView->startfromroot_chk = ' checked="checked"'; - $aMR['mod_rewrite']['startfromroot'] = 1; - } else { - $this->_oView->startfromroot_chk = ''; - $aMR['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; - } else { - $this->_oView->prevent_duplicated_content_chk = ''; - $aMR['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; - if (mr_arrayValue($request, 'use_language_name') == 1) { - $this->_oView->use_language_name_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use_language_name'] = 1; - } else { - $this->_oView->use_language_name_chk = ''; - $aMR['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; - } - - // 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; - if (mr_arrayValue($request, 'use_client_name') == 1) { - $this->_oView->use_client_name_chk = ' checked="checked"'; - $aMR['mod_rewrite']['use_client_name'] = 1; - } else { - $this->_oView->use_client_name_chk = ''; - $aMR['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; - } - - // 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; - } else { - $this->_oView->use_lowercase_uri_chk = ''; - $aMR['mod_rewrite']['use_lowercase_uri'] = 0; - } - - $this->_oView->category_separator_attrib = ''; - $this->_oView->category_word_separator_attrib = ''; - $this->_oView->article_separator_attrib = ''; - $this->_oView->article_word_separator_attrib = ''; - - $separatorPattern = $aSeparator['pattern']; - $separatorInfo = $aSeparator['info']; - - $wordSeparatorPattern = $aSeparator['pattern']; - $wordSeparatorInfo = $aSeparator['info']; - - $categorySeperator = mr_arrayValue($request, 'category_seperator', ''); - $categoryWordSeperator = mr_arrayValue($request, 'category_word_seperator', ''); - $articleSeperator = mr_arrayValue($request, 'article_seperator', ''); - $articleWordSeperator = mr_arrayValue($request, 'article_word_seperator', ''); - - // category seperator - if ($categorySeperator == '') { - $sMsg = i18n('Please specify separator (%s) for category', '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 = 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 = 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 = 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 = 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 = 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 = 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 = 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'); - $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'); - $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'); - $this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg); - $bError = true; - } - - $this->_oView->category_separator = clHtmlEntities($categorySeperator); - $aMR['mod_rewrite']['category_seperator'] = $categorySeperator; - $this->_oView->category_word_separator = clHtmlEntities($categoryWordSeperator); - $aMR['mod_rewrite']['category_word_seperator'] = $categoryWordSeperator; - $this->_oView->article_separator = clHtmlEntities($articleSeperator); - $aMR['mod_rewrite']['article_seperator'] = $articleSeperator; - $this->_oView->article_word_separator = clHtmlEntities($articleWordSeperator); - $aMR['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'); - $this->_oView->file_extension_error = $this->_notifyBox('error', $sMsg); - $bError = true; - } - $this->_oView->file_extension = clHtmlEntities($request['file_extension']); - $aMR['mod_rewrite']['file_extension'] = $request['file_extension']; - } else { - $this->_oView->file_extension = '.html'; - $aMR['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'); - $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'); - $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']; - } else { - $this->_oView->category_resolve_min_percentage = '75'; - $aMR['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; - 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'); - $this->_oView->add_startart_name_to_url_error = $this->_notifyBox('error', $sMsg); - $bError = true; - } - $this->_oView->default_startart_name = clHtmlEntities($request['default_startart_name']); - $aMR['mod_rewrite']['default_startart_name'] = $request['default_startart_name']; - } else { - $this->_oView->default_startart_name = ''; - $aMR['mod_rewrite']['default_startart_name'] = ''; - } - } else { - $this->_oView->add_startart_name_to_url_chk = ''; - $aMR['mod_rewrite']['add_startart_name_to_url'] = 0; - $this->_oView->default_startart_name = ''; - $aMR['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; - } 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; - } - - // routing - if (isset($request['rewrite_routing'])) { - $aRouting = array(); - $items = explode("\n", $request['rewrite_routing']); - foreach ($items as $p => $v) { - $routingDef = explode($routingSeparator, $v); - if (count($routingDef) !== 2) { - continue; - } - $routingDef[0] = trim($routingDef[0]); - $routingDef[1] = trim($routingDef[1]); - if ($routingDef[0] == '') { - continue; - } - $aRouting[$routingDef[0]] = $routingDef[1]; - } - $this->_oView->rewrite_routing = clHtmlEntities($request['rewrite_routing']); - $aMR['mod_rewrite']['routing'] = $aRouting; - } else { - $this->_oView->rewrite_routing = ''; - $aMR['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; - } else { - $this->_oView->redirect_invalid_article_to_errorsite_chk = ''; - $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; - } - - if ($bError) { - $sMsg = i18n('Please check your input', 'mod_rewrite'); - $this->_oView->content_before = $this->_notifyBox('error', $sMsg); - return; - } - - if ($bDebug == true) { - echo $this->_notifyBox('info', 'Debug'); - echo '
';print_r($aMR['mod_rewrite']);echo '
'; - $sMsg = i18n('Configuration has not been saved, because of enabled debugging', 'mod_rewrite'); - echo $this->_notifyBox('info', $sMsg); - return; - } - - $bSeparatorModified = $this->_separatorModified($aMR['mod_rewrite']); - - if (mr_setConfiguration($this->_client, $aMR)) { - $sMsg = 'Configuration has been saved'; - 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 = sprintf($sMsg, $options['key']); - $this->_oView->content_before = $this->_notifyBox('error', $sMsg); - } - } - - - protected function _separatorModified($aNewCfg) - { - $aCfg = ModRewrite::getConfig(); - - if ($aCfg['category_seperator'] != $aNewCfg['category_seperator']) { - return true; - } elseif ($aCfg['category_word_seperator'] != $aNewCfg['category_word_seperator']) { - return true; - } elseif ($aCfg['article_seperator'] != $aNewCfg['article_seperator']) { - return true; - } elseif ($aCfg['article_word_seperator'] != $aNewCfg['article_word_seperator']) { - return true; - } - return false; - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + + +/** + * Content controller for general settings. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewrite_ContentController extends ModRewrite_ControllerAbstract { + + /** + * Index action + */ + public function indexAction() { + // donut + $this->_doChecks(); + } + + /** + * Save settings action + */ + public function saveAction() { + $bDebug = $this->getProperty('bDebug'); + $aSeparator = $this->getProperty('aSeparator'); + $aWordSeparator = $this->getProperty('aWordSeparator'); + $routingSeparator = $this->getProperty('routingSeparator'); + + $bError = false; + $aMR = array(); + + $request = (count($_POST) > 0) ? $_POST : $_GET; + mr_requestCleanup($request); + + // use mod_rewrite + if (mr_arrayValue($request, 'use') == 1) { + $this->_oView->use_chk = ' checked="checked"'; + $aMR['mod_rewrite']['use'] = 1; + } else { + $this->_oView->use_chk = ''; + $aMR['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"); + $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 = 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 = 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']; + } + + // root dir check + if (mr_arrayValue($request, 'checkrootdir') == 1) { + $this->_oView->checkrootdir_chk = ' checked="checked"'; + $aMR['mod_rewrite']['checkrootdir'] = 1; + } else { + $this->_oView->checkrootdir_chk = ''; + $aMR['mod_rewrite']['checkrootdir'] = 0; + } + + // start from root + if (mr_arrayValue($request, 'startfromroot') == 1) { + $this->_oView->startfromroot_chk = ' checked="checked"'; + $aMR['mod_rewrite']['startfromroot'] = 1; + } else { + $this->_oView->startfromroot_chk = ''; + $aMR['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; + } else { + $this->_oView->prevent_duplicated_content_chk = ''; + $aMR['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; + if (mr_arrayValue($request, 'use_language_name') == 1) { + $this->_oView->use_language_name_chk = ' checked="checked"'; + $aMR['mod_rewrite']['use_language_name'] = 1; + } else { + $this->_oView->use_language_name_chk = ''; + $aMR['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; + } + + // 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; + if (mr_arrayValue($request, 'use_client_name') == 1) { + $this->_oView->use_client_name_chk = ' checked="checked"'; + $aMR['mod_rewrite']['use_client_name'] = 1; + } else { + $this->_oView->use_client_name_chk = ''; + $aMR['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; + } + + // 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; + } else { + $this->_oView->use_lowercase_uri_chk = ''; + $aMR['mod_rewrite']['use_lowercase_uri'] = 0; + } + + $this->_oView->category_separator_attrib = ''; + $this->_oView->category_word_separator_attrib = ''; + $this->_oView->article_separator_attrib = ''; + $this->_oView->article_word_separator_attrib = ''; + + $separatorPattern = $aSeparator['pattern']; + $separatorInfo = $aSeparator['info']; + + $wordSeparatorPattern = $aSeparator['pattern']; + $wordSeparatorInfo = $aSeparator['info']; + + $categorySeperator = mr_arrayValue($request, 'category_seperator', ''); + $categoryWordSeperator = mr_arrayValue($request, 'category_word_seperator', ''); + $articleSeperator = mr_arrayValue($request, 'article_seperator', ''); + $articleWordSeperator = mr_arrayValue($request, 'article_word_seperator', ''); + + // category seperator + if ($categorySeperator == '') { + $sMsg = i18n("Please specify separator (%s) for category", "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 = 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 = 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 = 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 = 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 = 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 = 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 = 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"); + $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"); + $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"); + $this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg); + $bError = true; + } + + $this->_oView->category_separator = conHtmlentities($categorySeperator); + $aMR['mod_rewrite']['category_seperator'] = $categorySeperator; + $this->_oView->category_word_separator = conHtmlentities($categoryWordSeperator); + $aMR['mod_rewrite']['category_word_seperator'] = $categoryWordSeperator; + $this->_oView->article_separator = conHtmlentities($articleSeperator); + $aMR['mod_rewrite']['article_seperator'] = $articleSeperator; + $this->_oView->article_word_separator = conHtmlentities($articleWordSeperator); + $aMR['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"); + $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']; + } else { + $this->_oView->file_extension = '.html'; + $aMR['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"); + $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"); + $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']; + } else { + $this->_oView->category_resolve_min_percentage = '75'; + $aMR['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; + 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"); + $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']; + } else { + $this->_oView->default_startart_name = ''; + $aMR['mod_rewrite']['default_startart_name'] = ''; + } + } else { + $this->_oView->add_startart_name_to_url_chk = ''; + $aMR['mod_rewrite']['add_startart_name_to_url'] = 0; + $this->_oView->default_startart_name = ''; + $aMR['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; + } 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; + } + + // routing + if (isset($request['rewrite_routing'])) { + $aRouting = array(); + $items = explode("\n", $request['rewrite_routing']); + foreach ($items as $p => $v) { + $routingDef = explode($routingSeparator, $v); + if (count($routingDef) !== 2) { + continue; + } + $routingDef[0] = trim($routingDef[0]); + $routingDef[1] = trim($routingDef[1]); + if ($routingDef[0] == '') { + continue; + } + $aRouting[$routingDef[0]] = $routingDef[1]; + } + $this->_oView->rewrite_routing = conHtmlentities($request['rewrite_routing']); + $aMR['mod_rewrite']['routing'] = $aRouting; + } else { + $this->_oView->rewrite_routing = ''; + $aMR['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; + } else { + $this->_oView->redirect_invalid_article_to_errorsite_chk = ''; + $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; + } + + if ($bError) { + $sMsg = i18n("Please check your input", "mod_rewrite"); + $this->_oView->content_before .= $this->_notifyBox('error', $sMsg); + return; + } + + if ($bDebug == true) { + echo $this->_notifyBox('info', 'Debug'); + echo '
';
+            print_r($aMR['mod_rewrite']);
+            echo '
'; + $sMsg = i18n("Configuration has not been saved, because of enabled debugging", "mod_rewrite"); + echo $this->_notifyBox('info', $sMsg); + return; + } + + $bSeparatorModified = $this->_separatorModified($aMR['mod_rewrite']); + + if (mr_setConfiguration($this->_client, $aMR)) { + $sMsg = i18n("Configuration has been saved", "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 = sprintf($sMsg, $options['key']); + $this->_oView->content_before .= $this->_notifyBox('error', $sMsg); + } + } + + /** + * Checks, if any sseparators setting is modified or not + * @param array $aNewCfg New configuration send by requests. + * @return bool + */ + protected function _separatorModified($aNewCfg) { + $aCfg = ModRewrite::getConfig(); + + if ($aCfg['category_seperator'] != $aNewCfg['category_seperator']) { + return true; + } elseif ($aCfg['category_word_seperator'] != $aNewCfg['category_word_seperator']) { + return true; + } elseif ($aCfg['article_seperator'] != $aNewCfg['article_seperator']) { + return true; + } elseif ($aCfg['article_word_seperator'] != $aNewCfg['article_word_seperator']) { + return true; + } + return false; + } + + /** + * Does some checks like 'is_start_compatible' check. + * Adds notifications, if something will went wrong... + */ + 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"); + $this->_oView->content_before .= $this->_notifyBox('warning', $sMsg); + } + + // Check for empty urlpath entries in cat_lang table + $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 = sprintf($sMsg, '', ''); + $this->_oView->content_before .= $this->_notifyBox('warning', $sMsg); + } + + } +} diff --git a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contentexpert_controller.php b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contentexpert_controller.php index 1acece9..c8bf374 100644 --- a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contentexpert_controller.php +++ b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contentexpert_controller.php @@ -1,137 +1,143 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: class.modrewrite_contentexpert_controller.php 209 2013-01-24 12:31:00Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php'); - - -class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract -{ - protected $_htaccessRestrictive = ''; - protected $_htaccessSimple = ''; - - public function init() - { - $this->_oView->content_before = ''; - - $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/'; - $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt'; - $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt'; - } - - /** - * Execute index action - */ - public function indexAction() - { - } - - - public function copyHtaccessAction() - { - $type = $this->_getParam('htaccesstype'); - $copy = $this->_getParam('copy'); - - if ($type != 'restrictive' && $type != 'simple') { - return; - } elseif ($copy != 'contenido' && $copy != 'cms') { - return; - } - - $aInfo = $this->getProperty('htaccessInfo'); - - if ($aInfo['has_htaccess']) { - $this->_oView->content_before = $this->_notifyBox(Contenido_Notification::LEVEL_WARNING, 'Die .htaccess existiert bereits im Contenido-/ oder Mandantenverzeichnis, daher wird es nicht kopiert'); - return; - } - - if ($type == 'restrictive') { - $source = $this->_htaccessRestrictive; - } else { - $source = $this->_htaccessSimple; - } - - if ($copy == 'contenido') { - $dest = $aInfo['contenido_full_path'] . '.htaccess'; - } else { - $dest = $aInfo['client_full_path'] . '.htaccess'; - } - - if (!$result = @copy($source, $dest)) { - $this->_oView->content_before = $this->_notifyBox(Contenido_Notification::LEVEL_WARNING, 'Die .htaccess konnte nicht von ' . $source . ' nach ' . $dest . ' kopiert werden!'); - return; - } - - $msg = 'Die .htaccess wurde erfolgreich nach ' . str_replace('.htaccess', '', $dest) . ' kopiert'; - $this->_oView->content_before = $this->_notifyBox(Contenido_Notification::LEVEL_INFO, $msg); - } - - - public function downloadHtaccessAction() - { - $type = $this->_getParam('htaccesstype'); - - if ($type != 'restrictive' && $type != 'simple') { - return; - } - - if ($type == 'restrictive') { - $source = $this->_htaccessRestrictive; - } else { - $source = $this->_htaccessSimple; - } - - $this->_oView->content = file_get_contents($source); - - header('Content-Type: text/plain'); - header('Etag: ' . md5(mt_rand())); - header('Content-Disposition: attachment; filename="' . $type . '.htaccess"'); - $this->render('{CONTENT}'); - } - - - public function resetAction() - { - // recreate all aliases - ModRewrite::recreateAliases(false); - $this->_oView->content_before = $this->_notifyBox('info', 'Alle Aliase wurden zurückgesetzt'); - } - - - public function resetEmptyAction() - { - // recreate only empty aliases - ModRewrite::recreateAliases(true); - $this->_oView->content_before = $this->_notifyBox('info', 'Nur leere Aliase wurden zurückgesetzt'); - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + + +/** + * Content expert controller for expert settings/actions. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract { + + /** + * Path to restrictive htaccess file + * @var string + */ + protected $_htaccessRestrictive = ''; + + /** + * Path to simple htaccess file + * @var string + */ + protected $_htaccessSimple = ''; + + /** + * Initializer method, sets the paths to htaccess files + */ + public function init() { + $this->_oView->content_before = ''; + + $pluginPath = $this->_cfg['path']['contenido'] . $this->_cfg['path']['plugins'] . 'mod_rewrite/'; + $this->_htaccessRestrictive = $pluginPath . 'files/htaccess_restrictive.txt'; + $this->_htaccessSimple = $pluginPath . 'files/htaccess_simple.txt'; + } + + /** + * Index action + */ + public function indexAction() { + + } + + /** + * Copy htaccess action + */ + public function copyHtaccessAction() { + $type = $this->_getParam('htaccesstype'); + $copy = $this->_getParam('copy'); + + if ($type != 'restrictive' && $type != 'simple') { + return; + } elseif ($copy != 'contenido' && $copy != 'cms') { + return; + } + + $aInfo = $this->getProperty('htaccessInfo'); + + if ($aInfo['has_htaccess']) { + $this->_oView->content_before = $this->_notifyBox('info', 'Die .htaccess existiert bereits im Contenido-/ oder Mandantenverzeichnis, daher wird es nicht kopiert'); + return; + } + + if ($type == 'restrictive') { + $source = $this->_htaccessRestrictive; + } else { + $source = $this->_htaccessSimple; + } + + if ($copy == 'contenido') { + $dest = $aInfo['contenido_full_path'] . '.htaccess'; + } else { + $dest = $aInfo['client_full_path'] . '.htaccess'; + } + + if (!$result = @copy($source, $dest)) { + $this->_oView->content_before = $this->_notifyBox('info', 'Die .htaccess konnte nicht von ' . $source . ' nach ' . $dest . ' kopiert werden!'); + return; + } + + $msg = 'Die .htaccess wurde erfolgreich nach ' . str_replace('.htaccess', '', $dest) . ' kopiert'; + $this->_oView->content_before = $this->_notifyBox('info', $msg); + } + + /** + * Download htaccess action + */ + public function downloadHtaccessAction() { + $type = $this->_getParam('htaccesstype'); + + if ($type != 'restrictive' && $type != 'simple') { + return; + } + + if ($type == 'restrictive') { + $source = $this->_htaccessRestrictive; + } else { + $source = $this->_htaccessSimple; + } + + $this->_oView->content = file_get_contents($source); + + header('Content-Type: text/plain'); + header('Etag: ' . md5(mt_rand())); + header('Content-Disposition: attachment; filename="' . $type . '.htaccess"'); + $this->render('{CONTENT}'); + } + + /** + * Reset aliases action + */ + public function resetAction() { + // recreate all aliases + ModRewrite::recreateAliases(false); + $this->_oView->content_before = $this->_notifyBox('info', 'Alle Aliase wurden zurückgesetzt'); + } + + /** + * Reset only empty aliases action + */ + public function resetEmptyAction() { + // recreate only empty aliases + ModRewrite::recreateAliases(true); + $this->_oView->content_before = $this->_notifyBox('info', 'Nur leere Aliase wurden zurückgesetzt'); + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contenttest_controller.php b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contenttest_controller.php index 90b2da4..fd3309e 100644 --- a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contenttest_controller.php +++ b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_contenttest_controller.php @@ -1,161 +1,176 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: class.modrewrite_contenttest_controller.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -plugin_include('mod_rewrite', 'classes/class.modrewritetest.php'); -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php'); - - -class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract -{ - protected $_iMaxItems = 0; - - public function init() - { - $this->_oView->content = ''; - $this->_oView->form_idart_chk = ($this->_getParam('idart')) ? ' checked="checked"' : ''; - $this->_oView->form_idcat_chk = ($this->_getParam('idcat')) ? ' checked="checked"' : ''; - $this->_oView->form_idcatart_chk = ($this->_getParam('idcatart')) ? ' checked="checked"' : ''; - $this->_oView->form_idartlang_chk = ($this->_getParam('idartlang')) ? ' checked="checked"' : ''; - $this->_oView->form_maxitems = (int) $this->_getParam('maxitems', 200); - $this->_iMaxItems = $this->_oView->form_maxitems; - } - - /** - * Execute index action - */ - public function indexAction() - { - $this->_oView->content = ''; - - } - - /** - * Execute test action - */ - public function testAction() - { - $this->_oView->content = ''; - - // Array for testcases - $aTests = array(); - - // Instance of mr test - $oMRTest = new ModRewriteTest($this->_iMaxItems); - - $startTime = getmicrotime(); - - // Fetch complete Contenido page structure - $aStruct = $oMRTest->fetchFullStructure(); - ModRewriteDebugger::add($aStruct, 'mr_test.php $aStruct'); - - // Loop through the structure and compose testcases - foreach ($aStruct as $idcat => $aCat) { - // category - $aTests[] = array( - 'url' => $oMRTest->composeURL($aCat, 'c'), - 'level' => $aCat['level'], - 'name' => $aCat['name'] - ); - - foreach ($aCat['articles'] as $idart => $aArt) { - // articles - $aTests[] = array( - 'url' => $oMRTest->composeURL($aArt, 'a'), - 'level' => $aCat['level'], - 'name' => $aCat['name'] . ' :: ' . $aArt['title'] - ); - } - } - - // compose content - $this->_oView->content = '
';
-
-        $oMRUrlStack = ModRewriteUrlStack::getInstance();
-
-        // first loop to add urls to mr url stack
-        foreach ($aTests as $p => $v) {
-            $oMRUrlStack->add($v['url']);
-        }
-
-        $successCounter = 0;
-        $failCounter    = 0;
-
-        // second loop to do the rest
-        foreach ($aTests as $p => $v) {
-            $url    = mr_buildNewUrl($v['url']);
-            $arr    = $oMRTest->resolveUrl($url);
-            $resUrl = $oMRTest->getResolvedUrl();
-            $color  = 'green';
-
-            if ($url !== $resUrl) {
-                if ($oMRTest->getRoutingFoundState()) {
-                    $successCounter++;
-                    $resUrl = 'route to -> ' . $resUrl;
-                } else {
-                    $color = 'red';
-                    $failCounter++;
-                }
-            } else {
-                $successCounter++;
-            }
-
-            $pref   = str_repeat('    ', $v['level']);
-
-            // render resolve information for current item
-            $itemTpl = $this->_oView->lng_result_item_tpl;
-            $itemTpl = str_replace('{pref}', $pref, $itemTpl);
-            $itemTpl = str_replace('{name}', $v['name'], $itemTpl);
-            $itemTpl = str_replace('{url_in}', $v['url'], $itemTpl);
-            $itemTpl = str_replace('{url_out}', $url, $itemTpl);
-            $itemTpl = str_replace('{color}', $color, $itemTpl);
-            $itemTpl = str_replace('{url_res}', $resUrl, $itemTpl);
-            $itemTpl = str_replace('{data}', $oMRTest->getReadableResolvedData($arr), $itemTpl);
-
-            $this->_oView->content .= "\n" . $itemTpl . "\n";
-        }
-        $this->_oView->content .= '
'; - - $totalTime = sprintf('%.4f', (getmicrotime() - $startTime)); - - // render information about current test - $msg = $this->_oView->lng_result_message_tpl; - $msg = str_replace('{time}', $totalTime, $msg); - $msg = str_replace('{num_urls}', ($successCounter + $failCounter), $msg); - $msg = str_replace('{num_success}', $successCounter, $msg); - $msg = str_replace('{num_fail}', $failCounter, $msg); - - $this->_oView->content = $msg . $this->_oView->content; - - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + + +/** + * Content controller to run tests. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract { + + /** + * Number of max items to process + * @var int + */ + protected $_iMaxItems = 0; + + /** + * Initializer method, sets some view variables + */ + public function init() { + $this->_oView->content = ''; + $this->_oView->form_idart_chk = ($this->_getParam('idart')) ? ' checked="checked"' : ''; + $this->_oView->form_idcat_chk = ($this->_getParam('idcat')) ? ' checked="checked"' : ''; + $this->_oView->form_idcatart_chk = ($this->_getParam('idcatart')) ? ' checked="checked"' : ''; + $this->_oView->form_idartlang_chk = ($this->_getParam('idartlang')) ? ' checked="checked"' : ''; + $this->_oView->form_maxitems = (int) $this->_getParam('maxitems', 200); + $this->_iMaxItems = $this->_oView->form_maxitems; + } + + /** + * Index action + */ + public function indexAction() { + $this->_oView->content = ''; + } + + /** + * Test action + */ + public function testAction() { + $this->_oView->content = ''; + + // Array for testcases + $aTests = array(); + + // Instance of mr test + $oMRTest = new ModRewriteTest($this->_iMaxItems); + + $startTime = getmicrotime(); + + // Fetch complete CONTENIDO page structure + $aStruct = $oMRTest->fetchFullStructure(); + ModRewriteDebugger::add($aStruct, 'mr_test.php $aStruct'); + + // Loop through the structure and compose testcases + foreach ($aStruct as $idcat => $aCat) { + // category + $aTests[] = array( + 'url' => $oMRTest->composeURL($aCat, 'c'), + 'level' => $aCat['level'], + 'name' => $aCat['name'] + ); + + foreach ($aCat['articles'] as $idart => $aArt) { + // articles + $aTests[] = array( + 'url' => $oMRTest->composeURL($aArt, 'a'), + 'level' => $aCat['level'], + 'name' => $aCat['name'] . ' :: ' . $aArt['title'] + ); + } + } + + // compose content + $this->_oView->content = '
';
+
+        $oMRUrlStack = ModRewriteUrlStack::getInstance();
+
+        // first loop to add urls to mr url stack
+        foreach ($aTests as $p => $v) {
+            $oMRUrlStack->add($v['url']);
+        }
+
+        $successCounter = 0;
+        $failCounter = 0;
+
+        // second loop to do the rest
+        foreach ($aTests as $p => $v) {
+            $url = mr_buildNewUrl($v['url']);
+            $arr = $oMRTest->resolveUrl($url);
+            $error = '';
+            $resUrl = $oMRTest->getResolvedUrl();
+            $color = 'green';
+
+            if ($url !== $resUrl) {
+                if ($oMRTest->getRoutingFoundState()) {
+                    $successCounter++;
+                    $resUrl = 'route to -> ' . $resUrl;
+                } else {
+                    $color = 'red';
+                    $failCounter++;
+                }
+            } else {
+                $successCounter++;
+            }
+
+            // @todo: translate
+            if (isset($arr['error'])) {
+                switch ($arr['error']) {
+                    case ModRewriteController::ERROR_CLIENT:
+                        $error = 'client';
+                        break;
+                    case ModRewriteController::ERROR_LANGUAGE:
+                        $error = 'language';
+                        break;
+                    case ModRewriteController::ERROR_CATEGORY:
+                        $error = 'category';
+                        break;
+                    case ModRewriteController::ERROR_ARTICLE:
+                        $error = 'article';
+                        break;
+                    case ModRewriteController::ERROR_POST_VALIDATION:
+                        $error = 'validation';
+                        break;
+                }
+            }
+
+            $pref = str_repeat('    ', $v['level']);
+
+            // render resolve information for current item
+            $itemTpl = $this->_oView->lng_result_item_tpl;
+            $itemTpl = str_replace('{pref}', $pref, $itemTpl);
+            $itemTpl = str_replace('{name}', $v['name'], $itemTpl);
+            $itemTpl = str_replace('{url_in}', $v['url'], $itemTpl);
+            $itemTpl = str_replace('{url_out}', $url, $itemTpl);
+            $itemTpl = str_replace('{color}', $color, $itemTpl);
+            $itemTpl = str_replace('{url_res}', $resUrl, $itemTpl);
+            $itemTpl = str_replace('{err}', $error, $itemTpl);
+            $itemTpl = str_replace('{data}', $oMRTest->getReadableResolvedData($arr), $itemTpl);
+
+            $this->_oView->content .= "\n" . $itemTpl . "\n";
+        }
+        $this->_oView->content .= '
'; + + $totalTime = sprintf('%.4f', (getmicrotime() - $startTime)); + + // render information about current test + $msg = $this->_oView->lng_result_message_tpl; + $msg = str_replace('{time}', $totalTime, $msg); + $msg = str_replace('{num_urls}', ($successCounter + $failCounter), $msg); + $msg = str_replace('{num_success}', $successCounter, $msg); + $msg = str_replace('{num_fail}', $failCounter, $msg); + + $this->_oView->content = $msg . $this->_oView->content; + } + +} diff --git a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_controller_abstract.php b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_controller_abstract.php index 00c31f9..8e2e55b 100644 --- a/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_controller_abstract.php +++ b/conlite/plugins/mod_rewrite/classes/controller/class.modrewrite_controller_abstract.php @@ -1,148 +1,226 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: class.modrewrite_controller_abstract.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -abstract class ModRewrite_ControllerAbstract -{ - - protected $_oView; - - protected $_cfg; - - protected $_client; - - protected $_area; - - protected $_action; - - protected $_frame; - - protected $_contenido; - - protected $_template = null; - - protected $_properties = array(); - - protected $_debug = false; - - public function __construct() - { - global $cfg, $client, $area, $action, $frame, $contenido, $sess; - - $this->_oView = new stdClass(); - $this->_cfg = $cfg; - $this->_area = $area; - $this->_action = $action; - $this->_frame = $frame; - $this->_client = $client; - $this->_contenido = $contenido; - - $this->_oView->area = $this->_area; - $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->init(); - } - - public function init() - { - } - - public function setView($oView) - { - if (is_object($oView)) { - $this->_oView = $oView; - } - } - - public function getView() - { - return $this->_oView; - } - - public function setProperty($key, $value) - { - $this->_properties[$key] = $value; - } - - public function getProperty($key, $default = null) - { - return (isset($this->_properties[$key])) ? $this->_properties[$key] : $default; - } - - public function setTemplate($sTemplate) - { - $this->_template = $sTemplate; - } - - public function getTemplate() - { - return $this->_template; - } - - public function render($template = null) - { - if ($template == null) { - $template = $this->_template; - } - - if ($template == null) { - throw new Exception('Missing template to render.'); - } - - $oTpl = new Template(); - foreach ($this->_oView as $k => $v) { - $oTpl->set('s', strtoupper($k), $v); - } - $oTpl->generate($template, 0, 0); - } - - protected function _getParam($key, $default = null) - { - if (isset($_GET[$key])) { - return $_GET[$key]; - } elseif (isset($_POST[$key])) { - return $_POST[$key]; - } else { - return $default; - } - } - - protected function _notifyBox($type, $msg) - { - global $notification; - return $notification->returnNotification($type, $msg) . '
'; - } - -} + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +/** + * Abstract controller for all concrete mod_rewrite controller implementations. + * + * @author Murat Purc + * @package plugin + * @subpackage Mod Rewrite + */ +abstract class ModRewrite_ControllerAbstract { + + /** + * View object, holds all view variables + * @var stdClass + */ + protected $_oView; + + /** + * Global CONTENIDO $cfg variable + * @var array + */ + protected $_cfg; + + /** + * Global CONTENIDO $client variable (client id) + * @var int + */ + protected $_client; + + /** + * Global CONTENIDO $area variable (area name/id) + * @var int|string + */ + protected $_area; + + /** + * Global CONTENIDO $action variable (send by request) + * @var string + */ + protected $_action; + + /** + * Global CONTENIDO $frame variable (current frame in backend) + * @var int + */ + protected $_frame; + + /** + * Global CONTENIDO $contenido variable (session id) + * @var string + */ + protected $_contenido; + + /** + * Template file or template string to render + * @var string + */ + protected $_template = null; + + /** + * Additional properties list + * @var array + */ + protected $_properties = array(); + + /** + * Debug flag + * @var bool + */ + protected $_debug = false; + + /** + * Constructor, sets some properties by assigning global variables to them. + */ + public function __construct() { + global $cfg, $client, $area, $action, $frame, $contenido, $sess; + + $this->_oView = new stdClass(); + $this->_cfg = $cfg; + $this->_area = $area; + $this->_action = $action; + $this->_frame = $frame; + $this->_client = $client; + $this->_contenido = $contenido; + + $this->_oView->area = $this->_area; + $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->init(); + } + + /** + * Initializer method, could be overwritten by childs. + * This method will be invoked in constructor of ModRewrite_ControllerAbstract. + */ + public function init() { + + } + + /** + * View property setter. + * @param object $oView + */ + public function setView($oView) { + if (is_object($oView)) { + $this->_oView = $oView; + } + } + + /** + * View property getter. + * @return object + */ + public function getView() { + return $this->_oView; + } + + /** + * Property setter. + * @param string $key + * @param mixed $value + */ + public function setProperty($key, $value) { + $this->_properties[$key] = $value; + } + + /** + * Property getter. + * @param string $key + * @param mixed $default + * @return mixed + */ + public function getProperty($key, $default = null) { + return (isset($this->_properties[$key])) ? $this->_properties[$key] : $default; + } + + /** + * Template setter. + * @param string $sTemplate Either full path and name of template file or a template string. + */ + public function setTemplate($sTemplate) { + $this->_template = $sTemplate; + } + + /** + * Template getter. + * @return string + */ + public function getTemplate() { + return $this->_template; + } + + /** + * Renders template by replacing all view variables in template. + * @param string Either full path and name of template file or a template string. + * If not passed, previous set template will be used. + * @throws Exception if no template is set + * @return string + */ + public function render($template = null) { + if ($template == null) { + $template = $this->_template; + } + + if ($template == null) { + throw new Exception('Missing template to render.'); + } + + $oTpl = new Template(); + foreach ($this->_oView as $k => $v) { + $oTpl->set('s', strtoupper($k), $v); + } + $oTpl->generate($template, 0, 0); + } + + /** + * Returns parameter from request, the order is: + * - Return from $_GET, if found + * - Return from $_POST, if found + * + * @param string $key + * @param mixed $default The default value + * @return mixed + */ + protected function _getParam($key, $default = null) { + if (isset($_GET[$key])) { + return $_GET[$key]; + } elseif (isset($_POST[$key])) { + return $_POST[$key]; + } else { + return $default; + } + } + + /** + * Returns rendered notification markup by using global $notification variable. + * @param string $type One of cGuiNotification::LEVEL_* constants + * @param string $msg The message to display + * @return string + */ + protected function _notifyBox($type, $msg) { + global $notification; + return $notification->returnNotification($type, $msg) . '
'; + } + +} diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/css/atooltip.css b/conlite/plugins/mod_rewrite/external/aToolTip/css/atooltip.css index e469226..978487f 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/css/atooltip.css +++ b/conlite/plugins/mod_rewrite/external/aToolTip/css/atooltip.css @@ -1,43 +1,43 @@ -/* -Node structure --------------- -.aToolTip - .aToolTipInner - .aToolTipContent - .aToolTipCloseBtn - -*/ - -.aToolTip { margin:2px 0 0 2px; } - -.aToolTipInner { - border-left:1px solid #b3b3b3; - border-top:1px solid #666; - border-right:2px solid #b3b3b3; - border-bottom:2px solid #b3b3b3; - background:#f1f1f1; - color:#000; - margin:0; - padding:4px 12px 6px 24px; - margin:-2px 0 0 -2px; -} - -.aToolTipInner .aToolTipContent { - position:relative; - margin:0; - padding:0; -} - -a.aToolTipCloseBtn { - display:block; - height:16px; - width:16px; - background:url(../images/infoBtn.gif) no-repeat; - text-indent:-9999px; - outline:none; - position:absolute; - top:1px; - left:1px; - margin:1px 2px 2px 1px; - padding:0px; -} +/* +Node structure +-------------- +.aToolTip + .aToolTipInner + .aToolTipContent + .aToolTipCloseBtn + +*/ + +.aToolTip { margin:2px 0 0 2px; } + +.aToolTipInner { + border-left:1px solid #b3b3b3; + border-top:1px solid #666; + border-right:2px solid #b3b3b3; + border-bottom:2px solid #b3b3b3; + background:#f1f1f1; + color:#000; + margin:0; + padding:4px 12px 6px 24px; + margin:-2px 0 0 -2px; +} + +.aToolTipInner .aToolTipContent { + position:relative; + margin:0; + padding:0; +} + +a.aToolTipCloseBtn { + display:block; + height:16px; + width:16px; + background:url(../images/infoBtn.gif) no-repeat; + text-indent:-9999px; + outline:none; + position:absolute; + top:1px; + left:1px; + margin:1px 2px 2px 1px; + padding:0px; +} diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/css/style.css b/conlite/plugins/mod_rewrite/external/aToolTip/css/style.css index 9f009cc..1d3236c 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/css/style.css +++ b/conlite/plugins/mod_rewrite/external/aToolTip/css/style.css @@ -1,174 +1,174 @@ -/* Eric Meyer's Reset Reloaded */ -/* http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */ -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, a, abbr, acronym, address, big, cite, code,del, dfn, em, -font, img, ins, kbd, q, s, samp,small, strike, strong, sub, -sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li, -fieldset, form, label, legend,table, caption, tbody, tfoot, -thead, tr, th, td { - margin: 0; - padding: 0; - border: 0; - outline: 0; - font-size: 100%; - vertical-align: baseline; - background: transparent; -} -ol, ul {list-style: none;} -blockquote, q {quotes: none;} -table {border-collapse: collapse;border-spacing: 0;} - -.clearfix:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;} -/* IE6 */ -* html .clearfix {height: 1%;} -/* IE7 */ -*:first-child+html .clearfix {min-height: 1px;} - - -body { - background: #282828 url(../images/bg.png) repeat-x; - color: #999999; - font-size: 12px; - line-height: 20px; - font-family: Arial, helvetica; -} - -a, -a:link, -a:visited { - color: #FEC92C; - text-decoration: none; - -} - -a:hover, -a:active, -a:focus { - text-decoration: underline; -} - - -a.exampleTip { - color: #FEC92C; -} - -a.exampleTip:hover{ - text-decoration: underline; -} - -.section { - text-align: left; - padding-bottom: 18px; - border-bottom: 1px solid #333; - margin-bottom: 18px; -} - -p { - margin: 0 0 18px; -} - -h2 { - color: #fff; - font-size: 22px; - line-height: 24px; - margin: 0 0 24px; - padding: 0; - font-weight: normal; -} - -h3{ - color: #ddd; - font-size: 14px; - line-height: 18px; - margin: 0 0 18px; -} - - -h1.logo { - display: block; - height: 80px; - width: 260px; - margin: 40px auto 0; -} - - h1.logo a{ - display: block; - height: 80px; - width: 260px; - text-indent: -9999px; - background: url(../images/logo.png) no-repeat; - } - - -ul.demos { - list-style-type: none; - -} - -ul.demos li{ - margin: 0 0 10px 0; -} - - -.primaryWrapper { - margin: 0 auto; - width: 960px; - text-align: center; -} - -.branding{ - text-align: center; - display: block; - height: 120px; -} - - -.ctaBtns {border: none; text-align: center;} - -.ctaBtns p { - width: 263px; - margin: 0 auto; -} - - -.ctaBtns a{ - display: block; - height: 37px; - width: 122px; - text-indent: -9999px; -} - -a.dloadBtn { - background: url(../images/dload-btn.png) no-repeat top left; - float: left; - margin-right: 18px; -} - -a.demoBtn { - background: url(../images/demo-btn.png) no-repeat top left; - float: left; -} - -a.dloadBtn:hover, -a.demoBtn:hover { - background-position: bottom left; -} - - - -.usage p { - margin-bottom: 2px; -} - -ul.quickFacts { - list-style-position: inside; - list-style-type: disc; -} - -p.license, -p.copyright { - font-size: 11px; -} - - - +/* Eric Meyer's Reset Reloaded */ +/* http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/ */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, a, abbr, acronym, address, big, cite, code,del, dfn, em, +font, img, ins, kbd, q, s, samp,small, strike, strong, sub, +sup, tt, var,b, u, i, center,dl, dt, dd, ol, ul, li, +fieldset, form, label, legend,table, caption, tbody, tfoot, +thead, tr, th, td { + margin: 0; + padding: 0; + border: 0; + outline: 0; + font-size: 100%; + vertical-align: baseline; + background: transparent; +} +ol, ul {list-style: none;} +blockquote, q {quotes: none;} +table {border-collapse: collapse;border-spacing: 0;} + +.clearfix:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;} +/* IE6 */ +* html .clearfix {height: 1%;} +/* IE7 */ +*:first-child+html .clearfix {min-height: 1px;} + + +body { + background: #282828 url(../images/bg.png) repeat-x; + color: #999999; + font-size: 12px; + line-height: 20px; + font-family: Arial, helvetica; +} + +a, +a:link, +a:visited { + color: #FEC92C; + text-decoration: none; + +} + +a:hover, +a:active, +a:focus { + text-decoration: underline; +} + + +a.exampleTip { + color: #FEC92C; +} + +a.exampleTip:hover{ + text-decoration: underline; +} + +.section { + text-align: left; + padding-bottom: 18px; + border-bottom: 1px solid #333; + margin-bottom: 18px; +} + +p { + margin: 0 0 18px; +} + +h2 { + color: #fff; + font-size: 22px; + line-height: 24px; + margin: 0 0 24px; + padding: 0; + font-weight: normal; +} + +h3{ + color: #ddd; + font-size: 14px; + line-height: 18px; + margin: 0 0 18px; +} + + +h1.logo { + display: block; + height: 80px; + width: 260px; + margin: 40px auto 0; +} + + h1.logo a{ + display: block; + height: 80px; + width: 260px; + text-indent: -9999px; + background: url(../images/logo.png) no-repeat; + } + + +ul.demos { + list-style-type: none; + +} + +ul.demos li{ + margin: 0 0 10px 0; +} + + +.primaryWrapper { + margin: 0 auto; + width: 960px; + text-align: center; +} + +.branding{ + text-align: center; + display: block; + height: 120px; +} + + +.ctaBtns {border: none; text-align: center;} + +.ctaBtns p { + width: 263px; + margin: 0 auto; +} + + +.ctaBtns a{ + display: block; + height: 37px; + width: 122px; + text-indent: -9999px; +} + +a.dloadBtn { + background: url(../images/dload-btn.png) no-repeat top left; + float: left; + margin-right: 18px; +} + +a.demoBtn { + background: url(../images/demo-btn.png) no-repeat top left; + float: left; +} + +a.dloadBtn:hover, +a.demoBtn:hover { + background-position: bottom left; +} + + + +.usage p { + margin-bottom: 2px; +} + +ul.quickFacts { + list-style-position: inside; + list-style-type: disc; +} + +p.license, +p.copyright { + font-size: 11px; +} + + + diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/demos.html b/conlite/plugins/mod_rewrite/external/aToolTip/demos.html index fbfe36f..b9f91c8 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/demos.html +++ b/conlite/plugins/mod_rewrite/external/aToolTip/demos.html @@ -1,81 +1,81 @@ - - - - - aToolTip Demos - - - - - - - - - - - - - - - - - - - - - -
- -
-

aToolTip

-
- - - - - -
-

Demos

- -
    -
  • Normal Tooltip - This is a normal tooltip with default settings.
  • -
  • Fixed Tooltip - This is a fixed tooltip that doesnt follow the mouse.
  • -
  • On Click Tooltip - This is a click activated tooltip with content passed in from 'tipContent' param
  • -
- -
- - - - - - -

-Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License. -

- - -
- - - + + + + + aToolTip Demos + + + + + + + + + + + + + + + + + + + + + +
+ +
+

aToolTip

+
+ + + + + +
+

Demos

+ +
    +
  • Normal Tooltip - This is a normal tooltip with default settings.
  • +
  • Fixed Tooltip - This is a fixed tooltip that doesnt follow the mouse.
  • +
  • On Click Tooltip - This is a click activated tooltip with content passed in from 'tipContent' param
  • +
+ +
+ + + + + + +

+Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License. +

+ + +
+ + + \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js b/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js index 0145ace..83efbbf 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js +++ b/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js @@ -1,118 +1,118 @@ -/* - jQuery Version: jQuery 1.3.2 - Plugin Name: aToolTip V 1.0 - Plugin by: Ara Abcarians: http://ara-abcarians.com - License: aToolTip is licensed under a Creative Commons Attribution 3.0 Unported License - Read more about this license at --> http://creativecommons.org/licenses/by/3.0/ - Modified: Murat Purc , 2010-01-28: Position clickable tooltip on right side, - remove previous opened tooltip - -Creates following node: ------------------------ -
-
-

- Content - close -
-
- -*/ -(function($) { - $.fn.aToolTip = function(options) { - - // setup default settings - var defaults = { - clickIt: false, - closeTipBtn: 'aToolTipCloseBtn', - fixed: false, - inSpeed: 400, - outSpeed: 100, - tipContent: '', - toolTipClass: 'aToolTip', - xOffset: 0, - yOffset: 0 - }, - - // This makes it so the users custom options overrides the default ones - settings = $.extend({}, defaults, options); - - return this.each(function() { - var obj = $(this); - // Decide weather to use a title attr as the tooltip content - if (obj.attr('title') && !settings.tipContent) { - // set the tooltip content/text to be the obj title attribute - var tipContent = obj.attr('title'); - } else { - // if no title attribute set it to the tipContent option in settings - var tipContent = settings.tipContent; - } - - // check if obj has a title attribute and if click feature is off - if(tipContent && !settings.clickIt){ - // Activate on hover - obj.hover(function(el){ - obj.attr({title: ''}); - $('body').append("

"+ tipContent +"

"); - $('.' + settings.toolTipClass).css({ - position: 'absolute', - display: 'none', - zIndex: '50000', - top: (obj.offset().top - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset) + 'px', - left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' - }) - .stop().fadeIn(settings.inSpeed); - }, - function(){ - // Fade out - $('.' + settings.toolTipClass).stop().fadeOut(settings.outSpeed, function(){$(this).remove();}); - }); - } - - // Follow mouse if fixed is false and click is false - if(!settings.fixed && !settings.clickIt){ - obj.mousemove(function(el){ - $('.' + settings.toolTipClass).css({ - top: (el.pageY - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset), - left: (el.pageX + settings.xOffset) - }) - }); - } - - // check if click feature is enabled - if(tipContent && settings.clickIt){ - // Activate on click - obj.click(function(el){ - if (!settings.tipContent) { - obj.attr({title: ''}); - } - -// $('.' + settings.toolTipClass).remove(); - $('.' + settings.toolTipClass).stop().fadeOut(settings.outSpeed, function(){$(this).remove();}); - - $('body').append("

"+ tipContent +"

close
"); - $('.' + settings.toolTipClass).css({ - position: 'absolute', - display: 'none', - zIndex: '50000', -// top: (obj.offset().top - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset) + 'px', -// left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' - top: (obj.offset().top - settings.yOffset) + 'px', - left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' - }) - .fadeIn(settings.inSpeed); - // Click to close tooltip - $('.' + settings.closeTipBtn).click(function(){ - $('.' + settings.toolTipClass).fadeOut(settings.outSpeed, function(){$(this).remove();}); - return false; - }); - return false; - }); - } - - }); // END: return this - - // returns the jQuery object to allow for chainability. - return this; - }; +/* + jQuery Version: jQuery 1.3.2 + Plugin Name: aToolTip V 1.0 + Plugin by: Ara Abcarians: http://ara-abcarians.com + License: aToolTip is licensed under a Creative Commons Attribution 3.0 Unported License + Read more about this license at --> http://creativecommons.org/licenses/by/3.0/ + Modified: Murat Purc , 2010-01-28: Position clickable tooltip on right side, + remove previous opened tooltip + +Creates following node: +----------------------- +
+
+

+ Content + close +
+
+ +*/ +(function($) { + $.fn.aToolTip = function(options) { + + // setup default settings + var defaults = { + clickIt: false, + closeTipBtn: 'aToolTipCloseBtn', + fixed: false, + inSpeed: 400, + outSpeed: 100, + tipContent: '', + toolTipClass: 'aToolTip', + xOffset: 0, + yOffset: 0 + }, + + // This makes it so the users custom options overrides the default ones + settings = $.extend({}, defaults, options); + + return this.each(function() { + var obj = $(this); + // Decide weather to use a title attr as the tooltip content + if (obj.attr('title') && !settings.tipContent) { + // set the tooltip content/text to be the obj title attribute + var tipContent = obj.attr('title'); + } else { + // if no title attribute set it to the tipContent option in settings + var tipContent = settings.tipContent; + } + + // check if obj has a title attribute and if click feature is off + if(tipContent && !settings.clickIt){ + // Activate on hover + obj.hover(function(el){ + obj.attr({title: ''}); + $('body').append("

"+ tipContent +"

"); + $('.' + settings.toolTipClass).css({ + position: 'absolute', + display: 'none', + zIndex: '50000', + top: (obj.offset().top - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset) + 'px', + left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' + }) + .stop().fadeIn(settings.inSpeed); + }, + function(){ + // Fade out + $('.' + settings.toolTipClass).stop().fadeOut(settings.outSpeed, function(){$(this).remove();}); + }); + } + + // Follow mouse if fixed is false and click is false + if(!settings.fixed && !settings.clickIt){ + obj.mousemove(function(el){ + $('.' + settings.toolTipClass).css({ + top: (el.pageY - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset), + left: (el.pageX + settings.xOffset) + }) + }); + } + + // check if click feature is enabled + if(tipContent && settings.clickIt){ + // Activate on click + obj.click(function(el){ + if (!settings.tipContent) { + obj.attr({title: ''}); + } + +// $('.' + settings.toolTipClass).remove(); + $('.' + settings.toolTipClass).stop().fadeOut(settings.outSpeed, function(){$(this).remove();}); + + $('body').append("

"+ tipContent +"

close
"); + $('.' + settings.toolTipClass).css({ + position: 'absolute', + display: 'none', + zIndex: '50000', +// top: (obj.offset().top - $('.' + settings.toolTipClass).outerHeight() - settings.yOffset) + 'px', +// left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' + top: (obj.offset().top - settings.yOffset) + 'px', + left: (obj.offset().left + obj.outerWidth() + settings.xOffset) + 'px' + }) + .fadeIn(settings.inSpeed); + // Click to close tooltip + $('.' + settings.closeTipBtn).click(function(){ + $('.' + settings.toolTipClass).fadeOut(settings.outSpeed, function(){$(this).remove();}); + return false; + }); + return false; + }); + } + + }); // END: return this + + // returns the jQuery object to allow for chainability. + return this; + }; })(jQuery); \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.min.jquery.js b/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.min.jquery.js index c6a8c46..626b478 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.min.jquery.js +++ b/conlite/plugins/mod_rewrite/external/aToolTip/js/atooltip.min.jquery.js @@ -1,2 +1,2 @@ -/*Plugin by: Ara Abcarians: http://ara-abcarians.com License: http://creativecommons.org/licenses/by/3.0/ */ +/*Plugin by: Ara Abcarians: http://ara-abcarians.com License: http://creativecommons.org/licenses/by/3.0/ */ eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(2($){$.O.w=2(d){8 e={9:f,q:\'P\',x:f,r:Q,s:R,y:\'\',1:\'w\',g:5,h:5},0=$.S({},e,d);i 3.T(2(){8 b=$(3);j(b.k(\'l\')){8 c=b.k(\'l\')}U{8 c=0.y}j(c&&!0.9){b.V(2(a){b.k({l:\'\'});$(\'z\').t("

"+c+"

");$(\'.\'+0.1).u({B:\'C\',D:\'E\',F:\'G\',6:(b.n().6-$(\'.\'+0.1).v()-0.h)+\'o\',7:(b.n().7+b.H()+0.g)+\'o\'}).I().J(0.r)},2(){$(\'.\'+0.1).I().K(0.s,2(){$(3).L()})})}j(!0.x&&!0.9){b.W(2(a){$(\'.\'+0.1).u({6:(a.X-$(\'.\'+0.1).v()-0.h),7:(a.Y+0.g)})})}j(c&&0.9){b.M(2(a){b.k({l:\'\'});$(\'z\').t("

"+c+"

");$(\'.\'+0.1).t("N");$(\'.\'+0.1).u({B:\'C\',D:\'E\',F:\'G\',6:(b.n().6-$(\'.\'+0.1).v()-0.h)+\'o\',7:(b.n().7+b.H()+0.g)+\'o\'}).J(0.r);$(\'.\'+0.q).M(2(){$(\'.\'+0.1).K(0.s,2(){$(3).L()});i f});i f})}});i 3}})(11);',62,64,'settings|toolTipClass|function|this|class||top|left|var|clickIt||||||false|xOffset|yOffset|return|if|attr|title|div|offset|px||closeTipBtn|inSpeed|outSpeed|append|css|outerHeight|aToolTip|fixed|tipContent|body|aToolTipContent|position|absolute|display|none|zIndex|50000|outerWidth|stop|fadeIn|fadeOut|remove|click|close|fn|aToolTipCloseBtn|400|100|extend|each|else|hover|mousemove|pageY|pageX|href|alt|jQuery'.split('|'),0,{})) \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/external/aToolTip/js/jquery.min.js b/conlite/plugins/mod_rewrite/external/aToolTip/js/jquery.min.js index b1ae21d..55c2e6d 100644 --- a/conlite/plugins/mod_rewrite/external/aToolTip/js/jquery.min.js +++ b/conlite/plugins/mod_rewrite/external/aToolTip/js/jquery.min.js @@ -1,19 +1,19 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ +/* + * jQuery JavaScript Library v1.3.2 + * http://jquery.com/ + * + * Copyright (c) 2009 John Resig + * Dual licensed under the MIT and GPL licenses. + * http://docs.jquery.com/License + * + * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) + * Revision: 6246 + */ +(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
"]||!O.indexOf("",""]||(!O.indexOf("",""]||!O.indexOf("",""]||!o.support.htmlSerialize&&[1,"div
","
"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); +/* + * Sizzle CSS Selector Engine - v0.9.3 + * Copyright 2009, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * More information: http://sizzlejs.com/ + */ (function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/files/htaccess_restrictive.txt b/conlite/plugins/mod_rewrite/files/htaccess_restrictive.txt index d2eeede..4aa70d9 100644 --- a/conlite/plugins/mod_rewrite/files/htaccess_restrictive.txt +++ b/conlite/plugins/mod_rewrite/files/htaccess_restrictive.txt @@ -1,71 +1,69 @@ -################################################################################ -# Contenido AMR plugin restrictive rewrite rules set. -# -# Contains strict rules, each rewrite exclusion must be set manually. -# - Exclude requests to directories usage/, contenido/, setup/, cms/upload/ -# - Exclude requests to cms/front_content.php -# - Pass thru requests to common ressources (pictures, movies, js, css, pdf) -# -# @version 0.0.1 -# @author Murat Purc -# @copyright four for business AG -# @license http://www.contenido.org/license/LIZENZ.txt -# @link http://www.4fb.de -# @link http://www.contenido.org -# @since file available since Contenido release 4.8.15 -# -# $Id: htaccess_restrictive.txt 447 2016-07-08 14:04:12Z oldperl $ -################################################################################ - - -# Enable following lines to run PHP5 on 1und1.de (1and1.com) -#AddType x-mapp-php5 .php -#AddHandler x-mapp-php5 .php - - - - # Enable rewrite engine - RewriteEngine on - - - # Specify a base URL-path for the rules - RewriteBase /cms - - - # Catch some common exploits in query string to get rid of them. - # NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could - # be a disadvantage in some cases. - RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] - RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR] - RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC] - RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana - - - # Exclude some files and directories from rewriting - RewriteRule ^usage/.*$ - [L] - RewriteRule ^conlite/.*$ - [L] - RewriteRule ^setup/.*$ - [L] - RewriteRule ^cms/upload/.*$ - [L] - RewriteRule ^cms/test/.*$ - [L] - RewriteRule ^cms/front_content.php.*$ - [L] - - - # One RewriteRule to rule them all. - # Exclude common extensions from rewriting and pass remaining requests to - # front_content.php. - RewriteRule !\.(avi|css|doc|flv|gif|gzip|ico|jpeg|jpg|js|mov|mp3|pdf|png|ppt|rar|txt|wav|wmv|xml|zip)$ front_content.php [NC,QSA,L] - - - - -# Some rules to compress files. -# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate -# for some file types can help to reduce bandwith. - - - SetOutputFilter DEFLATE - - +################################################################################ +# CONTENIDO AMR plugin restrictive rewrite rules set. +# +# Contains strict rules, each rewrite exclusion must be set manually. +# - Exclude requests to directories usage/, contenido/, setup/, cms/upload/ +# - Exclude requests to cms/front_content.php +# - Pass thru requests to common ressources (pictures, movies, js, css, pdf) +# +# @version 0.0.1 +# @author Murat Purc +# @copyright four for business AG +# @license http://www.contenido.org/license/LIZENZ.txt +# @link http://www.4fb.de +# @link http://www.contenido.org +# +# $Id: htaccess_restrictive.txt 3503 2012-10-19 19:49:39Z xmurrix $ +################################################################################ + + +# Enable following lines to run PHP5 on 1und1.de (1and1.com) +#AddType x-mapp-php5 .php +#AddHandler x-mapp-php5 .php + + + + # Enable rewrite engine + RewriteEngine on + + + # Specify a base URL-path for the rules + RewriteBase /cms + + + # Catch some common exploits in query string to get rid of them. + # NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could + # be a disadvantage in some cases. + RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] + RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR] + RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC] + RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana + + + # Exclude some files and directories from rewriting + RewriteRule ^usage/.*$ - [L] + RewriteRule ^conlite/.*$ - [L] + RewriteRule ^setup/.*$ - [L] + RewriteRule ^cms/upload/.*$ - [L] + RewriteRule ^cms/test/.*$ - [L] + RewriteRule ^cms/front_content.php.*$ - [L] + + + # Exclude common extensions from rewriting and pass remaining requests to + # front_content.php. + RewriteRule !\.(avi|css|doc|flv|gif|gzip|ico|jpeg|jpg|js|mov|mp3|pdf|png|ppt|rar|swf|txt|wav|wmv|xml|zip)$ front_content.php [NC,QSA,L] + + + + +# Some rules to compress files. +# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate +# for some file types can help to reduce bandwith. + + + SetOutputFilter DEFLATE + + diff --git a/conlite/plugins/mod_rewrite/files/htaccess_simple.txt b/conlite/plugins/mod_rewrite/files/htaccess_simple.txt index 5c22ca9..c242442 100644 --- a/conlite/plugins/mod_rewrite/files/htaccess_simple.txt +++ b/conlite/plugins/mod_rewrite/files/htaccess_simple.txt @@ -1,69 +1,69 @@ -################################################################################ -# Contenido AMR plugin simple rewrite rules set. -# -# Contains few easy to handle rewrite rules. -# -# @version 0.0.1 -# @author Murat Purc -# @copyright four for business AG -# @license http://www.contenido.org/license/LIZENZ.txt -# @link http://www.4fb.de -# @link http://www.contenido.org -# @since file available since Contenido release 4.8.15 -# -# $Id: htaccess_simple.txt 2 2011-07-20 12:00:48Z oldperl $ -################################################################################ - - -# Enable following lines to run PHP5 on 1und1.de (1and1.com) -#AddType x-mapp-php5 .php -#AddHandler x-mapp-php5 .php - - - - # Enable rewrite engine - RewriteEngine on - - - # Specify a base URL-path for the rules - RewriteBase /cms - - - # Catch some common exploits in query string to get rid of them - # NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could - # be a disadvantage in some cases - RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR] - RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] - RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR] - RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC] - RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana - - - # Rewrite request to root to front_content.php - RewriteRule ^$ front_content.php [QSA,L] - - - # Exclude following request from rewriting - # tests for valid symlinks (-s), not empty files (-l) and folders (-d) - RewriteCond %{REQUEST_FILENAME} -s [OR] - RewriteCond %{REQUEST_FILENAME} -l [OR] - RewriteCond %{REQUEST_FILENAME} -d - RewriteRule ^.*$ - [NC,L] - - - # Pass other requests to front_content.php - RewriteRule ^.*$ front_content.php [QSA,NC,L] - - - - -# Some rules to compress files. -# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate -# for some file types can help to reduce bandwith. - - - SetOutputFilter DEFLATE - - +################################################################################ +# CONTENIDO AMR plugin simple rewrite rules set. +# +# Contains few easy to handle rewrite rules. +# +# @version 0.0.1 +# @author Murat Purc +# @copyright four for business AG +# @license http://www.contenido.org/license/LIZENZ.txt +# @link http://www.4fb.de +# @link http://www.contenido.org +# +# $Id: htaccess_simple.txt 3503 2012-10-19 19:49:39Z xmurrix $ +################################################################################ + + +# Enable following lines to run PHP5 on 1und1.de (1and1.com) +#AddType x-mapp-php5 .php +#AddHandler x-mapp-php5 .php + + + + # Enable rewrite engine + RewriteEngine on + + + # Specify a base URL-path for the rules + RewriteBase /cms + + + # Catch some common exploits in query string to get rid of them + # NOTE: Conditions to prevent protocols (ftp, http[s]) in query string could + # be a disadvantage in some cases + RewriteCond %{QUERY_STRING} contenido_path=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} cfg\[path\]=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} _PHPLIB\[libdir\]=.*$ [NC,OR] + RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR] + RewriteCond %{QUERY_STRING} ftp://.*$ [NC,OR] + RewriteCond %{QUERY_STRING} http[s]*://.*$ [NC] + RewriteRule ^.* - [F,L] # all matching conditions from above will end in nirvana + + + # Rewrite request to root to front_content.php + RewriteRule ^$ front_content.php [QSA,L] + + + # Exclude following request from rewriting + # tests for favicon.ico, valid symlinks (-s), not empty files (-l) and folders (-d) + RewriteCond %{REQUEST_URI} ^/favicon.ico$ [OR] + RewriteCond %{REQUEST_FILENAME} -s [OR] + RewriteCond %{REQUEST_FILENAME} -l [OR] + RewriteCond %{REQUEST_FILENAME} -d + RewriteRule ^.*$ - [NC,L] + + + # Pass other requests to front_content.php + RewriteRule ^.*$ front_content.php [QSA,NC,L] + + + + +# Some rules to compress files. +# NOTE: Following settings are not mod rewrite specific, but enabling mod_deflate +# for some file types can help to reduce bandwith. + + + SetOutputFilter DEFLATE + + diff --git a/conlite/plugins/mod_rewrite/includes/config.mod_rewrite_default.php b/conlite/plugins/mod_rewrite/includes/config.mod_rewrite_default.php index ec7ac1a..3a60a7f 100644 --- a/conlite/plugins/mod_rewrite/includes/config.mod_rewrite_default.php +++ b/conlite/plugins/mod_rewrite/includes/config.mod_rewrite_default.php @@ -1,128 +1,114 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-05-xx - * - * $Id: config.mod_rewrite_default.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -global $cfg; - -// Use advanced mod_rewrites ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use'] = 0; - -// Path to the htaccess file with trailling slash from domain-root! -$cfg['mod_rewrite']['rootdir'] = '/'; - -// Check path to the htaccess file ( 1 = yes, 0 = none ) -$cfg['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; - -// Prevent Duplicated Content, if startfromroot is enabled ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['prevent_duplicated_content'] = 0; - -// is multilanguage? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_language'] = 0; - -// use language name in url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_language_name'] = 0; - -// is multiclient in only one directory? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_client'] = 0; - -// use client name in url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_client_name'] = 0; - -// use lowercase url? ( 1 = yes, 0 = none ) -$cfg['mod_rewrite']['use_lowercase_uri'] = 1; - -// file extension for article links -$cfg['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'; - -// Add start article name to url (1 = yes, 0 = none) -$cfg['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'; - -// 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; - -// 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; - - -// Following five settings write urls like this one: -// www.domain.de/category1-category2.articlename.html -// Changes of these settings causes a reset of all aliases, see Advanced Mod Rewrite settings in -// backend. -// NOTE: category_seperator and article_seperator must contain different character. - -// Separator for categories -$cfg['mod_rewrite']['category_seperator'] = '/'; - -// Separator between category and article -$cfg['mod_rewrite']['article_seperator'] = '/'; - -// Word seperator in category names -$cfg['mod_rewrite']['category_word_seperator'] = '-'; - -// Word seperator in article names -$cfg['mod_rewrite']['article_word_seperator'] = '-'; - - -// Routing settings for incomming urls. Here you can define routing rules as follows: -// $cfg['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(); - - -// Redirect invalid articles to errorpage (1 = yes, 0 = none) -$cfg['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + + +global $cfg; + +// Use advanced mod_rewrites ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use'] = 0; + +// Path to the htaccess file with trailling slash from domain-root! +$cfg['mod_rewrite']['rootdir'] = '/'; + +// Check path to the htaccess file ( 1 = yes, 0 = none ) +$cfg['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; + +// Prevent Duplicated Content, if startfromroot is enabled ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['prevent_duplicated_content'] = 0; + +// is multilanguage? ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use_language'] = 0; + +// use language name in url? ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use_language_name'] = 0; + +// is multiclient in only one directory? ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use_client'] = 0; + +// use client name in url? ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use_client_name'] = 0; + +// use lowercase url? ( 1 = yes, 0 = none ) +$cfg['mod_rewrite']['use_lowercase_uri'] = 1; + +// file extension for article links +$cfg['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'; + +// Add start article name to url (1 = yes, 0 = none) +$cfg['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'; + +// 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; + +// 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; + + +// Following five settings write urls like this one: +// www.domain.de/category1-category2.articlename.html +// Changes of these settings causes a reset of all aliases, see Advanced Mod Rewrite settings in +// backend. +// NOTE: category_seperator and article_seperator must contain different character. +// Separator for categories +$cfg['mod_rewrite']['category_seperator'] = '/'; + +// Separator between category and article +$cfg['mod_rewrite']['article_seperator'] = '/'; + +// Word seperator in category names +$cfg['mod_rewrite']['category_word_seperator'] = '-'; + +// Word seperator in article names +$cfg['mod_rewrite']['article_word_seperator'] = '-'; + + +// Routing settings for incomming urls. Here you can define routing rules as follows: +// $cfg['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(); + + +// Redirect invalid articles to errorpage (1 = yes, 0 = none) +$cfg['mod_rewrite']['redirect_invalid_article_to_errorsite'] = 0; + diff --git a/conlite/plugins/mod_rewrite/includes/config.plugin.php b/conlite/plugins/mod_rewrite/includes/config.plugin.php index 96060d7..34f3819 100644 --- a/conlite/plugins/mod_rewrite/includes/config.plugin.php +++ b/conlite/plugins/mod_rewrite/includes/config.plugin.php @@ -1,178 +1,167 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-05-xx - * - * $Id: config.plugin.php 275 2013-09-11 12:49:00Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -#################################################################################################### -/** - * Chain Contenido.Frontend.CreateURL - * This chain is called inside some scripts (front_content.php) to create urls. - * - * @todo: Is added to provide downwards compatibility for the amr plugin. - * There is no need for this chain since Contenido 4.8.9 contains its own Url building feature. - * @deprecated - * - * Parameters & order: - * string URL including parameter value pairs - * - * Returns: - * string Returns modified URL - */ -$_cecRegistry->registerChain("Contenido.Frontend.CreateURL", "string"); -#################################################################################################### - - -global $cfg, $contenido, $mr_statics; - -// used for caching -$mr_statics = array(); - -// initialize client id -if (isset($client) && (int) $client > 0) { - $clientId = (int) $client; -} elseif (isset($load_client) && (int) $load_client > 0) { - $clientId = (int) $load_client; -} else { - $clientId = ''; -} - - -// include necessary sources -plugin_include('mod_rewrite', 'classes/class.modrewritedebugger.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'); - - -// set debug configuration -if (isset($contenido)) { - ModRewriteDebugger::setEnabled(true); -} else { - ModRewriteDebugger::setEnabled(false); -} - -// initialize mr plugin -ModRewrite::initialize($clientId); - -if (ModRewrite::isEnabled()) { - - $aMrCfg = ModRewrite::getConfig(); - - $_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 category sync function to Contenido Extension Chainer - $_cecRegistry->addChainFunction('Contenido.Category.strSyncCategory_Loop', 'mr_strSyncCategory'); - - // 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($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 - // @deprecated - $_cecRegistry->addChainFunction('Contenido.Frontend.CreateURL', 'mr_buildNewUrl'); - - // overwrite url builder configuration with own url builder - $cfg['url_builder']['name'] = 'MR'; - $cfg['config'] = array(); - 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'); - } else { - // Fallback solution: Add url rewriting at code generation to Contenido Extension Chainer - $_cecRegistry->addChainFunction('Contenido.Content.conGenerateCode', 'mr_buildGeneratedCode'); - } - } - -} - -if (isset($contenido) && isset($area) && $area == 'mod_rewrite_test') { - // configure url builder to enable it on test page - $cfg['url_builder']['name'] = 'MR'; - $cfg['config'] = array(); - Contenido_UrlBuilderConfig::setConfig($cfg['url_builder']); - ModRewrite::setEnabled(true); -} - -unset($clientId, $options); - -// administration > users > area translations -global $lngAct, $_cecRegistry; -$lngAct['mod_rewrite']['mod_rewrite'] = i18n("MR-Options", "mod_rewrite"); -$lngAct['mod_rewrite']['mod_rewrite_expert'] = i18n("Expert Options", "mod_rewrite"); -$lngAct['mod_rewrite']['mod_rewrite_test'] = i18n("MR Test Area", "mod_rewrite"); + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +global $_cecRegistry, $cfg, $contenido, $area, $client, $load_client; + +#################################################################################################### +/** + * Chain Contenido.Frontend.CreateURL + * This chain is called inside some scripts (front_content.php) to create urls. + * + * @todo: Is added to provide downwards compatibility for the amr plugin. + * There is no need for this chain since CONTENIDO 4.8.9 contains its own Url building feature. + * @deprecated + * + * Parameters & order: + * string URL including parameter value pairs + * + * Returns: + * string Returns modified URL + */ +$_cecRegistry->registerChain("Contenido.Frontend.CreateURL", "string"); +#################################################################################################### +// initialize client id +if (isset($client) && (int) $client > 0) { + $clientId = (int) $client; +} elseif (isset($load_client) && (int) $load_client > 0) { + $clientId = (int) $load_client; +} else { + $clientId = ''; +} + + +// 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'); + + +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"); + + +// set debug configuration +if (isset($contenido)) { + ModRewriteDebugger::setEnabled(true); +} else { + ModRewriteDebugger::setEnabled(false); +} + +// initialize mr plugin +ModRewrite::initialize($clientId); + +if (ModRewrite::isEnabled()) { + + $aMrCfg = ModRewrite::getConfig(); + + $_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 category sync function to CONTENIDO Extension Chainer + $_cecRegistry->addChainFunction('Contenido.Category.strSyncCategory_Loop', 'mr_strSyncCategory'); + + // 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($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 + // @deprecated + $_cecRegistry->addChainFunction('Contenido.Frontend.CreateURL', 'mr_buildNewUrl'); + + // overwrite url builder configuration with own url builder + $cfg['url_builder']['name'] = 'MR'; + $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'); + } else { + // Fallback solution: Add url rewriting at code generation to CONTENIDO Extension Chainer + $_cecRegistry->addChainFunction('Contenido.Content.conGenerateCode', 'mr_buildGeneratedCode'); + } + } +} + +if (isset($contenido) && isset($area) && $area == 'mod_rewrite_test') { + // configure url builder to enable it on test page + $cfg['url_builder']['name'] = 'MR'; + $cfg['config'] = array(); + Contenido_UrlBuilderConfig::setConfig($cfg['url_builder']); + ModRewrite::setEnabled(true); +} + +unset($clientId, $options); diff --git a/conlite/plugins/mod_rewrite/includes/front_content_controller.php b/conlite/plugins/mod_rewrite/includes/front_content_controller.php index 3448153..453f65c 100644 --- a/conlite/plugins/mod_rewrite/includes/front_content_controller.php +++ b/conlite/plugins/mod_rewrite/includes/front_content_controller.php @@ -1,115 +1,102 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-05-xx - * - * $Id: front_content_controller.php 220 2013-02-14 08:40:43Z Mansveld $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -global $client, $changeclient, $cfgClient, $lang, $changelang, $idart, $idcat, $path; - -ModRewriteDebugger::add(ModRewrite::getConfig(), 'front_content_controller.php mod rewrite config'); - - -// create an mod rewrite controller instance and execute processing -$oMRController = new ModRewriteController($_SERVER['REQUEST_URI']); -$oMRController->execute(); - -if ($oMRController->errorOccured()) { - - // an error occured (idcat and or idart couldn't catched by controller) - - $iRedirToErrPage = ModRewrite::getConfig('redirect_invalid_article_to_errorsite', 0); - // try to redirect to errorpage if desired - if ($iRedirToErrPage == 1 && (int) $client > 0 && (int) $lang > 0) { - global $errsite_idcat, $errsite_idart; - - if ($cfgClient['set'] != 'set') { - rereadClients(); - } - - // errorpage - $aParams = array( - 'client' => $client, 'idcat' => $errsite_idcat[$client], 'idart' => $errsite_idart[$client], - 'lang' => $lang, 'error'=> '1' - ); - $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams); - header("HTTP/1.0 404 Not found"); - mr_header($errsite); - exit(); - } - -} else { - - // set some global variables - - if ($oMRController->getClient()) { - $client = $oMRController->getClient(); - } - - if ($oMRController->getChangeClient()) { - $changeclient = $oMRController->getChangeClient(); - } - - if ($oMRController->getLang()) { - $lang = $oMRController->getLang(); - } - - if ($oMRController->getChangeLang()) { - $changelang = $oMRController->getChangeLang(); - } - - if ($oMRController->getIdArt()) { - $idart = $oMRController->getIdArt(); - } - - if ($oMRController->getIdCat()) { - $idcat = $oMRController->getIdCat(); - } - - if ($oMRController->getPath()) { - $path = $oMRController->getPath(); - } - -} - -// some debugs -ModRewriteDebugger::add($mr_preprocessedPageError, 'mr $mr_preprocessedPageError', __FILE__); -ModRewriteDebugger::add($idart, 'mr $idart', __FILE__); -ModRewriteDebugger::add($idcat, 'mr $idcat', __FILE__); -ModRewriteDebugger::add($lang, 'mr $lang', __FILE__); -ModRewriteDebugger::add($client, 'mr $client', __FILE__); - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + + +global $client, $changeclient, $cfgClient, $lang, $changelang, $idart, $idcat, $path, $mr_preprocessedPageError; + +ModRewriteDebugger::add(ModRewrite::getConfig(), 'front_content_controller.php mod rewrite config'); + + +// create an mod rewrite controller instance and execute processing +$oMRController = new ModRewriteController($_SERVER['REQUEST_URI']); +$oMRController->execute(); + +if ($oMRController->errorOccured()) { + + // an error occured (idcat and or idart couldn't catched by controller) + + $iRedirToErrPage = ModRewrite::getConfig('redirect_invalid_article_to_errorsite', 0); + // try to redirect to errorpage if desired + if ($iRedirToErrPage == 1 && (int) $client > 0 && (int) $lang > 0) { + global $errsite_idcat, $errsite_idart; + + if ($cfgClient['set'] != 'set') { + rereadClients(); + } + + // errorpage + $aParams = array( + 'client' => $client, 'idcat' => $errsite_idcat[$client], 'idart' => $errsite_idart[$client], + 'lang' => $lang, 'error' => '1' + ); + $errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams); + mr_header($errsite); + exit(); + } +} else { + + // set some global variables + + if ($oMRController->getClient()) { + $client = $oMRController->getClient(); + } + + if ($oMRController->getChangeClient()) { + $changeclient = $oMRController->getChangeClient(); + } + + if ($oMRController->getLang()) { + $lang = $oMRController->getLang(); + } + + if ($oMRController->getChangeLang()) { + $changelang = $oMRController->getChangeLang(); + } + + if ($oMRController->getIdArt()) { + $idart = $oMRController->getIdArt(); + } + + if ($oMRController->getIdCat()) { + $idcat = $oMRController->getIdCat(); + } + + if ($oMRController->getPath()) { + $path = $oMRController->getPath(); + } +} + +// some debugs +ModRewriteDebugger::add($mr_preprocessedPageError, 'mr $mr_preprocessedPageError', __FILE__); +if ($oMRController->getError()) { + ModRewriteDebugger::add($oMRController->getError(), 'mr error', __FILE__); +} +ModRewriteDebugger::add($idart, 'mr $idart', __FILE__); +ModRewriteDebugger::add($idcat, 'mr $idcat', __FILE__); +ModRewriteDebugger::add($lang, 'mr $lang', __FILE__); +ModRewriteDebugger::add($client, 'mr $client', __FILE__); + diff --git a/conlite/plugins/mod_rewrite/includes/functions.mod_rewrite.php b/conlite/plugins/mod_rewrite/includes/functions.mod_rewrite.php index b228e96..d3703b7 100644 --- a/conlite/plugins/mod_rewrite/includes/functions.mod_rewrite.php +++ b/conlite/plugins/mod_rewrite/includes/functions.mod_rewrite.php @@ -1,967 +1,912 @@ - - * @copyright � www.polycoder.de - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2004-12-04 - * modified 2005-12-18 - * - * $Id: functions.mod_rewrite.php 391 2015-11-09 21:12:36Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -/** - * Processes mod_rewrite related job for created new tree. - * - * Will be called by chain 'Contenido.Action.str_newtree.AfterCall'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strNewTree(array $data) -{ - global $lang; - - ModRewriteDebugger::log($data, 'mr_strNewTree $data'); - - if ((int) $data['newcategoryid'] > 0) { - $mrCatAlias = (trim($data['categoryalias']) !== '') ? trim($data['categoryalias']) : trim($data['categoryname']); - // set new urlname - because original set urlname isn''t validated for double entries in same parent category - ModRewrite::setCatWebsafeName($mrCatAlias, $data['newcategoryid'], $lang); - ModRewrite::setCatUrlPath($data['newcategoryid'], $lang); - } - - return $data; -} - - -/** - * Processes mod_rewrite related job for created new category. - * - * Will be called by chain 'Contenido.Action.str_newcat.AfterCall'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strNewCategory(array $data) -{ - global $lang; - - ModRewriteDebugger::log($data, 'mr_strNewCategory $data'); - - if ((int) $data['newcategoryid'] > 0) { - $mrCatAlias = (trim($data['categoryalias']) !== '') ? trim($data['categoryalias']) : trim($data['categoryname']); - // set new urlname - because original set urlname isn''t validated for double entries in same parent category - ModRewrite::setCatWebsafeName($mrCatAlias, $data['newcategoryid'], $lang); - ModRewrite::setCatUrlPath($data['newcategoryid'], $lang); - } - - return $data; -} - - -/** - * Processes 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 - * - * Will be called by chain 'Contenido.Action.str_renamecat.AfterCall'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strRenameCategory(array $data) -{ - ModRewriteDebugger::log($data, 'mr_strRenameCategory $data'); - - // hes 20100102 - // maximal 50 recursion level - $recursion = (is_int($data['recursion'])) ? $data['recursion'] : 1; - if ($recursion > 50) { - exit("#20100201-1503: sorry - maximum function nesting level of ".$recursion." reached"); - } - - $mrCatAlias = (trim($data['newcategoryalias']) !== '') ? trim($data['newcategoryalias']) : trim($data['newcategoryname']); - if ($mrCatAlias != '') { - // set new urlname - because original set urlname isn''t validated for double entries in same parent category - ModRewrite::setCatWebsafeName($mrCatAlias, $data['idcat'], $data['lang']); - ModRewrite::setCatUrlPath($data['idcat'], $data['lang']); - } - - // hes 20100102 - // now dive into all existing subcategories and modify their paths too... - $str = 'parentid=' . $data['idcat']; - $oCatColl = new cApiCategoryCollection($str); - - while ($oCat = $oCatColl->next()) { - // hes 20100102 - $str = 'idcat=' . $oCat->get('idcat') . ' AND idlang=' . (int) $data['lang']; - $oCatLanColl = new cApiCategoryLanguageCollection($str); - $oCatLan = $oCatLanColl->next(); - - // hes 20100102 - $childData = array( - 'idcat' => $oCat->get('idcat'), - 'lang' => (int) $data['lang'], - 'newcategoryname' => $oCatLan->get('name'), - 'newcategoryalias' => $oCatLan->get('urlname'), - 'recursion' => $recursion + 1 - ); - - $resData = mr_strRenameCategory($childData); - } - - return $data; -} - - -/** - * Processes mod_rewrite related job after moving a category up. - * - * Will be called by chain 'Contenido.Action.str_moveupcat.AfterCall'. - * - * @todo do we really need processing of the category? there is no mr relevant data - * changes while moving the category on same level, level and name won't change - * - * @param int $idcat Category id - * @return int Category id - */ -function mr_strMoveUpCategory($idcat) -{ - ModRewriteDebugger::log($idcat, 'mr_strMoveUpCategory $idcat'); - - // category check - $cat = new cApiCategory((int) $idcat); - if (!$cat->get('preid')) { - return; - } - - // get all cat languages - $aIdLang = ModRewrite::getCatLanguages($idcat); - - // update ... - foreach ($aIdLang as $iIdLang) { - // get urlname - $sCatname = ModRewrite::getCatName($idcat, $iIdLang); - // set new urlname - because original set urlname isn't validated for double entries in same parent category - ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); - } - - return $idcat; -} - - -/** - * Processes mod_rewrite related job after moving a category down. - * - * Will be called by chain 'Contenido.Action.str_movedowncat.AfterCall'. - * - * @todo do we really need processing of the category? there is no mr relevant data - * changes while moving the category on same level, level and name won't change - * - * @param int $idcat Id of category beeing moved down - * @return int Category id - */ -function mr_strMovedownCategory($idcat) -{ - ModRewriteDebugger::log($idcat, 'mr_strMovedownCategory $idcat'); - - // category check - $cat = new cApiCategory((int) $idcat); - if (!$cat->get('id')) { - return; - } - - // get all cat languages - $aIdLang = ModRewrite::getCatLanguages($idcat); - // update ... - foreach ($aIdLang as $iIdLang) { - // get urlname - $sCatname = ModRewrite::getCatName($idcat, $iIdLang); - // set new urlname - because original set urlname isn't validated for double entries in same parent category - ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); - } - - return $idcat; -} - - -/** - * Processes mod_rewrite related job after moving a category subtree. - * - * Will be called by chain 'Contenido.Action.str_movesubtree.AfterCall'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strMoveSubtree(array $data) -{ - ModRewriteDebugger::log($data, 'mr_strMoveSubtree $data'); - - // category check - if ((int) $data['idcat'] <= 0) { - return; - } - - // next category check - $cat = new cApiCategory($data['idcat']); - if (!$cat->get('idcat')) { - return; - } - - // get all cat languages - $aIdLang = ModRewrite::getCatLanguages($data['idcat']); - // update all languages - foreach ($aIdLang as $iIdLang) { - // get urlname - $sCatname = ModRewrite::getCatName($data['idcat'], $iIdLang); - // set new urlname - because original set urlname isn't validated for double entries in same parent category - ModRewrite::setCatWebsafeName($sCatname, $data['idcat'], $iIdLang); - ModRewrite::setCatUrlPath($data['idcat'], $iIdLang); - } - - // now dive into all existing subcategories and modify their paths too... - $oCatColl = new cApiCategoryCollection('parentid=' . $data['idcat']); - while ($oCat = $oCatColl->next()) { - mr_strMoveSubtree(array('idcat' => $oCat->get('idcat'))); - } - - return $data; -} - - -/** - * Processes mod_rewrite related job after copying a category subtree. - * - * Will be called by chain 'Contenido.Category.strCopyCategory'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strCopyCategory(array $data) -{ - ModRewriteDebugger::log($data, 'mr_strCopyCategory $data'); - - $idcat = (int) $data['newcat']->get('idcat'); - if ($idcat <= 0) { - return $data; - } - - // get all cat languages - $aIdLang = ModRewrite::getCatLanguages($idcat); - // update ... - foreach ($aIdLang as $iIdLang) { - // get urlname - $sCatname = ModRewrite::getCatName($idcat, $iIdLang); - // set new urlname - because original set urlname isn't validated for double entries in same parent category - ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); - ModRewrite::setCatUrlPath($idcat, $iIdLang); - } -} - - -/** - * Processes mod_rewrite related job during structure synchronisation process, - * sets the urlpath of current category. - * - * Will be called by chain 'Contenido.Category.strSyncCategory_Loop'. - * - * @param array $data Assoziative array with some values - * @return array Passed parameter - */ -function mr_strSyncCategory(array $data) -{ - ModRewriteDebugger::log($data, 'mr_strSyncCategory $data'); - ModRewrite::setCatUrlPath($data['idcat'], $data['idlang']); - return $data; -} - - -/** - * Processes mod_rewrite related job for saved articles (new or modified article). - * - * Will be called by chain 'Contenido.Action.con_saveart.AfterCall'. - * - * @param array $data Assoziative array with some article properties - * @return array Passed parameter - */ -function mr_conSaveArticle(array $data) -{ - global $tmp_firstedit, $client; - - ModRewriteDebugger::log($data, 'mr_conSaveArticle $data'); - - if ((int) $data['idart'] == 0) { - return $data; - } - - if (strlen(trim($data['urlname'])) == 0) { - $data['urlname'] = $data['title']; - } - - if (1 == $tmp_firstedit) { - // new article - $aLanguages = getLanguagesByClient($client); - - foreach ($aLanguages as $iLang) { - ModRewrite::setArtWebsafeName($data['urlname'], $data['idart'], $iLang, $data['idcat']); - } - } else { - // modified article - $aArticle = ModRewrite::getArtIdByArtlangId($data['idartlang']); - - if (isset($aArticle['idart']) && isset($aArticle['idlang'])) { - ModRewrite::setArtWebsafeName($data['urlname'], $aArticle['idart'], $aArticle['idlang'], $data['idcat']); - } - } - - return $data; -} - - -/** - * Processes mod_rewrite related job for articles beeing moved. - * - * Will be called by chain 'Contenido.Article.conMoveArticles_Loop'. - * - * @param array $data Assoziative array with record entries - * @return array Loop through of arguments - */ -function mr_conMoveArticles($data) -{ - ModRewriteDebugger::log($data, 'mr_conMoveArticles $data'); - - // too defensive but secure way - if (!is_array($data)) { - return $data; - } elseif (!isset($data['idartlang'])) { - return $data; - } elseif (!isset($data['idart'])) { - return $data; - } - - $arr_art = ModRewrite::getArtIds($data['idartlang']); - if (count($arr_art) == 2) { - ModRewrite::setArtWebsafeName($arr_art["urlname"], $data['idart'], $arr_art["idlang"]); - } - - return $data; -} - - -/** - * Processes mod_rewrite related job for duplicated articles. - * - * Will be called by chain 'Contenido.Article.conCopyArtLang_AfterInsert'. - * - * @param array $data Assoziative array with record entries - * @return array Loop through of arguments - */ -function mr_conCopyArtLang($data) -{ - ModRewriteDebugger::log($data, 'mr_conCopyArtLang $data'); - - // too defensive but secure way - if (!is_array($data)) { - return $data; - } elseif (!isset($data['title'])) { - return $data; - } elseif (!isset($data['idart'])) { - return $data; - } elseif (!isset($data['idlang'])) { - return $data; - } - - ModRewrite::setArtWebsafeName($data['title'], $data['idart'], $data['idlang']); - - return $data; -} - - -/** - * Processes mod_rewrite related job for synchronized articles. - * - * Will be called by chain 'Contenido.Article.conSyncArticle_AfterInsert'. - * - * @param array $data Assoziative array with record entries as follows: - * - * array( - * 'src_art_lang' => Recordset (assoziative array) of source item from con_art_lang table - * 'dest_art_lang' => Recordset (assoziative array) of inserted destination item from con_art_lang table - * ); - * - * - * @return array Loop through of argument - */ -function mr_conSyncArticle($data) -{ - ModRewriteDebugger::log($data, 'mr_conSyncArticle $data'); - - // too defensive but secure way - if (!is_array($data)) { - return $data; - } elseif (!isset($data['src_art_lang']) || !is_array($data['src_art_lang'])) { - return $data; - } elseif (!isset($data['dest_art_lang']) || !is_array($data['dest_art_lang'])) { - return $data; - } elseif (!isset($data['dest_art_lang']['idart'])) { - return $data; - } elseif (!isset($data['dest_art_lang']['idlang'])) { - return $data; - } - - if (!isset($data['src_art_lang']['urlname'])) { - $artLang = new cApiArticleLanguage($data['src_art_lang']['idartlang']); - $urlname = $artLang->get('urlname'); - } else { - $urlname = $data['src_art_lang']['urlname']; - } - - if ($urlname) { - ModRewrite::setArtWebsafeName($urlname, $data['dest_art_lang']['idart'], $data['dest_art_lang']['idlang']); - } - - return $data; -} - - -/** - * Works as a wrapper for Contenido_Url. - * - * Will also be called by chain 'Contenido.Frontend.CreateURL'. - * - * @todo: Still exists bcause of downwards compatibility (some other modules/plugins are using it) - * - * @param string $url URL to rebuild - * @return string New URL - */ -function mr_buildNewUrl($url) -{ - global $lang; - - ModRewriteDebugger::add($url, 'mr_buildNewUrl() in -> $url'); - - $oUrl = Contenido_Url::getInstance(); - $aUrl = $oUrl->parse($url); - - // add language, if not exists - if (!isset($aUrl['params']['lang'])) { - $aUrl['params']['lang'] = $lang; - } - - // build url - $newUrl = $oUrl->build($aUrl['params']); - - // add existing fragment - if (isset($aUrl['fragment'])) { - $newUrl .= '#' . $aUrl['fragment']; - } - - $arr['in'] = $url; - $arr['out'] = $newUrl; - ModRewriteDebugger::add($arr, 'mr_buildNewUrl() in -> out'); - - return $newUrl; -} - - -/** - * 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. - * - * @param string $code Code to prepare - * @return string New code - */ -function mr_buildGeneratedCode($code) -{ - global $client, $cfgClient; - - ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() in'); - - // mod rewrite is activated - if (ModRewrite::isEnabled()) { - $sseStarttime = getmicrotime(); - - // anchor hack - $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$arr_matches' , 'return ModRewrite::rewriteHtmlAnchor($arr_matches);'), - $code - ); - - // remove fucking tinymce single quote entities: - $code = str_replace("'", "'", $code); - - // get base uri - $sBaseUri = $cfgClient[$client]['path']['htmlpath']; - $sBaseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $sBaseUri); - - // IE hack with wrong base href interpretation - $code = preg_replace("/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/ie", "stripslashes('\\1{$sBaseUri}upload/\\2\\3')", $code); - - // define some preparations to replace /front_content.php & ./front_content.php - // against front_content.php, because urls should start with front_content.php - $aPattern = array( - '/([\"|\'|=])\/front_content\.php(.?|.+?)([\"|\'|>])/i', - '/([\"|\'|=])\.\/front_content\.php(.?|.+?)([\"|\'|>])/i' - ); - - $aReplace = array( - '\1front_content.php\2\3', - '\1front_content.php\2\3' - ); - - // perform the pre replacements - $code = preg_replace($aPattern, $aReplace, $code); - - // create url stack object and fill it with found urls... - $oMRUrlStack = ModRewriteUrlStack::getInstance(); - $oMRUrlStack->add('front_content.php'); - - preg_match_all("/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", $code, $matches, PREG_SET_ORDER); - foreach ($matches as $val) { - $oMRUrlStack->add('front_content.php' . $val[2]); - } - - // ok let it beginn, start mod rewrite class - $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 - ); - - ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() out'); - - $sseEndtime = getmicrotime(); - } else { - // anchor hack for non modrewrite websites - $code = preg_replace_callback( - "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", - create_function('$arr_matches' , 'return ModRewrite::contenidoHtmlAnchor($arr_matches, $GLOBALS["is_XHTML"]);'), - $code - ); - } - - ModRewriteDebugger::add(($sseEndtime - $sseStarttime), 'mr_buildGeneratedCode() total spend time'); - - if ($debug = mr_debugOutput(false)) { - $code = str_ireplace_once("", $debug . "\n", $code); - } - - return $code; - // print "\n\n"; -} - - -/** - * Sets language of client, like done in front_content.php - * - * @param int $client Client id - */ -function mr_setClientLanguageId($client) -{ - global $lang, $load_lang, $cfg; - - if ((int) $lang > 0) { - // there is nothing to do - return; - } elseif ($load_lang) { - // use the first language of this client, load_client is set in cms/config.php - $lang = $load_lang; - return; - } - - // try to get clients language from table - $sql = "SELECT B.idlang FROM " - . $cfg['tab']['clients_lang']." AS A, " - . $cfg['tab']['lang']." AS B " - . "WHERE " - . "A.idclient='" . ((int) $client) . "' AND A.idlang=B.idlang" - . "LIMIT 0,1"; - - if ($aData = mr_queryAndNextRecord($sql)) { - $lang = $aData['idlang']; - } -} - - -/** - * 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 - * config.mod_rewrite_{client_id}.php. - * - * @param int $clientId Id of client - * @param bool $forceReload Flag to force to reload configuration, e. g. after - * done changes on it - */ -function mr_loadConfiguration($clientId, $forceReload = false) -{ - global $cfg; - static $aLoaded; - - $clientId = (int) $clientId; - if (!isset($aLoaded)) { - $aLoaded = array(); - } elseif (isset($aLoaded[$clientId]) && $forceReload == false) { - return; - } - - $mrConfig = mr_getConfiguration($clientId); - - if (is_array($mrConfig)) { - // merge mod rewrite configuration with global cfg array - $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'); - } - - $aLoaded[$clientId] = true; -} - - -/** - * Returns the mod rewrite configuration array of an client. - * - * File is placed in /contenido/mod_rewrite/includes/and is named like - * config.mod_rewrite_{client_id}.php. - * - * @param int $clientId Id of client - * @return array|null - */ -function mr_getConfiguration($clientId) -{ - global $cfg; - - - $file = $cfg['path']['config'] . 'config.mod_rewrite_' . $clientId . '.php'; - if (!is_file($file) || !is_readable($file)) { - $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; - if (!is_file($file) || !is_readable($file)) { - return null; - } else { - cWarning(__FILE__, __LINE__, "Configuration file of AMR-Plugin still using plugin folder, move it to data/config folder!"); - } - } - if ($content = file_get_contents($file)) { - return unserialize($content); - } else { - return null; - } -} - - -/** - * Saves the mod rewrite configuration array of an client. - * - * File is placed in /contenido/mod_rewrite/includes/and is named like - * config.mod_rewrite_{client_id}.php. - * - * @param int $clientId Id of client - * @param array $config Configuration to save - * @return bool - */ -function mr_setConfiguration($clientId, array $config) -{ - global $cfg; - - $file = $cfg['path']['config'] . 'config.mod_rewrite_' . $clientId . '.php'; - $result = file_put_contents($file, serialize($config), LOCK_EX); - return ($result) ? true : false; -} - - -/** - * Includes the frontend controller script which parses the url and extacts - * needed data like idcat, idart, lang and client from it. - * - * Will be called by chain 'Contenido.Frontend.AfterLoadPlugins' at front_content.php. - * - * @return bool Just a return value - */ -function mr_runFrontendController() -{ - $iStartTime = getmicrotime(); - - plugin_include('mod_rewrite', 'includes/config.plugin.php'); - - if (ModRewrite::isEnabled() == true) { - plugin_include('mod_rewrite', 'includes/front_content_controller.php'); - - $totalTime = sprintf('%.4f', (getmicrotime() - $iStartTime)); - ModRewriteDebugger::add($totalTime, 'mr_runFrontendController() total time'); - } - - return true; -} - - -/** - * Cleanups passed string from characters beeing repeated two or more times - * - * @param string $char Character to remove - * @param string $string String to clean from character - * @return string Cleaned string - */ -function mr_removeMultipleChars($char, $string) -{ - while (strpos($string, $char . $char) !== false) { - $string = str_replace($char . $char, $char, $string); - } - return $string; -} - - -/** - * Returns amr related translation text - * - * @param string $key The message id as string - * @return string Related message - */ -function mr_i18n($key) -{ - global $lngAMR; - return (is_array($lngAMR) && isset($lngAMR[$key])) ? $lngAMR[$key] : 'n. a.'; -} - -################################################################################ -### Some helper functions, which are not plugin specific - - -/** - * Database query helper. Used to execute a select statement and to return the - * result of first recordset. - * - * Minimizes following code: - * - * // default way - * $db = new DB_ConLite(); - * $sql = "SELECT * FROM foo WHERE bar='foobar'"; - * $db->query($sql); - * $db->next_record(); - * $data = $db->Record; - * - * // new way - * $sql = "SELECT * FROM foo WHERE bar='foobar'"; - * $data = mr_queryAndNextRecord($sql); - * - * - * @param string $query Query to execute - * @return mixed Assoziative array including recordset or null - */ -function mr_queryAndNextRecord($query) -{ - static $db; - if (!isset($db)) { - $db = new DB_ConLite(); - } - if (!$db->query($query)) { - return null; - } - return ($db->next_record()) ? $db->Record : null; -} - - -/** - * Returns value of an array key (assoziative or indexed). - * - * Shortcut function for some ways to access to arrays: - * - * // old way - * if (is_array($foo) && isset($foo['bar']) && $foo['bar'] == 'yieeha') { - * // do something - * } - * - * // new, more readable way: - * if (mr_arrayValue($foo, 'bar') == 'yieeha') { - * // do something - * } - * - * // old way - * if (is_array($foo) && isset($foo['bar'])) { - * $jep = $foo['bar']; - * } else { - * $jep = 'yummy'; - * } - * - * // new way - * $jep = mr_arrayValue($foo, 'bar', 'yummy'); - * - * - * @param array $array The array - * @param mixed $key Position of an indexed array or key of an assoziative array - * @param mixed $default Default value to return - * @return mixed Either the found value or the default value - */ -function mr_arrayValue($array, $key, $default = null) -{ - if (!is_array($array)) { - return $default; - } elseif (!isset($array[$key])) { - return $default; - } else { - return $array[$key]; - } -} - - -/** - * Request cleanup function. Request data is allways tainted and must be filtered. - * Pass the array to cleanup using several options. - * Emulates array_walk_recursive(). - * - * @param mixed $data Data to cleanup - * @param array $options Default options array, provides only 'filter' key with several - * filter functions which are to execute as follows: - * - * $options['filter'] = array('trim', 'myFilterFunc'); - * - * If no filter functions are set, 'trim', 'strip_tags' and 'stripslashes' - * will be used by default. - * A userdefined function must accept the value as a parameter and must return - * the filtered parameter, e. g. - * - * function myFilter($data) { - * // do what you want with the data, e. g. cleanup of xss content - * return $data; - * } - * - * - * @return mixed Cleaned data - */ -function mr_requestCleanup(&$data, $options = null) -{ - if (!mr_arrayValue($options, 'filter')) { - $options['filter'] = array('trim', 'strip_tags', 'stripslashes'); - } - - if (is_array($data)) { - foreach ($data as $p => $v) { - $data[$p] = mr_requestCleanup($v, $options); - } - } else { - foreach ($options['filter'] as $filter) { - if ($filter == 'trim') { - $data = trim($data); - } elseif ($filter == 'strip_tags') { - $data = strip_tags($data); - } elseif ($filter == 'stripslashes') { - $data = stripslashes($data); - } elseif (function_exists($filter)) { - $data = call_user_func($filter, $data); - } - } - } - return $data; -} - - -/** - * Minimalistic'n simple way to get request variables. - * - * Checks occurance in $_GET, then in $_POST. Uses trim() and strip_tags() to preclean data. - * - * @param string $key Name of var to get - * @param mixed $default Default value to return - * @return mixed The value - */ -function mr_getRequest($key, $default = null) -{ - static $cache; - if (!isset($cache)) { - $cache = array(); - } - if (isset($cache[$key])) { - return $cache[$key]; - } - if (isset($_GET[$key])) { - $val = $_GET[$key]; - } elseif (isset($_POST[$key])) { - $val = $_POST[$key]; - } else { - $val = $default; - } - $cache[$key] = strip_tags(trim($val)); - return $cache[$key]; -} - - -/** - * Replaces calling of header method for redirects in front_content.php, - * used during development. - * - * @param $header Header value for redirect - */ -function mr_header($header) -{ - header($header);return; - - $header = str_replace('Location: ', '', $header); - echo ' - - -

'.$header.'

'; - mr_debugOutput(); - echo ''; - exit(); -} - - -/** - * Debug output only during development - * - * @param bool $print Flag to echo the debug data - * @return mixed Either the debug data, if parameter $print is set to true, or nothing - */ -function mr_debugOutput($print = true) -{ - global $DB_Contenido_QueryCache; - 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 - $timeTotal = 0; - foreach ($DB_Contenido_QueryCache as $pos => $item) { - $timeTotal += $item['time']; - } - ModRewriteDebugger::add($timeTotal, 'sql total time'); - } - - $sOutput = ModRewriteDebugger::getAll(); - if ($print == true) { - echo $sOutput; - } else { - return $sOutput; - } -} + + * @copyright www.polycoder.de + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @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. + * + * Will be called by chain 'Contenido.Action.str_newtree.AfterCall'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strNewTree(array $data) { + global $lang; + + ModRewriteDebugger::log($data, 'mr_strNewTree $data'); + + if ((int) $data['newcategoryid'] > 0) { + $mrCatAlias = (trim($data['categoryalias']) !== '') ? trim($data['categoryalias']) : trim($data['categoryname']); + // set new urlname - because original set urlname isn''t validated for double entries in same parent category + ModRewrite::setCatWebsafeName($mrCatAlias, $data['newcategoryid'], $lang); + ModRewrite::setCatUrlPath($data['newcategoryid'], $lang); + } + + return $data; +} + +/** + * Processes mod_rewrite related job for created new category. + * + * Will be called by chain 'Contenido.Action.str_newcat.AfterCall'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strNewCategory(array $data) { + global $lang; + + ModRewriteDebugger::log($data, 'mr_strNewCategory $data'); + + if ((int) $data['newcategoryid'] > 0) { + $mrCatAlias = (trim($data['categoryalias']) !== '') ? trim($data['categoryalias']) : trim($data['categoryname']); + // set new urlname - because original set urlname isn''t validated for double entries in same parent category + ModRewrite::setCatWebsafeName($mrCatAlias, $data['newcategoryid'], $lang); + ModRewrite::setCatUrlPath($data['newcategoryid'], $lang); + } + + return $data; +} + +/** + * Processes 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 + * + * Will be called by chain 'Contenido.Action.str_renamecat.AfterCall'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strRenameCategory(array $data) { + ModRewriteDebugger::log($data, 'mr_strRenameCategory $data'); + + // hes 20100102 + // maximal 50 recursion level + $recursion = (is_int($data['recursion'])) ? $data['recursion'] : 1; + if ($recursion > 50) { + exit("#20100201-1503: sorry - maximum function nesting level of " . $recursion . " reached"); + } + + $mrCatAlias = (trim($data['newcategoryalias']) !== '') ? trim($data['newcategoryalias']) : trim($data['newcategoryname']); + if ($mrCatAlias != '') { + // set new urlname - because original set urlname isn''t validated for double entries in same parent category + ModRewrite::setCatWebsafeName($mrCatAlias, $data['idcat'], $data['lang']); + ModRewrite::setCatUrlPath($data['idcat'], $data['lang']); + } + + // hes 20100102 + // now dive into all existing subcategories and modify their paths too... + $str = 'parentid=' . $data['idcat']; + $oCatColl = new cApiCategoryCollection($str); + + while ($oCat = $oCatColl->next()) { + // hes 20100102 + $str = 'idcat=' . $oCat->get('idcat') . ' AND idlang=' . (int) $data['lang']; + $oCatLanColl = new cApiCategoryLanguageCollection($str); + if ($oCatLan = $oCatLanColl->next()) { + // hes 20100102 + $childData = array( + 'idcat' => $oCat->get('idcat'), + 'lang' => (int) $data['lang'], + 'newcategoryname' => $oCatLan->get('name'), + 'newcategoryalias' => $oCatLan->get('urlname'), + 'recursion' => $recursion + 1 + ); + + $resData = mr_strRenameCategory($childData); + } + } + + return $data; +} + +/** + * Processes mod_rewrite related job after moving a category up. + * + * Will be called by chain 'Contenido.Action.str_moveupcat.AfterCall'. + * + * @todo do we really need processing of the category? there is no mr relevant data + * changes while moving the category on same level, level and name won't change + * + * @param int $idcat Category id + * @return int Category id + */ +function mr_strMoveUpCategory($idcat) { + ModRewriteDebugger::log($idcat, 'mr_strMoveUpCategory $idcat'); + + // category check + $cat = new cApiCategory((int) $idcat); + if (!$cat->get('preid')) { + return; + } + + // get all cat languages + $aIdLang = ModRewrite::getCatLanguages($idcat); + + // update ... + foreach ($aIdLang as $iIdLang) { + // get urlname + $sCatname = ModRewrite::getCatName($idcat, $iIdLang); + // set new urlname - because original set urlname isn't validated for double entries in same parent category + ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); + } + + return $idcat; +} + +/** + * Processes mod_rewrite related job after moving a category down. + * + * Will be called by chain 'Contenido.Action.str_movedowncat.AfterCall'. + * + * @todo do we really need processing of the category? there is no mr relevant data + * changes while moving the category on same level, level and name won't change + * + * @param int $idcat Id of category beeing moved down + * @return int Category id + */ +function mr_strMovedownCategory($idcat) { + ModRewriteDebugger::log($idcat, 'mr_strMovedownCategory $idcat'); + + // category check + $cat = new cApiCategory((int) $idcat); + if (!$cat->get('id')) { + return; + } + + // get all cat languages + $aIdLang = ModRewrite::getCatLanguages($idcat); + // update ... + foreach ($aIdLang as $iIdLang) { + // get urlname + $sCatname = ModRewrite::getCatName($idcat, $iIdLang); + // set new urlname - because original set urlname isn't validated for double entries in same parent category + ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); + } + + return $idcat; +} + +/** + * Processes mod_rewrite related job after moving a category subtree. + * + * Will be called by chain 'Contenido.Action.str_movesubtree.AfterCall'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strMoveSubtree(array $data) { + ModRewriteDebugger::log($data, 'mr_strMoveSubtree $data'); + + // category check + if ((int) $data['idcat'] <= 0) { + return; + } + + // next category check + $cat = new cApiCategory($data['idcat']); + if (!$cat->get('idcat')) { + return; + } + + // get all cat languages + $aIdLang = ModRewrite::getCatLanguages($data['idcat']); + // update all languages + foreach ($aIdLang as $iIdLang) { + // get urlname + $sCatname = ModRewrite::getCatName($data['idcat'], $iIdLang); + // set new urlname - because original set urlname isn't validated for double entries in same parent category + ModRewrite::setCatWebsafeName($sCatname, $data['idcat'], $iIdLang); + ModRewrite::setCatUrlPath($data['idcat'], $iIdLang); + } + + // now dive into all existing subcategories and modify their paths too... + $oCatColl = new cApiCategoryCollection('parentid=' . $data['idcat']); + while ($oCat = $oCatColl->next()) { + mr_strMoveSubtree(array('idcat' => $oCat->get('idcat'))); + } + + return $data; +} + +/** + * Processes mod_rewrite related job after copying a category subtree. + * + * Will be called by chain 'Contenido.Category.strCopyCategory'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strCopyCategory(array $data) { + ModRewriteDebugger::log($data, 'mr_strCopyCategory $data'); + + $idcat = (int) $data['newcat']->get('idcat'); + if ($idcat <= 0) { + return $data; + } + + // get all cat languages + $aIdLang = ModRewrite::getCatLanguages($idcat); + // update ... + foreach ($aIdLang as $iIdLang) { + // get urlname + $sCatname = ModRewrite::getCatName($idcat, $iIdLang); + // set new urlname - because original set urlname isn't validated for double entries in same parent category + ModRewrite::setCatWebsafeName($sCatname, $idcat, $iIdLang); + ModRewrite::setCatUrlPath($idcat, $iIdLang); + } +} + +/** + * Processes mod_rewrite related job during structure synchronisation process, + * sets the urlpath of current category. + * + * Will be called by chain 'Contenido.Category.strSyncCategory_Loop'. + * + * @param array $data Assoziative array with some values + * @return array Passed parameter + */ +function mr_strSyncCategory(array $data) { + ModRewriteDebugger::log($data, 'mr_strSyncCategory $data'); + ModRewrite::setCatUrlPath($data['idcat'], $data['idlang']); + return $data; +} + +/** + * Processes mod_rewrite related job for saved articles (new or modified article). + * + * Will be called by chain 'Contenido.Action.con_saveart.AfterCall'. + * + * @param array $data Assoziative array with some article properties + * @return array Passed parameter + */ +function mr_conSaveArticle(array $data) { + global $tmp_firstedit, $client; + + ModRewriteDebugger::log($data, 'mr_conSaveArticle $data'); + + if ((int) $data['idart'] == 0) { + return $data; + } + + if (strlen(trim($data['urlname'])) == 0) { + $data['urlname'] = $data['title']; + } + + if (1 == $tmp_firstedit) { + // new article + $aLanguages = getLanguagesByClient($client); + + foreach ($aLanguages as $iLang) { + ModRewrite::setArtWebsafeName($data['urlname'], $data['idart'], $iLang, $data['idcat']); + } + } else { + // modified article + $aArticle = ModRewrite::getArtIdByArtlangId($data['idartlang']); + + if (isset($aArticle['idart']) && isset($aArticle['idlang'])) { + ModRewrite::setArtWebsafeName($data['urlname'], $aArticle['idart'], $aArticle['idlang'], $data['idcat']); + } + } + + return $data; +} + +/** + * Processes mod_rewrite related job for articles beeing moved. + * + * Will be called by chain 'Contenido.Article.conMoveArticles_Loop'. + * + * @param array $data Assoziative array with record entries + * @return array Loop through of arguments + */ +function mr_conMoveArticles($data) { + ModRewriteDebugger::log($data, 'mr_conMoveArticles $data'); + + // too defensive but secure way + if (!is_array($data)) { + return $data; + } elseif (!isset($data['idartlang'])) { + return $data; + } elseif (!isset($data['idart'])) { + return $data; + } + + $arr_art = ModRewrite::getArtIds($data['idartlang']); + if (count($arr_art) == 2) { + ModRewrite::setArtWebsafeName($arr_art["urlname"], $data['idart'], $arr_art["idlang"]); + } + + return $data; +} + +/** + * Processes mod_rewrite related job for duplicated articles. + * + * Will be called by chain 'Contenido.Article.conCopyArtLang_AfterInsert'. + * + * @param array $data Assoziative array with record entries + * @return array Loop through of arguments + */ +function mr_conCopyArtLang($data) { + ModRewriteDebugger::log($data, 'mr_conCopyArtLang $data'); + + // too defensive but secure way + if (!is_array($data)) { + return $data; + } elseif (!isset($data['title'])) { + return $data; + } elseif (!isset($data['idart'])) { + return $data; + } elseif (!isset($data['idlang'])) { + return $data; + } + + ModRewrite::setArtWebsafeName($data['title'], $data['idart'], $data['idlang']); + + return $data; +} + +/** + * Processes mod_rewrite related job for synchronized articles. + * + * Will be called by chain 'Contenido.Article.conSyncArticle_AfterInsert'. + * + * @param array $data Assoziative array with record entries as follows: + * + * array( + * 'src_art_lang' => Recordset (assoziative array) of source item from con_art_lang table + * 'dest_art_lang' => Recordset (assoziative array) of inserted destination item from con_art_lang table + * ); + * + * + * @return array Loop through of argument + */ +function mr_conSyncArticle($data) { + ModRewriteDebugger::log($data, 'mr_conSyncArticle $data'); + + // too defensive but secure way + if (!is_array($data)) { + return $data; + } elseif (!isset($data['src_art_lang']) || !is_array($data['src_art_lang'])) { + return $data; + } elseif (!isset($data['dest_art_lang']) || !is_array($data['dest_art_lang'])) { + return $data; + } elseif (!isset($data['dest_art_lang']['idart'])) { + return $data; + } elseif (!isset($data['dest_art_lang']['idlang'])) { + return $data; + } + + if (!isset($data['src_art_lang']['urlname'])) { + $artLang = new cApiArticleLanguage($data['src_art_lang']['idartlang']); + $urlname = $artLang->get('urlname'); + } else { + $urlname = $data['src_art_lang']['urlname']; + } + + if ($urlname) { + ModRewrite::setArtWebsafeName($urlname, $data['dest_art_lang']['idart'], $data['dest_art_lang']['idlang']); + } + + return $data; +} + +/** + * Works as a wrapper for Contenido_Url. + * + * Will also be called by chain 'Contenido.Frontend.CreateURL'. + * + * @todo: Still exists bcause of downwards compatibility (some other modules/plugins are using it) + * + * @param string $url URL to rebuild + * @return string New URL + */ +function mr_buildNewUrl($url) { + global $lang; + + ModRewriteDebugger::add($url, 'mr_buildNewUrl() in -> $url'); + + $oUrl = Contenido_Url::getInstance(); + $aUrl = $oUrl->parse($url); + + // add language, if not exists + if (!isset($aUrl['params']['lang'])) { + $aUrl['params']['lang'] = $lang; + } + + // build url + $newUrl = $oUrl->build($aUrl['params']); + + // add existing fragment + if (isset($aUrl['fragment'])) { + $newUrl .= '#' . $aUrl['fragment']; + } + + $arr = array( + 'in' => $url, + 'out' => $newUrl, + ); + ModRewriteDebugger::add($arr, 'mr_buildNewUrl() in -> out'); + + return $newUrl; +} + +/** + * 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. + * + * @param string $code Code to prepare + * @return string New code + */ +function mr_buildGeneratedCode($code) { + global $client, $cfgClient; + + ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() in'); + + // mod rewrite is activated + if (ModRewrite::isEnabled()) { + $sseStarttime = getmicrotime(); + + // anchor hack + $code = preg_replace_callback( + "/]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i", + create_function('$matches', 'return ModRewrite::rewriteHtmlAnchor($matches);'), + $code + ); + + // remove tinymce single quote entities: + $code = str_replace("'", "'", $code); + + // get base uri + $sBaseUri = $cfgClient[$client]['path']['htmlpath']; + $sBaseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $sBaseUri); + + // 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 + ); + + // define some preparations to replace /front_content.php & ./front_content.php + // against front_content.php, because urls should start with front_content.php + $aPattern = array( + '/([\"|\'|=])\/front_content\.php(.?|.+?)([\"|\'|>])/i', + '/([\"|\'|=])\.\/front_content\.php(.?|.+?)([\"|\'|>])/i' + ); + + $aReplace = array( + '\1front_content.php\2\3', + '\1front_content.php\2\3' + ); + + // perform the pre replacements + $code = preg_replace($aPattern, $aReplace, $code); + + // create url stack object and fill it with found urls... + $oMRUrlStack = ModRewriteUrlStack::getInstance(); + $oMRUrlStack->add('front_content.php'); + + $matches = null; + preg_match_all("/([\"|\'|=])front_content\.php(.?|.+?)([\"|\'|>])/i", $code, $matches, PREG_SET_ORDER); + foreach ($matches as $val) { + $oMRUrlStack->add('front_content.php' . $val[2]); + } + + // ok let it beginn, build the clean urls + $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 + ); + + ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() out'); + + $sseEndtime = getmicrotime(); + } 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 + ); + } + + ModRewriteDebugger::add(($sseEndtime - $sseStarttime), 'mr_buildGeneratedCode() total spend time'); + + if ($debug = mr_debugOutput(false)) { + $code = cString::iReplaceOnce("", $debug . "\n", $code); + } + + return $code; + // print "\n\n"; +} + +/** + * Sets language of client, like done in front_content.php + * + * @param int $client Client id + */ +function mr_setClientLanguageId($client) { + global $lang, $load_lang, $cfg; + + if ((int) $lang > 0) { + // there is nothing to do + return; + } elseif ($load_lang) { + // load_client is set in frontend/config.php + $lang = $load_lang; + return; + } + + // try to get clients language from table + $sql = "SELECT B.idlang FROM " + . $cfg['tab']['clients_lang'] . " AS A, " + . $cfg['tab']['lang'] . " AS B " + . "WHERE " + . "A.idclient='" . ((int) $client) . "' AND A.idlang=B.idlang" + . "LIMIT 0,1"; + + if ($aData = mr_queryAndNextRecord($sql)) { + $lang = $aData['idlang']; + } +} + +/** + * 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 + * config.mod_rewrite_{client_id}.php. + * + * @param int $clientId Id of client + * @param bool $forceReload Flag to force to reload configuration, e. g. after + * done changes on it + */ +function mr_loadConfiguration($clientId, $forceReload = false) { + global $cfg; + static $aLoaded; + + $clientId = (int) $clientId; + if (!isset($aLoaded)) { + $aLoaded = array(); + } elseif (isset($aLoaded[$clientId]) && $forceReload == false) { + return; + } + + $mrConfig = mr_getConfiguration($clientId); + + if (is_array($mrConfig)) { + // merge mod rewrite configuration with global cfg array + $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'); + } + + $aLoaded[$clientId] = true; +} + +/** + * Returns the mod rewrite configuration array of an client. + * + * File is placed in /contenido/mod_rewrite/includes/and is named like + * config.mod_rewrite_{client_id}.php. + * + * @param int $clientId Id of client + * @return array|null + */ +function mr_getConfiguration($clientId) { + global $cfg; + + $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . '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); + } else { + return null; + } +} + +/** + * Saves the mod rewrite configuration array of an client. + * + * File is placed in /contenido/mod_rewrite/includes/and is named like + * config.mod_rewrite_{client_id}.php. + * + * @param int $clientId Id of client + * @param array $config Configuration to save + * @return bool + */ +function mr_setConfiguration($clientId, array $config) { + global $cfg; + + $file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_' . $clientId . '.php'; + $result = file_put_contents($file, serialize($config)); + return ($result) ? true : false; +} + +/** + * Includes the frontend controller script which parses the url and extacts + * needed data like idcat, idart, lang and client from it. + * + * Will be called by chain 'Contenido.Frontend.AfterLoadPlugins' at front_content.php. + * + * @return bool Just a return value + */ +function mr_runFrontendController() { + $iStartTime = getmicrotime(); + + plugin_include('mod_rewrite', 'includes/config.plugin.php'); + + if (ModRewrite::isEnabled() == true) { + plugin_include('mod_rewrite', 'includes/front_content_controller.php'); + + $totalTime = sprintf('%.4f', (getmicrotime() - $iStartTime)); + ModRewriteDebugger::add($totalTime, 'mr_runFrontendController() total time'); + } + + return true; +} + +/** + * Cleanups passed string from characters beeing repeated two or more times + * + * @param string $char Character to remove + * @param string $string String to clean from character + * @return string Cleaned string + */ +function mr_removeMultipleChars($char, $string) { + while (strpos($string, $char . $char) !== false) { + $string = str_replace($char . $char, $char, $string); + } + return $string; +} + +/** + * Returns amr related translation text + * + * @param string $key The message id as string + * @return string Related message + */ +function mr_i18n($key) { + global $lngAMR; + return (is_array($lngAMR) && isset($lngAMR[$key])) ? $lngAMR[$key] : 'n. a.'; +} + +################################################################################ +### Some helper functions, which are not plugin specific + +/** + * Database query helper. Used to execute a select statement and to return the + * result of first recordset. + * + * Minimizes following code: + * + * // default way + * $db = new DB_Contenido(); + * $sql = "SELECT * FROM foo WHERE bar='foobar'"; + * $db->query($sql); + * $db->next_record(); + * $data = $db->Record; + * + * // new way + * $sql = "SELECT * FROM foo WHERE bar='foobar'"; + * $data = mr_queryAndNextRecord($sql); + * + * + * @param string $query Query to execute + * @return mixed Assoziative array including recordset or null + */ +function mr_queryAndNextRecord($query) { + static $db; + if (!isset($db)) { + $db = new DB_Contenido(); + } + if (!$db->query($query)) { + return null; + } + return ($db->next_record()) ? $db->Record : null; +} + +/** + * Returns value of an array key (assoziative or indexed). + * + * Shortcut function for some ways to access to arrays: + * + * // old way + * if (is_array($foo) && isset($foo['bar']) && $foo['bar'] == 'yieeha') { + * // do something + * } + * + * // new, more readable way: + * if (mr_arrayValue($foo, 'bar') == 'yieeha') { + * // do something + * } + * + * // old way + * if (is_array($foo) && isset($foo['bar'])) { + * $jep = $foo['bar']; + * } else { + * $jep = 'yummy'; + * } + * + * // new way + * $jep = mr_arrayValue($foo, 'bar', 'yummy'); + * + * + * @param array $array The array + * @param mixed $key Position of an indexed array or key of an assoziative array + * @param mixed $default Default value to return + * @return mixed Either the found value or the default value + */ +function mr_arrayValue($array, $key, $default = null) { + if (!is_array($array)) { + return $default; + } elseif (!isset($array[$key])) { + return $default; + } else { + return $array[$key]; + } +} + +/** + * Request cleanup function. Request data is allways tainted and must be filtered. + * Pass the array to cleanup using several options. + * Emulates array_walk_recursive(). + * + * @param mixed $data Data to cleanup + * @param array $options Default options array, provides only 'filter' key with several + * filter functions which are to execute as follows: + * + * $options['filter'] = array('trim', 'myFilterFunc'); + * + * If no filter functions are set, 'trim', 'strip_tags' and 'stripslashes' + * will be used by default. + * A userdefined function must accept the value as a parameter and must return + * the filtered parameter, e. g. + * + * function myFilter($data) { + * // do what you want with the data, e. g. cleanup of xss content + * return $data; + * } + * + * + * @return mixed Cleaned data + */ +function mr_requestCleanup(&$data, $options = null) { + if (!mr_arrayValue($options, 'filter')) { + $options['filter'] = array('trim', 'strip_tags', 'stripslashes'); + } + + if (is_array($data)) { + foreach ($data as $p => $v) { + $data[$p] = mr_requestCleanup($v, $options); + } + } else { + foreach ($options['filter'] as $filter) { + if ($filter == 'trim') { + $data = trim($data); + } elseif ($filter == 'strip_tags') { + $data = strip_tags($data); + } elseif ($filter == 'stripslashes') { + $data = stripslashes($data); + } elseif (function_exists($filter)) { + $data = call_user_func($filter, $data); + } + } + } + return $data; +} + +/** + * Minimalistic'n simple way to get request variables. + * + * Checks occurance in $_GET, then in $_POST. Uses trim() and strip_tags() to preclean data. + * + * @param string $key Name of var to get + * @param mixed $default Default value to return + * @return mixed The value + */ +function mr_getRequest($key, $default = null) { + static $cache; + if (!isset($cache)) { + $cache = array(); + } + if (isset($cache[$key])) { + return $cache[$key]; + } + if (isset($_GET[$key])) { + $val = $_GET[$key]; + } elseif (isset($_POST[$key])) { + $val = $_POST[$key]; + } else { + $val = $default; + } + $cache[$key] = strip_tags(trim($val)); + return $cache[$key]; +} + +/** + * Replaces calling of header method for redirects in front_content.php, + * used during development. + * + * @param $header Header value for redirect + */ +function mr_header($header) { + header($header); + return; + + $header = str_replace('Location: ', '', $header); + echo ' + + +

' . $header . '

'; + mr_debugOutput(); + echo ''; + exit(); +} + +/** + * Debug output only during development + * + * @param bool $print Flag to echo the debug data + * @return mixed Either the debug data, if parameter $print is set to true, or nothing + */ +function mr_debugOutput($print = true) { + global $DB_Contenido_QueryCache; + 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 + $timeTotal = 0; + foreach ($DB_Contenido_QueryCache as $pos => $item) { + $timeTotal += $item['time']; + } + ModRewriteDebugger::add($timeTotal, 'sql total time'); + } + + $sOutput = ModRewriteDebugger::getAll(); + if ($print == true) { + echo $sOutput; + } else { + return $sOutput; + } +} diff --git a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content.php b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content.php index e94359e..262e1d3 100644 --- a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content.php +++ b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content.php @@ -1,324 +1,312 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2008-04-22 - * modified 2011-05-17 Murat Purc, added check for available client id - * - * $Id: include.mod_rewrite_content.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -################################################################################ -##### Initialization - -if ((int) $client <= 0) { - // if there is no client selected, display empty page - $oPage = new cPage(); - $sMsg = $notification->returnNotification( - Contenido_Notification::LEVEL_ERROR, i18n("No Client selected") - ); - $oPage->setContent($sMsg); - $oPage->render(); - return; -} - -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_content_controller.php'); - -$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index'; -$bDebug = false; - - -################################################################################ -##### Some variables - - -$oMrController = new ModRewrite_ContentController(); - -$aMrCfg = ModRewrite::getConfig(); - -// downwards compatibility to previous plugin versions -if (mr_arrayValue($aMrCfg, 'category_seperator', '') == '') { - $aMrCfg['category_seperator'] = '/'; -} -if (mr_arrayValue($aMrCfg, 'category_word_seperator', '') == '') { - $aMrCfg['category_word_seperator'] = '-'; -} -if (mr_arrayValue($aMrCfg, 'article_seperator', '') == '') { - $aMrCfg['article_seperator'] = '/'; -} -if (mr_arrayValue($aMrCfg, 'article_word_seperator', '') == '') { - $aMrCfg['article_word_seperator'] = '-'; -} - -// some settings -$aSeparator = array( - 'pattern' => '/^[\/\-_\.\$~]{1}$/', - 'info' => '/ - . _ ~' -); -$aWordSeparator = array( - 'pattern' => '/^[\-_\.\$~]{1}$/', - 'info' => '- . _ ~' -); - -$routingSeparator = '>>>'; - - -$oMrController->setProperty('bDebug', $bDebug); -$oMrController->setProperty('aSeparator', $aSeparator); -$oMrController->setProperty('aWordSeparator', $aWordSeparator); -$oMrController->setProperty('routingSeparator', $routingSeparator); - -// define basic data contents (used for template) -$oView = $oMrController->getView(); -$oView->content_before = ''; -$oView->idclient = $client; -$oView->use_chk = (ModRewrite::isEnabled()) ? ' checked="checked"' : ''; - -// mr copy .htaccess -$aHtaccessInfo = ModRewrite::getHtaccessInfo(); - -if ($aHtaccessInfo['has_htaccess']) { - $oView->htaccess_info_css = 'display:none;'; -} else { - $oView->htaccess_info_css = 'display:table-row;'; -} - -// mr root dir -$oView->rootdir = $aMrCfg['rootdir']; -$oView->rootdir_error = ''; - -// mr check root dir -$oView->checkrootdir_chk = ($aMrCfg['checkrootdir'] == 1) ? ' checked="checked"' : ''; - -// mr start from root -$oView->startfromroot_chk = ($aMrCfg['startfromroot'] == 1) ? ' checked="checked"' : ''; - -// mr prevent duplicated content -$oView->prevent_duplicated_content_chk = ($aMrCfg['prevent_duplicated_content'] == 1) ? ' checked="checked"' : ''; - -// mr language usage -$oView->use_language_chk = ($aMrCfg['use_language'] == 1) ? ' checked="checked"' : ''; -$oView->use_language_name_chk = ($aMrCfg['use_language_name'] == 1) ? ' checked="checked"' : ''; -$oView->use_language_name_disabled = ($aMrCfg['use_language'] == 1) ? '' : ' disabled="disabled"'; - -// mr client usage -$oView->use_client_chk = ($aMrCfg['use_client'] == 1) ? ' checked="checked"' : ''; -$oView->use_client_name_chk = ($aMrCfg['use_client_name'] == 1) ? ' checked="checked"' : ''; -$oView->use_client_name_disabled = ($aMrCfg['use_client'] == 1) ? '' : ' disabled="disabled"'; - -// mr lowecase uri -$oView->use_lowercase_uri_chk = ($aMrCfg['use_lowercase_uri'] == 1) ? ' checked="checked"' : ''; - -// mr category/category word separator -$oView->category_separator = $aMrCfg['category_seperator']; -$oView->category_separator_attrib = ''; -$oView->category_word_separator = $aMrCfg['category_word_seperator']; -$oView->category_word_separator_attrib = ''; -$oView->category_separator_error = ''; -$oView->category_word_separator_error = ''; - -// mr article/article word separator -$oView->article_separator = $aMrCfg['article_seperator']; -$oView->article_separator_attrib = ''; -$oView->article_word_separator = $aMrCfg['article_word_seperator']; -$oView->article_word_separator_attrib = ''; -$oView->article_separator_error = ''; -$oView->article_word_separator_error = ''; - -// mr file extension -$oView->file_extension = $aMrCfg['file_extension']; -$oView->file_extension_error = ''; - -// mr category name resolve percentage -$oView->category_resolve_min_percentage = $aMrCfg['category_resolve_min_percentage']; -$oView->category_resolve_min_percentage_error = ''; - -// mr add start article name to url -$oView->add_startart_name_to_url_chk = ($aMrCfg['add_startart_name_to_url'] == 1) ? ' checked="checked"' : ''; -$oView->add_startart_name_to_url_error = ''; -$oView->default_startart_name = $aMrCfg['default_startart_name']; - -// mr rewrite urls at -$oView->rewrite_urls_at_congeneratecode_chk = ($aMrCfg['rewrite_urls_at_congeneratecode'] == 1) ? ' checked="checked"' : ''; -$oView->rewrite_urls_at_front_content_output_chk = ($aMrCfg['rewrite_urls_at_front_content_output'] == 1) ? ' checked="checked"' : ''; -$oView->content_after = ''; - -// mr rewrite routing -$data = ''; -if (is_array($aMrCfg['routing'])) { - foreach ($aMrCfg['routing'] as $uri => $route){ - $data .= $uri . $routingSeparator . $route . "\n"; - } -} -$oView->rewrite_routing = $data; - -// mr redirect invalid article -$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'); - -$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'); -$oView->lng_msg_no_htaccess_found = sprintf($sMsg, '', ''); - -$oView->lng_enable_amr = i18n('Enable Advanced Mod Rewrite', '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_example = i18n('Example', '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_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_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_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_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_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_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_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_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_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_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_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_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_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.
    A 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_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_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_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 UrlBuilder\nEach generated Clean-Url requires a database query", '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_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'); - - -################################################################################ -##### Action processing - -if ($action == 'index') { - - $oMrController->indexAction(); - -} elseif ($action == 'save') { - - $oMrController->saveAction(); - -} elseif ($action == 'reset') { - - $oMrController->resetAction(); - -} elseif ($action == 'resetempty') { - - $oMrController->resetEmptyAction(); - -} else { - - $oMrController->indexAction(); - -} - - -################################################################################ -##### Output - -$oMrController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/content.html' -); - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +global $client, $cfg; + +################################################################################ +##### Initialization + +if ((int) $client <= 0) { + // if there is no client selected, display empty page + $oPage = new cPage; + $oPage->render(); + return; +} + + +$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index'; +$bDebug = false; + + +################################################################################ +##### Some variables + + +$oMrController = new ModRewrite_ContentController(); + +$aMrCfg = ModRewrite::getConfig(); + +// downwards compatibility to previous plugin versions +if (mr_arrayValue($aMrCfg, 'category_seperator', '') == '') { + $aMrCfg['category_seperator'] = '/'; +} +if (mr_arrayValue($aMrCfg, 'category_word_seperator', '') == '') { + $aMrCfg['category_word_seperator'] = '-'; +} +if (mr_arrayValue($aMrCfg, 'article_seperator', '') == '') { + $aMrCfg['article_seperator'] = '/'; +} +if (mr_arrayValue($aMrCfg, 'article_word_seperator', '') == '') { + $aMrCfg['article_word_seperator'] = '-'; +} + +// some settings +$aSeparator = array( + 'pattern' => '/^[\/\-_\.\$~]{1}$/', + 'info' => '/ - . _ ~' +); +$aWordSeparator = array( + 'pattern' => '/^[\-_\.\$~]{1}$/', + 'info' => '- . _ ~' +); + +$routingSeparator = '>>>'; + + +$oMrController->setProperty('bDebug', $bDebug); +$oMrController->setProperty('aSeparator', $aSeparator); +$oMrController->setProperty('aWordSeparator', $aWordSeparator); +$oMrController->setProperty('routingSeparator', $routingSeparator); + +// define basic data contents (used for template) +$oView = $oMrController->getView(); +$oView->content_before = ''; +$oView->idclient = $client; +$oView->use_chk = (ModRewrite::isEnabled()) ? ' checked="checked"' : ''; +$oView->header_notes_css = 'display:none;'; + +// mr copy .htaccess +// @todo copy htacccess check into ModRewrite_ContentController->_doChecks() +$aHtaccessInfo = ModRewrite::getHtaccessInfo(); +if ($aHtaccessInfo['has_htaccess']) { + $oView->htaccess_info_css = 'display:none;'; +} else { + $oView->header_notes_css = 'display:table-row;'; + $oView->htaccess_info_css = 'display:block;'; +} + +// empty aliases +$iEmptyArticleAliases = ModRewrite::getEmptyArticlesAliases(); +$iEmptyCategoryAliases = ModRewrite::getEmptyCategoriesAliases(); +if ($iEmptyArticleAliases > 0 || $iEmptyCategoryAliases > 0) { + $oView->header_notes_css = 'display:table-row;'; + $oView->emptyaliases_info_css = 'display:block;'; +} else { + $oView->emptyaliases_info_css = 'display:none;'; +} + +// mr root dir +$oView->rootdir = $aMrCfg['rootdir']; +$oView->rootdir_error = ''; + +// mr check root dir +$oView->checkrootdir_chk = ($aMrCfg['checkrootdir'] == 1) ? ' checked="checked"' : ''; + +// mr start from root +$oView->startfromroot_chk = ($aMrCfg['startfromroot'] == 1) ? ' checked="checked"' : ''; + +// mr prevent duplicated content +$oView->prevent_duplicated_content_chk = ($aMrCfg['prevent_duplicated_content'] == 1) ? ' checked="checked"' : ''; + +// mr language usage +$oView->use_language_chk = ($aMrCfg['use_language'] == 1) ? ' checked="checked"' : ''; +$oView->use_language_name_chk = ($aMrCfg['use_language_name'] == 1) ? ' checked="checked"' : ''; +$oView->use_language_name_disabled = ($aMrCfg['use_language'] == 1) ? '' : ' disabled="disabled"'; + +// mr client usage +$oView->use_client_chk = ($aMrCfg['use_client'] == 1) ? ' checked="checked"' : ''; +$oView->use_client_name_chk = ($aMrCfg['use_client_name'] == 1) ? ' checked="checked"' : ''; +$oView->use_client_name_disabled = ($aMrCfg['use_client'] == 1) ? '' : ' disabled="disabled"'; + +// mr lowecase uri +$oView->use_lowercase_uri_chk = ($aMrCfg['use_lowercase_uri'] == 1) ? ' checked="checked"' : ''; + +// mr category/category word separator +$oView->category_separator = $aMrCfg['category_seperator']; +$oView->category_separator_attrib = ''; +$oView->category_word_separator = $aMrCfg['category_word_seperator']; +$oView->category_word_separator_attrib = ''; +$oView->category_separator_error = ''; +$oView->category_word_separator_error = ''; + +// mr article/article word separator +$oView->article_separator = $aMrCfg['article_seperator']; +$oView->article_separator_attrib = ''; +$oView->article_word_separator = $aMrCfg['article_word_seperator']; +$oView->article_word_separator_attrib = ''; +$oView->article_separator_error = ''; +$oView->article_word_separator_error = ''; + +// mr file extension +$oView->file_extension = $aMrCfg['file_extension']; +$oView->file_extension_error = ''; + +// mr category name resolve percentage +$oView->category_resolve_min_percentage = $aMrCfg['category_resolve_min_percentage']; +$oView->category_resolve_min_percentage_error = ''; + +// mr add start article name to url +$oView->add_startart_name_to_url_chk = ($aMrCfg['add_startart_name_to_url'] == 1) ? ' checked="checked"' : ''; +$oView->add_startart_name_to_url_error = ''; +$oView->default_startart_name = $aMrCfg['default_startart_name']; + +// mr rewrite urls at +$oView->rewrite_urls_at_congeneratecode_chk = ($aMrCfg['rewrite_urls_at_congeneratecode'] == 1) ? ' checked="checked"' : ''; +$oView->rewrite_urls_at_front_content_output_chk = ($aMrCfg['rewrite_urls_at_front_content_output'] == 1) ? ' checked="checked"' : ''; +$oView->content_after = ''; + +// mr rewrite routing +$data = ''; +if (is_array($aMrCfg['routing'])) { + foreach ($aMrCfg['routing'] as $uri => $route) { + $data .= $uri . $routingSeparator . $route . "\n"; + } +} +$oView->rewrite_routing = $data; + +// mr redirect invalid article +$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"); + +// @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"); +$oView->lng_msg_no_htaccess_found = sprintf($sMsg, '', ''); + +$sMsg = i18n("Found", "mod_rewrite"); +$oView->lng_msg_no_emptyaliases_found = sprintf($sMsg, '', ''); + +$oView->lng_enable_amr = i18n("Enable Advanced Mod Rewrite", "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_example = i18n("Example", "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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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_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"); + + +################################################################################ +##### Action processing + +if ($action == 'index') { + $oMrController->indexAction(); +} elseif ($action == 'save') { + $oMrController->saveAction(); +} elseif ($action == 'reset') { + $oMrController->resetAction(); +} elseif ($action == 'resetempty') { + $oMrController->resetEmptyAction(); +} else { + $oMrController->indexAction(); +} + + +################################################################################ +##### Output + +$oMrController->render( + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/content.html' +); + diff --git a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content_top.php b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content_top.php new file mode 100755 index 0000000..cb5b555 --- /dev/null +++ b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_content_top.php @@ -0,0 +1,18 @@ +generate( + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/content_top.html', 0, 0 +); diff --git a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contentexpert.php b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contentexpert.php index 1e28988..8db925f 100644 --- a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contentexpert.php +++ b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contentexpert.php @@ -1,169 +1,119 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * modified 2011-05-17 Murat Purc, added check for available client id - * - * $Id: include.mod_rewrite_contentexpert.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -################################################################################ -##### Initialization - -if ((int) $client <= 0) { - // if there is no client selected, display empty page - $oPage = new cPage(); - $sMsg = $notification->returnNotification( - Contenido_Notification::LEVEL_ERROR, i18n("No Client selected") - ); - $oPage->setContent($sMsg); - $oPage->render(); - return; -} - -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contentexpert_controller.php'); - -$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index'; -$debug = false; - - -################################################################################ -##### Some variables - - -$oMrController = new ModRewrite_ContentExpertController(); - -$aMrCfg = ModRewrite::getConfig(); - -$aHtaccessInfo = ModRewrite::getHtaccessInfo(); - -// define basic data contents (used for template) -$oView = $oMrController->getView(); - -// view variables -$oView->copy_htaccess_css = 'display:table-row;'; -$oView->copy_htaccess_error = ''; -$oView->copy_htaccess_contenido_chk = ' checked="checked"'; -$oView->copy_htaccess_cms_chk = ''; -$oView->contenido_full_path = $aHtaccessInfo['contenido_full_path']; -$oView->client_full_path = $aHtaccessInfo['client_full_path']; -$oView->content_after = ''; - -$oMrController->setProperty('htaccessInfo', $aHtaccessInfo); - -// view language variables -$oView->lng_plugin_functions = i18n('Plugin functions', '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_info2 = i18n('Contains a sipmle 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_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_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_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_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_discard_changes = i18n('Discard changes', 'mod_rewrite'); -$oView->lng_save_changes = i18n('Save changes', 'mod_rewrite'); - - -################################################################################ -##### Action processing - -if ($action == 'index') { - - $oMrController->indexAction(); - -} elseif ($action == 'copyhtaccess') { - - $oMrController->copyHtaccessAction(); - -} elseif ($action == 'downloadhtaccess') { - - $oMrController->downloadHtaccessAction(); - exit(); - -} elseif ($action == 'reset') { - - $oMrController->resetAction(); - -} elseif ($action == 'resetempty') { - - $oMrController->resetEmptyAction(); - -} else { - - $oMrController->indexAction(); - -} - - -################################################################################ -##### Output - -$oMrController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contentexpert.html' -); - + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +global $client, $cfg; + +################################################################################ +##### Initialization + +if ((int) $client <= 0) { + // if there is no client selected, display empty page + $oPage = new cPage; + $oPage->render(); + return; +} + +$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index'; +$debug = false; + + +################################################################################ +##### Some variables + + +$oMrController = new ModRewrite_ContentExpertController(); + +$aMrCfg = ModRewrite::getConfig(); + +$aHtaccessInfo = ModRewrite::getHtaccessInfo(); + +// define basic data contents (used for template) +$oView = $oMrController->getView(); + +// view variables +$oView->copy_htaccess_css = 'display:table-row;'; +$oView->copy_htaccess_error = ''; +$oView->copy_htaccess_contenido_chk = ' checked="checked"'; +$oView->copy_htaccess_cms_chk = ''; +$oView->contenido_full_path = $aHtaccessInfo['contenido_full_path']; +$oView->client_full_path = $aHtaccessInfo['client_full_path']; +$oView->content_after = ''; + +$oMrController->setProperty('htaccessInfo', $aHtaccessInfo); + +// view language variables +$oView->lng_plugin_functions = i18n("Plugin functions", "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_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_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_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_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_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_discard_changes = i18n("Discard changes", "mod_rewrite"); +$oView->lng_save_changes = i18n("Save changes", "mod_rewrite"); + + +################################################################################ +##### Action processing + +if ($action == 'index') { + $oMrController->indexAction(); +} elseif ($action == 'copyhtaccess') { + $oMrController->copyHtaccessAction(); +} elseif ($action == 'downloadhtaccess') { + $oMrController->downloadHtaccessAction(); + exit(); +} elseif ($action == 'reset') { + $oMrController->resetAction(); +} elseif ($action == 'resetempty') { + $oMrController->resetEmptyAction(); +} else { + $oMrController->indexAction(); +} + + +################################################################################ +##### Output + +$oMrController->render( + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contentexpert.html' +); + diff --git a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contenttest.php b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contenttest.php index 8588504..ad0efa9 100644 --- a/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contenttest.php +++ b/conlite/plugins/mod_rewrite/includes/include.mod_rewrite_contenttest.php @@ -1,108 +1,83 @@ - - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * modified 2011-05-17 Murat Purc, added check for available client id - * - * $Id: include.mod_rewrite_contenttest.php 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -defined('CON_FRAMEWORK') or die('Illegal call'); - - -################################################################################ -##### Initialization - -if ((int) $client <= 0) { - // if there is no client selected, display empty page - $oPage = new cPage(); - $sMsg = $notification->returnNotification( - Contenido_Notification::LEVEL_ERROR, i18n("No Client selected") - ); - $oPage->setContent($sMsg); - $oPage->render(); - return; -} - -plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contenttest_controller.php'); - - -################################################################################ -##### Processing - -$mrTestNoOptionSelected = false; -if (!mr_getRequest('idart') && !mr_getRequest('idcat') && !mr_getRequest('idcatart') && !mr_getRequest('idartlang')) { - $mrTestNoOptionSelected = true; -} - - -$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_result_item_tpl = i18n('{pref}{name} -{pref}Builder in: {url_in} -{pref}Builder out: {url_out} -{pref}Resolved URL: {url_res} -{pref}Resolved data: {data}', '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'); - - -################################################################################ -##### Action processing - -if ($mrTestNoOptionSelected) { - $oMrTestController->indexAction(); -} else { - $oMrTestController->testAction(); -} - -$oView = $oMrTestController->getView(); -$oView->content .= mr_debugOutput(false); - - -################################################################################ -##### Output - -$oMrTestController->render( - $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contenttest.html' -); + + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + */ + +if (!defined('CON_FRAMEWORK')) { + die('Illegal call'); +} + +global $client, $cfg; + + +################################################################################ +##### Initialization + +if ((int) $client <= 0) { + // if there is no client selected, display empty page + $oPage = new cPage; + $oPage->render(); + return; +} + + +################################################################################ +##### Processing + +$mrTestNoOptionSelected = false; +if (!mr_getRequest('idart') && !mr_getRequest('idcat') && !mr_getRequest('idcatart') && !mr_getRequest('idartlang')) { + $mrTestNoOptionSelected = true; +} + + +$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_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_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"); + + +################################################################################ +##### Action processing + +if ($mrTestNoOptionSelected) { + $oMrTestController->indexAction(); +} else { + $oMrTestController->testAction(); +} + +$oView = $oMrTestController->getView(); +$oView->content .= mr_debugOutput(false); + + +################################################################################ +##### Output + +$oMrTestController->render( + $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/contenttest.html' +); diff --git a/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.mo b/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.mo index 9ce6db757b8781c957959632c07d03387bd02858..bd03a829d8549e97f4b1a61a503ba79a08193d6d 100644 GIT binary patch delta 7555 zcmcJSdvsLCeaB~oFd&{nZy}_SgtQWpRuV!Imc)WypeI5gki=7~-PzrX?%rMBdsjjb zESnHJiCx=a;ySe*+qDTz;{*6aG44afvG>$zj$Jn=X?h%&LxLZtB)GQg+G+hr-S6+- z6@mnx{FQt3+t1A0xii1{{eJVC(FbokUb*U+y0kL!L5AmUNDgEmk+EmNdl%vd&&XoN z4A29r;LpLMV9OH54uKcIHV0#+OBu@twPlQ@q5Xm7jC}(<4W@z{Rxp+e_JUcU3T|R- zirt06Dm1(VR)KGT8^Dxg#%=+7z;q0}6U12T&`QQQcm$+=kAN-Uzk;n`Mhat{;9jr` z{0`Uvz7J-AWzc3V#%l%JF+bCwZaZH503-{10{X#>bjE%N-VXjVKG=k>=YdP1{@Z9z z&bAf#AFvqpOsrxXxCy);ybr`HmWx4&w}MaL`vH&^^3iI>7Gi!jA9gXoWgr&8j)QN4 z4}vfTo6NH<^mT9n>Zidq;8}1I{26!x?B$I0fj0X z>Aeopf*t}X7@q+bfG>g2mAwis1V1d9VhjPyeuoB{FbQhA!8PC}&p91m6euEz} zX)2a;D>w?$N*)DAz%w9CysQl4z_L#8QPlnA@H;pUW_l7F0(XL+PNDE~6#86@Z3l~B zFENj?aS-3Ii|ZJ>3@)m%6}t-Vz`$$Q!#d!xTE;%Z`>S=fX|L4VF_eX^k&pIrkX*Da zUf01))V~RmMW)W6Kqh<^9Ke7-0-+1bX<(LXxM8{STTb2D6 zm-gW@? zr|AAGG+^=U1(3E~#zFhEY6H_y_ky&NNstt{6I=p59e@8fU=Hf9f^P6Ci11)*N9;4f z0O`9IL3owD18x8}PI+vfje~wPd=1P1-v@;Q{u*WM71T8^PBgI52lImufmH7jjQt0A z8l?Jt7(~v4|G`SsZ$E?|jB^&GgmrEVhZE|*24}#j$q=>{Uetwclaxek1rC5^Xdeej z^C!Uq@D-3O_8v$US#+DdJ(Iz&V!&dMEO<`0gYP1^3iWqD^7%r8vA+iMLAZK~y^KO4 z8r}ylf**k&gFiJb#jSLU#aa(p1~F+ptMQu>FOz~>A(-QaCmFTQ>smIVOjegfgBA@j&S5gB*r*Lz*D;tb`ybvIz*e3P%9@66AIWjA%Vy!S9_A zc+0wekt_B==*ff7{78d#BBAn8`oR-`AVFDA4Ss7O2oWo)@3va)A97s_WIiMvf*r>Y ze^v&Kf=B^Y-~m>;Mz~pbf%V`fnxD4I63Fa>_+d`SvDpT2IphSS?Yg#{cv%6fA^DKa zkRiw*Bmpw}WTP+!!6vdUtq0>T*3tSYTE`*9kS!1mLJxM7eMEvgs3HDTfQuj$&Gc-C zG(#pKBM`)`b#eVNNY4OdC!`Qk0yz$0g}nW+ClpcTcNXVP_btv#SlG91pnY3sTi^8f z(t8r*=DbuH-kG+@AJx3364nfEzbT*{`@itVctvb+#_G z%q&^3a^>`=$^Yk&pQdDA8(*$Y&6VfeX>xmN@_eVOX;hcN)T^l;nuP~F1|JnddP@%Ej3m+^awca;rmr57k=6HN=G;*X;m>tuyPJ%N2P-irRk6|O4Xa_jA)sS% zPWipuip-n6)`ib0Kgc~K$MT8>w}hjbj~n5T;9id@0%3iUdo*8VSmz$yRJ^L-9#!!e z!f^3UlPd<-g*O}u3C$;b+zfL)s&O+Y&};~k&w5h+qO4FpkXN1O?DZ&`<{4K4mhGKf z(YS|Sv)J^n@&b-2ZU_-FINYN6Z_q^%2KR+ErwN~pLlbl~xihM(5sw*ka-o?}7bB7a zK9A`cg`zILT@_$lBN2+2SdzU4>RV)NnGLrh%&7~H!zJ7DKU?9(e^N3mo%<)P-}G?tv3X0~!WD3Frz>cN zROj^DrR5HpQg--SC&X@s{9aj({HL<_9g6(h@|WbD75n5bE7r_)S?szj-*x>W#SJ@; zV+p=F!^w-4dv3uLJm8YgxKk15iE?+9UtXxX3sNlA>iZL&MTS#;UR`Pz%GVVvpcWS& zkh|91IycLouX`84^wpY7l*LO*0ZO1%!vnGvNuY9d`LiX3y%yqrD zZr$_`>+&3l!{Mkd&t+y#AtDSup_oC-n(&yZXaVk2jDv=Wm^z5?f%}wERgf-0gj7V0 z2H=?qMO7_ZPlWX`9?`=Qp{sHKqE{&F6J&i}>5hBY8x-C#Bn4FsPtY7@IHGu`$jPl? z%@msA3)?A!0@WMzXaND86r;f&CI0K-L0$MaI)kPeX{fBUa*WG6JAf;!2P(%EF<}kv ziUcE@%#AhcYHO;T+^c#FW219ajS45n+5*Dd=xjJRs(Q3Br~4)g=ANjZYa%N6ZlN2L zi=rXJ6sjt;rb>@nUaAkdoC>zqVJ9h$m7wSnhfNB)P7PZWaUI4Ui3cO6Aayw9V;fda z|HB5iBa!;a&u(397qT02i>T#j1PeTNlT2~cN*KqSa!&&=v?S}1LsG9 zW7fz=8)_EzD5l`ey*uPj8eA*tE2`=%s%v@mhK8E@vZ{4*S!3o>yRnW}*EH1B$(qKZ z-moj8Xk%hCtXDDW@s5T4e#I+XKH*O4fmfoQfT$P{o=^kt(@nUNZ>R3O$<#fXp&~DB zhCftHOx}ZXq! zg|YJiRYBD7L7|(X0lA=*RaaHgd%9u_|ZEkbo7fyCraap z(K*d9DA})^YaVZq`$UNMMiIZdJnK%kk6Ic}zP#n@i(-$${?`2dtuWM#{Ijh+oo$$? zJFNMYKopLn_@9XCKEVURh|nV871j$s`Y^K=JLL^xaE-6$?FvkSZ4$)}*7z8fcuPl~ zbat$vf%`jFkq7jSO;mfXqex!r2&THRv%EoF5u@+}YuC&m`iykC)0;@xjS$ z@5=YKp)@0_`d*YD_U)iz&-PVCwx4IuD0g!NeiD>9aT-qOv~yL=_pR-t3GPApL|=}~ z?q5O?Q{KN#eyKkzA$CGO(qC-rlp!zmm&k=X>S^%y9o?|nH+Pg&-|R|Z-#FauI&v|} z@FZorfKX%S4O3po%__UuS9B3^ZxKNi8+BADA>JJI;|sZI=de7xGiM53SCFw)0aNmB z`*xy;3XU5~CC&n!H{*sfCRF=yw?j#T2XP5O0J(TO9Yea0;|kypV-~HP`*5S6T~4`y zf~*BYleX5SAil?OD>xF>i=)NSklN@SI}*hac7%ec(?Dce1N7Nf1Up#X+F4iZKH}mn zIPE(;(TI8dbqDLZ&gU%y^%)cj*A{~dm5KEPVBv2KRR0Oyl}y13*a!$d++o6484eEx zmhh+s506qERhU_uQ%a*%@-`S;8^uXh0Y8{}>=az#C*|kvUw-l(4Beubh%DPod?&uO zUDiyOt~`PDAw}H8#IYIgm`k49^`AJwkWKSrr)YaSxdxAz_D&3{rtMcNQORHL?y_&g zjf1-uxZ~mS?ZNt#*r}kd3K$dj!wG?uqPgVap}iE^>d&Xz%px%OI%x znh0n2)#kW&hjm;>peBw|>uMU;nhv1(`>Uv5mXSVUtyc7P|{@a8sZ-Foo5D`&&kzO0g)<(1NWSu$eH zHZ+o77&`%NakHa9@q}={Le|z|=S?NR4ct zNLGwa()&EoB(IE`R2=ozky9S?7TPZwWrA-VRu(@x{H6^4|7`nNWkfj%GLf2H2z-yXo?$qOoh7Fr{I6{Ycdkdmw~{+WD367 z*s+5x5-gVUf`cn=ctiO<5`50SQkN;^c44nlU>ELGHqYtvW5vDNT8n1=!-VYPv3Azn z(O7lpto+rXZF8U0jdd<@C()XlqXxO*8)GhV_&<)}s5>R!8+%epRhJ7wZL&91k{LVY zR}RA?_(#Yubj`#Ra63MGFjQIWwvr#+IB7e_P6Tm-@&?DSP4Mp&j{AVHj^__U-D%g( zIy564;9RG5?$&lqpV2ls=5+?K=$@=8oE=fW$wSr&tzUmCf6?{6jnbuo|H$GOd}L$m zYiho60DIHZO@y-QjE0g z`C?>^yb{6YJ3pO$TS5H4fQ@>-{a?UAy}%mdkNy`x3Dr8Y4>tRW@gk;N-u6FM}tlhiH z-Mf-(W6ObrP!h1sJ&@2-9t9G7niP|4ObG2sNomPBsco7zB?SUGZlNRv3??Z}LMZ+I z?%b=DgWL44&e2bwnYnXke)D_G+`ag=?SnUM3$L$Vejh{m93&Ugw4AXxIJOG^P|8yo zi-McM5cnW?986iw*b(p!&~0Pv8dwO{uVHK>`bX9>b{15?oghnNY!k2xtOm!xM#dJ{ z-KeZY#|vN%Cb%RXu%EAEY&ZG~*E7}zdciL69Jm+!0Ca)P8yL$3=RpVFKLfU-{a5LN zE1*pP?QZaS@Y~=|F>XGCv9(yA4P`OL@jwRGX8SOE!3cLf{0zM5^gI7R$ ze?82I@L@$DS*WTM_UEYVL$`$4S5z6m_qFd6(Vh_%`GL2|`gAX(&nkkA+!%~g&V=&fscX%6^!i%e+9k_cEWu9pnbu?SY#Pe48$|` zuh`}lFs()?_5nD8iJjXR)4;oG@eur^PMDT82-i8mLOgPV^2wS;VUiq>c32BO2DXD);4i==FbQV(XK)4h4EQ>jiU(hIA*IlMtcfud z%xz}u6nGju4yM7(9Z>vBU<3G%JB{@gSZXU{7cig%>;hi}3#q*u1HnBYxnu!c0lom{ z+ZekD?m+wPHj$QPZeh|{Z~*;30EfZsb`dKxAO-DTfK7P+7vMDIf9W2vz`fu-81ORq zE*R*9X_GJsw4!JYc8hc1C`dbb1k3~9>JdSyPk{@Q*ufWJr#0w!=N94nkHA8-SC5DV9N_zCyTL55Zd3$QAIQ-j z2JZytKzhy&GPVuK1`!sl7o_066Kn)8faHp+2VsBe$UP)FhQM`b-wskx-Un^~{}kll z1&}Q8lF1K2GHJ$`IB;sg?PyPc)c*j8A?!O~HMrq0QVw*3WI6v~*q_qk1Ug8g&x5PM zIG7DS2XgQgkj{yZK+0>^xUorg8pIL6{vD+L^a-)UAV@BJ6bykEz)a9SiM4EaAH0nA zGYb;5Mdb@q@H_YxNbN^GjQuB=c$a^4K5aniFyc>Hwxxp zw?h1)X`J~!)G0PNXX$E$QoAQcpv@1X2Sjg+w6~8&nV`#&J$T7{vO<2_?}JlvNN91nJ6< zQAPmn0=GljA+wNE5X7Q!d%3_u2w4%CX$10T!DWzc$jy*c$ZAL%WDSH0V$rxe<|(OT zXzYbhl&^!NK#oIjC|*}`(Q-p3%-&6)-nu$n|9R>LeP(rk{3od|+EzsrO;&>5Nc_p0 zznG+-Eh>zkOIv13;#KG?Lh{+u%_-B~Jy zXLba=lBzY=*d0w%D&Ec9__kh$@|j#TXp_LC#v6txA7s(;Kw8XLBc4VMVd&{JatB zn-#d6_a!m?q5LUP`Cfimo}pfJMpAfGI~tOk?Vd;|qPqO5EGu^Xll;m}|HBAX_S$uK z!I3rX^E0xl@qIH|Frq~DKQAcNd%3f~-YW$aMVbxzC3;}zL4`|v(Khi1x!H1~F~sFU`VUfhu}$PdU-jkl_@ z#CiuSO-14(#T#sCye$-zmBbwJK*@(oLd{opV%b_KAUpgHZg&K7_Sz)|Bc$b54rth2{2=s9pbc&1O+4*=A3s9tYR-zHQqR%bnhK zRrvE{ZD*qQa&4#R&8)jX6JD&_OUS4S4Oc~6o4Nk{q8X3w5eiROs4OnE0? zx44TL)l_z%v)dZ*Q0JyT1o>Q0rquVDBLcE2D|}d1$#JO7MwEmJxH(}c=m}JCMe+o= zR}RB9Q4N;5(eW;}rI&TxwXSr?H0h!;&vq4Bioe#?)7Kl+FrC5`VNFi}vnsrnw+9u} zLZO)AM|)a$Kq2M4(ER}PRgTHf2p!l6W)Pu&c5iW+&{v5X5B)NN;F!keWEF!PtXeqYP2v>U~ z!oFUgd+|u+9ma*^#j%;_>%!iokVt^&tgIS4QG!wC#@_t$oT=cozWnMx{E~>FCD&PH z?)6>Mk(nSl*t~VS`wBCJiBv8l?-F|HC;K+j2A=5av_kk=U+r}_oVfMU{`VC^``k3m zQ~P#U)4aRyDz3v<`_Wauz=BIc!8_bgU`0tc=J!XC z5I9RUj#W%2{&v{;|2U>x9~gNDH`*?D;a1^&IvVVzlNYll5JIxYkn9!aF?4ElZ{q9g z^61dbuz|3vVb(1N8yduP0W~CJgL2}q=oMcvxDm*?^c{2Ev7~DU4_RUNql5icwdhc* zRrMXJ$m)i(c(0@&A~nQE6q-K&IJDHy9vY{hd+$((<)MZ#X^mxcGr%7jE4{&qeraq= zmNjtEJ9FkWm3(;dgxzwu{QorW^M^+gUm9;7K4xWsG@fZykBv83)n~@*Nbz^abF7}5 zCaSIKj)^?0dT^rIsy;A*t5c-jvlGZwadrONL~qTfwt)ci^55T-N_UOdjJwgvB5U50 zlYG6{_H`r9O@782u}M0Ym56%rHOYPEO#dWx4+~vFSO9lPZ^Ro5$x4;@)QMJbuf(T~ zQ&MP;)KbNjghXqLAkh@DycYEHD89o|_M3b2O;wbNRp^6a?r1bPchrx=-MEfq%1z8J zF0F4(og{l!dj=9t_#=<;GvSKosI`&vz9#)EUd?K*k?U_-Tw1@|hYt{Ow4V3v(7z_v z+#qVM$Qcy;L*b}qD*0dX5Usr5SCUxyl&>-|)z|3pkRP#aT;%!_{zfadulT33F`Ic9 zgkXTBSIKZdNjA-{f6tk#zZsaw6^kl4;raetBe9VjDZATQ)D+Ux|dnvSN6XJ|8~)RdWCIleANJs4p?YABVc= zcTkEOcXw+n>ND;8UdUm^Z$Y@&sZR+$_`VUr7QlD0CoqjuN#g+=B7S-CE2<{aooW5Xr4Jwq(Xbg# z_eO^3z$-UQ_GE)SzIG!I9g%GLHttGPCqSvsTJaXR?J@Yhksho`MY>c>Va5psrk;*ew@UdZZ^fm`EjqL INhjEU17BU%`~Uy| diff --git a/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.po b/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.po index a287d93..e9bdf52 100644 --- a/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.po +++ b/conlite/plugins/mod_rewrite/locale/de_DE/LC_MESSAGES/mod_rewrite.po @@ -1,243 +1,107 @@ msgid "" msgstr "" -"Project-Id-Version: Contenido Plugin Advanced Mod Rewrite\n" +"Project-Id-Version: ConLite AMR\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-20 11:14+0100\n" -"PO-Revision-Date: 2014-01-20 15:30+0100\n" -"Last-Translator: Ortwin Pinke \n" -"Language-Team: Murat Purc \n" +"POT-Creation-Date: 2017-07-15 18:37+0200\n" +"PO-Revision-Date: 2017-07-16 13:36+0100\n" +"Last-Translator: Ortwin Pinke \n" +"Language-Team: Ortwin Pinke \n" "Language: de_DE\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Poedit-Basepath: ../../../../\n" +"X-Poedit-Basepath: .\n" "X-Poedit-KeywordsList: i18n\n" -"X-Poedit-SourceCharset: iso-8859-1\n" -"X-Generator: Poedit 1.5.7\n" +"X-Generator: Poedit 1.5.4\n" "X-Poedit-SearchPath-0: mod_rewrite\n" -#: classes/controller/class.modrewrite_controller_abstract.php:73 -msgid "More informations" -msgstr "Weitere Informationen" - -#: classes/controller/class.modrewrite_content_controller.php:72 -msgid "" -"The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\\-_" -"\\/\\.]" -msgstr "" -"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen " -"[a-zA-Z0-9\\-_\\/\\.]" - -#: classes/controller/class.modrewrite_content_controller.php:79 -#, php-format -msgid "The specified directory \"%s\" does not exists" -msgstr "Das angegebene Verzeichnis \"%s\" existiert nicht" - -#: classes/controller/class.modrewrite_content_controller.php:86 -#, php-format -msgid "" -"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." -msgstr "" -"Das angegebene Verzeichnis \"%s\" existiert nicht im DOCUMENT_ROOT \"%s\". " -"Das kann vorkommen, wenn das DOCUMENT_ROOT des Mandanten vom Contenido " -"Backend DOCUMENT_ROOT abweicht. Die Einstellung wird dennoch ü" -"bernommen, da die Überprüfung abgeschaltet wurde." - -#: classes/controller/class.modrewrite_content_controller.php:189 -#, php-format -msgid "Please specify separator (%s) for category" -msgstr "Bitte Trenner (%s) für Kategoriewörter angeben" - -#: classes/controller/class.modrewrite_content_controller.php:194 -#, php-format -msgid "Invalid separator for category, allowed one of following characters: %s" -msgstr "" -"Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: " -"%s" - -#: classes/controller/class.modrewrite_content_controller.php:201 -#, php-format -msgid "Please specify separator (%s) for category words" -msgstr "Bitte Trenner (%s) für Kategorie angeben" - -#: classes/controller/class.modrewrite_content_controller.php:206 -#, php-format -msgid "" -"Invalid separator for category words, allowed one of following characters: %s" -msgstr "" -"Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: " -"%s" - -#: classes/controller/class.modrewrite_content_controller.php:213 -#, php-format -msgid "Please specify separator (%s) for article" -msgstr "Bitte Trenner (%s) für Kategoriewörter angeben" - -#: classes/controller/class.modrewrite_content_controller.php:218 -#, php-format -msgid "" -"Invalid separator for article, allowed is one of following characters: %s" -msgstr "" -"Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: " -"%s" - -#: classes/controller/class.modrewrite_content_controller.php:225 -#, php-format -msgid "Please specify separator (%s) for article words" -msgstr "Bitte Trenner (%s) für Kategorie angeben" - -#: classes/controller/class.modrewrite_content_controller.php:230 -#, php-format -msgid "" -"Invalid separator for article words, allowed is one of following characters: " -"%s" -msgstr "" -"Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: " -"%s" - -#: classes/controller/class.modrewrite_content_controller.php:237 -msgid "Separator for category and category words must not be identical" -msgstr "" -"Trenner für Kategorie und Kategoriewörter dürfen nicht " -"identisch sein" - -#: classes/controller/class.modrewrite_content_controller.php:242 -msgid "Separator for category and article words must not be identical" -msgstr "Separator for category and article words must not be identical" - -#: classes/controller/class.modrewrite_content_controller.php:247 -msgid "Separator for category-article and article words must not be identical" -msgstr "" -"Trenner für Kategorie-Artikel und Artikelwörter dürfen nicht " -"identisch sein" - -#: classes/controller/class.modrewrite_content_controller.php:264 -msgid "" -"The file extension has a invalid format, allowed are the chars \\.([a-zA-" -"Z0-9\\-_\\/])" -msgstr "" -"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen " -"[a-zA-Z0-9\\-_\\/\\.]" - -#: classes/controller/class.modrewrite_content_controller.php:278 -msgid "Value has to be numeric." -msgstr "Wert muss numerisch sein." - -#: classes/controller/class.modrewrite_content_controller.php:282 -msgid "Value has to be between 0 an 100." -msgstr "Wert muss zwischen 0 und 100 sein." - -#: classes/controller/class.modrewrite_content_controller.php:299 -msgid "" -"The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\\-_" -"\\/\\.]*$/" -msgstr "" -"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen " -"[a-zA-Z0-9\\-_\\/\\.]" - -#: classes/controller/class.modrewrite_content_controller.php:362 -msgid "Please check your input" -msgstr "Bitte überprüfen Sie ihre Eingaben" - -#: classes/controller/class.modrewrite_content_controller.php:370 -msgid "Configuration has not been saved, because of enabled debugging" -msgstr "Konfiguration wurde nicht gespeichert, weil debugging aktiv ist" - -#: classes/controller/class.modrewrite_content_controller.php:384 -#, php-format -msgid "Configuration could not saved. Please check write permissions for %s " -msgstr "" -"Konfiguration konnte nicht gespeichert werden. Überprüfen Sie " -"bitte die Schreibrechte für %s" - -#: includes/include.mod_rewrite_content.php:42 -#: includes/include.mod_rewrite_contenttest.php:49 -#: includes/include.mod_rewrite_contentexpert.php:42 -msgid "No Client selected" -msgstr "Kein Mandant ausgewählt" - -#: includes/include.mod_rewrite_content.php:183 +#: includes/include.mod_rewrite_content.php:177 msgid "Version" msgstr "Version" -#: includes/include.mod_rewrite_content.php:184 +#: includes/include.mod_rewrite_content.php:178 msgid "Author" msgstr "Autor" -#: includes/include.mod_rewrite_content.php:185 +#: includes/include.mod_rewrite_content.php:179 msgid "E-Mail to author" msgstr "E-Mail an Autor" -#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_content.php:180 msgid "Plugin page" msgstr "Pluginseite" -#: includes/include.mod_rewrite_content.php:187 +#: includes/include.mod_rewrite_content.php:181 msgid "Visit plugin page" msgstr "Pluginseite besuchen" -#: includes/include.mod_rewrite_content.php:188 +#: includes/include.mod_rewrite_content.php:182 msgid "opens page in new window" -msgstr "öffnet Seite in einem neuen Fenster" +msgstr "öffnet Seite in einem neuen Fenster" -#: includes/include.mod_rewrite_content.php:189 -msgid "Contenido forum" -msgstr "Contenido Forum" +#: includes/include.mod_rewrite_content.php:183 +msgid "CONTENIDO forum" +msgstr "CONTENIDO Forum" -#: includes/include.mod_rewrite_content.php:190 -msgid "Plugin thread in Contenido forum" -msgstr "Pluginbeitrag im Contenido Forum" +#: includes/include.mod_rewrite_content.php:184 +msgid "Plugin thread in CONTENIDO forum" +msgstr "Pluginbeitrag im CONTENIDO Forum" -#: includes/include.mod_rewrite_content.php:191 +#: includes/include.mod_rewrite_content.php:185 msgid "Plugin settings" msgstr "Plugineinstellungen" -#: includes/include.mod_rewrite_content.php:192 -#: includes/include.mod_rewrite_contentexpert.php:123 +#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_contentexpert.php:87 msgid "Note" msgstr "Hinweis" -#: includes/include.mod_rewrite_content.php:194 +#: includes/include.mod_rewrite_content.php:189 #, php-format msgid "" -"The .htaccess file could not found either in Contenido installation " -"directory nor in client directory.
    It should set up in %sFunctions%s " +"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." msgstr "" -"Es wurde weder im Contenido Installationsverzeichnis noch im " -"Mandantenverzeichnis eine .htaccess Datei gefunden.
    Die .htaccess Datei " +"Es wurde weder im CONTENIDO Installationsverzeichnis noch im " +"Mandantenverzeichnis eine .htaccess Datei gefunden.
    Die .htaccess Datei " "sollte gegebenenfalls im Bereich %sFunktionen%s eingerichtet werden." -#: includes/include.mod_rewrite_content.php:197 +#: includes/include.mod_rewrite_content.php:192 +#, php-format +msgid "" +"Found some category and/or article aliases. It is recommended to run the " +"reset function in %sFunctions%s area, if needed." +msgstr "" +"Einige leere Kategorie- und/oder Artikelaliase wurden gefunden. Es wird " +"empfohlen, diese über den Bereich %sFunktionen%s zurückzusetzen." + +#: includes/include.mod_rewrite_content.php:195 msgid "Enable Advanced Mod Rewrite" msgstr "Advanced Mod Rewrite aktivieren" -#: includes/include.mod_rewrite_content.php:199 +#: includes/include.mod_rewrite_content.php:197 msgid "" "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 " +"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" +"processed,
    if the mod rewrite module is disabled" msgstr "" "Beim Deaktivieren des Plugins wird das mod rewrite Modul des Webservers " -"nicht mit deaktiviert - Das bedeutet,
    dass alle in der .htaccess " -"definerten Regeln weiterhin aktiv sind und einen unerwünschten " -"Nebeneffekt haben können.

    Apache mod rewrite lässt sich " -"in der .htaccess durch das Setzen der RewriteEngine-Direktive aktivieren/" -"deaktivieren.
    Wird das mod rewrite Modul deaktiviert, können die " -"in der .htaccess definierten Regeln weiterhin bleiben, sie werden
    dann " -"nicht verarbeitet." +"nicht mit deaktiviert - Das bedeutet,
    dass alle in der .htaccess " +"definerten Regeln weiterhin aktiv sind und einen unerwünschten Nebeneffekt " +"haben können.

    Apache mod rewrite lässt sich in der .htaccess durch " +"das Setzen der RewriteEngine-Direktive aktivieren/deaktivieren.
    Wird das " +"mod rewrite Modul deaktiviert, können die in der .htaccess definierten " +"Regeln weiterhin bleiben, sie werden
    dann nicht verarbeitet." -#: includes/include.mod_rewrite_content.php:201 +#: includes/include.mod_rewrite_content.php:199 msgid "Example" msgstr "Beispiel" -#: includes/include.mod_rewrite_content.php:203 +#: includes/include.mod_rewrite_content.php:201 msgid "" "# enable apache mod rewrite module\n" "RewriteEngine on\n" @@ -251,90 +115,90 @@ msgstr "" "# deaktivieren des apache mod rewrite moduls\n" "RewriteEngine off" -#: includes/include.mod_rewrite_content.php:205 +#: includes/include.mod_rewrite_content.php:203 msgid "Path to .htaccess from DocumentRoot" msgstr "Pfad zur .htaccess Datei vom DocumentRoot ausgehend" -#: includes/include.mod_rewrite_content.php:206 +#: includes/include.mod_rewrite_content.php:204 msgid "" "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/')" +"
    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/')" msgstr "" "Liegt die .htaccess im wwwroot (DocumentRoot), ist '/' anzugeben, ist " -"Contenido in einem
    Unterverzeichnis von wwwroot installiert, ist der " -"Pfad vom wwwroot aus anzugeben
    (z. B. http://domain/mycontenido -> " +"CONTENIDO in einem
    Unterverzeichnis von wwwroot installiert, ist der " +"Pfad vom wwwroot aus anzugeben
    (z. B. http://domain/mycontenido -> " "Pfad = '/mycontenido/')." -#: includes/include.mod_rewrite_content.php:208 +#: includes/include.mod_rewrite_content.php:206 msgid "Check path to .htaccess" -msgstr "Pfad zur .htaccess Datei überprüfen" +msgstr "Pfad zur .htaccess Datei überprüfen" + +#: includes/include.mod_rewrite_content.php:207 +msgid "" +"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." +msgstr "" +"Ist diese Option aktiv, wird der eingegebene Pfad überprüft. Das kann unter " +"
    Umständen einen Fehler verursachen, obwohl der Pfad zwar richtig ist, " +"aber der Mandant
    einen anderen DocumentRoot als das CONTENIDO Backend " +"hat." #: includes/include.mod_rewrite_content.php:209 -msgid "" -"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." -msgstr "" -"Ist diese Option aktiv, wird der eingegebene Pfad überprüft. Das " -"kann unter
    Umständen einen Fehler verursachen, obwohl der Pfad " -"zwar richtig ist, aber der Mandant
    einen anderen DocumentRoot als das " -"Contenido Backend hat." - -#: includes/include.mod_rewrite_content.php:211 msgid "Should the name of root category be displayed in the URL?" msgstr "Soll der Name des Hauptbaumes mit in der URL erscheinen?" -#: includes/include.mod_rewrite_content.php:212 +#: includes/include.mod_rewrite_content.php:210 msgid "Start from root category" msgstr "Start vom Hauptbaum aus" -#: includes/include.mod_rewrite_content.php:213 +#: includes/include.mod_rewrite_content.php:211 msgid "" -"If enabled, the name of the root category (e. g. \"Mainnavigation\" in a " -"Contenido default installation), will be preceded to the URL." +"If enabled, the name of the root category (e. g. 'Mainnavigation' in a " +"CONTENIDO default installation), will be preceded to the URL." msgstr "" -"Ist diese Option gewählt, wird der Name des Hauptbaumes (Kategoriebaum, " -"
    z. B. \"Hauptnavigation\" bei Contenido Standardinstallation) der URL " +"Ist diese Option gewählt, wird der Name des Hauptbaumes (Kategoriebaum, " +"
    z. B. 'Hauptnavigation' bei CONTENIDO Standardinstallation) der URL " "vorangestellt." -#: includes/include.mod_rewrite_content.php:215 +#: includes/include.mod_rewrite_content.php:213 msgid "Are several clients maintained in one directory?" msgstr "Werden mehrere Mandanten in einem Verzeichnis gepflegt?" -#: includes/include.mod_rewrite_content.php:216 +#: includes/include.mod_rewrite_content.php:214 msgid "Prepend client to the URL" msgstr "Mandant an die URL voranstellen" -#: includes/include.mod_rewrite_content.php:217 +#: includes/include.mod_rewrite_content.php:215 msgid "Use client name instead of the id" msgstr "Name des Mandanten anstatt die Id verwenden" -#: includes/include.mod_rewrite_content.php:219 +#: includes/include.mod_rewrite_content.php:217 msgid "" "Should the language appear in the URL (required for multi language websites)?" msgstr "" -"Soll die Sprache mit in der URL erscheinen (für Mehrsprachsysteme " +"Soll die Sprache mit in der URL erscheinen (für Mehrsprachsysteme " "unabdingbar)?" -#: includes/include.mod_rewrite_content.php:220 +#: includes/include.mod_rewrite_content.php:218 msgid "Prepend language to the URL" msgstr "Sprache an die URL voranstellen" -#: includes/include.mod_rewrite_content.php:221 +#: includes/include.mod_rewrite_content.php:219 msgid "Use language name instead of the id" msgstr "Name der Sprache anstatt die Id verwenden" -#: includes/include.mod_rewrite_content.php:223 +#: includes/include.mod_rewrite_content.php:221 msgid "" -"Configure your own separators with following 4 settings
    to control " +"Configure your own separators with following 4 settings
    to control " "generated URLs to your own taste" msgstr "" -"Mit den nächsten 4 Einstellungen können die Trennzeichen in " -"den
    generierten URLs nach den eigenen Wünschen gesetzt werden." +"Mit den nächsten 4 Einstellungen können die Trennzeichen in " +"den
    generierten URLs nach den eigenen Wünschen gesetzt werden." -#: includes/include.mod_rewrite_content.php:224 +#: includes/include.mod_rewrite_content.php:222 msgid "" "www.domain.com/category1-category2.articlename.html\n" "www.domain.com/category1/category2-articlename.html\n" @@ -346,13 +210,12 @@ msgstr "" "www.domain.de/kategorie.name1~kategorie2~artikelname.html\n" "www.domain.de/kategorie_name1-kategorie2-artikelname.foo" -#: includes/include.mod_rewrite_content.php:225 +#: includes/include.mod_rewrite_content.php:223 msgid "Category separator has to be different from category-word separator" msgstr "" -"Kategorie-Separator und Kategoriewort-Separator müssen unterschiedlich " -"sein" +"Kategorie-Separator und Kategoriewort-Separator müssen unterschiedlich sein" -#: includes/include.mod_rewrite_content.php:226 +#: includes/include.mod_rewrite_content.php:224 msgid "" "# Example: Category separator (/) and category-word separator (_)\n" "category_one/category_two/articlename.html" @@ -360,13 +223,12 @@ msgstr "" "# Beispiel: Kategorie-Separator (/) und Kategoriewort-Separator (_)\n" "kategorie_eins/kategorie_zwei/artikelname.html" -#: includes/include.mod_rewrite_content.php:227 +#: includes/include.mod_rewrite_content.php:225 msgid "Category separator has to be different from article-word separator" msgstr "" -"Kategorie-Separator und Artikelwort-Separator müssen unterschiedlich " -"sein" +"Kategorie-Separator und Artikelwort-Separator müssen unterschiedlich sein" -#: includes/include.mod_rewrite_content.php:228 +#: includes/include.mod_rewrite_content.php:226 msgid "" "# Example: Category separator (/) and article-word separator (-)\n" "category_one/category_two/article-description.html" @@ -374,14 +236,14 @@ msgstr "" "# Beispiel: Kategorie-Separator (/) und Artikelwort-Separator (-)\n" "kategorie_eins/kategorie_zwei/artikel-bezeichnung.html" -#: includes/include.mod_rewrite_content.php:229 +#: includes/include.mod_rewrite_content.php:227 msgid "" "Category-article separator has to be different from article-word separator" msgstr "" -"Kategorie-Artikel-Separator und Artikelwort-Separator müssen " -"unterschiedlich sein" +"Kategorie-Artikel-Separator und Artikelwort-Separator müssen unterschiedlich " +"sein" -#: includes/include.mod_rewrite_content.php:230 +#: includes/include.mod_rewrite_content.php:228 msgid "" "# Example: Category-article separator (/) and article-word separator (-)\n" "category_one/category_two/article-description.html" @@ -389,81 +251,79 @@ msgstr "" "# Beispiel: Kategorie-Artikel-Separator (/) und Artikelwort-Separator (-)\n" "kategorie_eins/kategorie_zwei/artikel-bezeichnung.html" -#: includes/include.mod_rewrite_content.php:232 +#: includes/include.mod_rewrite_content.php:230 msgid "Category separator (delemiter between single categories)" msgstr "Kategorie-Separator (Trenner zwischen einzelnen Kategorien)" -#: includes/include.mod_rewrite_content.php:233 -#: includes/include.mod_rewrite_content.php:234 +#: includes/include.mod_rewrite_content.php:231 +#: includes/include.mod_rewrite_content.php:232 #, php-format msgid "(possible values: %s)" -msgstr "(mögliche Werte: %s)" +msgstr "(mögliche Werte: %s)" -#: includes/include.mod_rewrite_content.php:235 +#: includes/include.mod_rewrite_content.php:233 msgid "Category-word separator (delemiter between category words)" -msgstr "" -"Kategoriewort-Separator (Trenner zwischen einzelnen Kategoriewörtern)" +msgstr "Kategoriewort-Separator (Trenner zwischen einzelnen Kategoriewörtern)" -#: includes/include.mod_rewrite_content.php:236 +#: includes/include.mod_rewrite_content.php:234 msgid "" "Category-article separator (delemiter between category-block and article)" msgstr "" "Kategorie-Artikel-Separator (Trenner zwischen Kategorieabschnitt und " "Artikelname)" -#: includes/include.mod_rewrite_content.php:237 +#: includes/include.mod_rewrite_content.php:235 msgid "Article-word separator (delemiter between article words)" -msgstr "Artikelwort-Separator (Trenner zwischen einzelnen Artikelwörtern)" +msgstr "Artikelwort-Separator (Trenner zwischen einzelnen Artikelwörtern)" + +#: includes/include.mod_rewrite_content.php:237 +msgid "Append article name to URLs" +msgstr "Artikelname an URLs anhängen" + +#: includes/include.mod_rewrite_content.php:238 +msgid "Append article name always to URLs (even at URLs to categories)" +msgstr "Artikelname immer an die URLs anhängen (auch bei URLs zu Kategorien)" #: includes/include.mod_rewrite_content.php:239 -msgid "Append article name to URLs" -msgstr "Artikelname an URLs anhängen" - -#: includes/include.mod_rewrite_content.php:240 -msgid "Append article name always to URLs (even at URLs to categories)" -msgstr "" -"Artikelname immer an die URLs anhängen (auch bei URLs zu Kategorien)" - -#: includes/include.mod_rewrite_content.php:241 msgid "Default article name without extension" msgstr "Standard-Artikelname ohne Dateiendung" -#: includes/include.mod_rewrite_content.php:242 +#: includes/include.mod_rewrite_content.php:240 msgid "" -"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" +"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" msgstr "" -"z. B. \"index\" für index.ext.
    Wenn die Option \"Artikelname immer " -"an die URLs anhängen\" aktiviert und das Feld leer ist,
    wird der " -"Name des Startartikels verwendet." +"z. B. 'index' für index.ext.
    Wenn die Option 'Artikelname immer an die " +"URLs anhängen' aktiviert und das Feld leer ist,
    wird der Name des " +"Startartikels verwendet." -#: includes/include.mod_rewrite_content.php:244 +#: includes/include.mod_rewrite_content.php:242 msgid "File extension at the end of the URL" msgstr "Dateiendung am Ende der URL" -#: includes/include.mod_rewrite_content.php:245 +#: includes/include.mod_rewrite_content.php:243 msgid "" -"Specification of file extension with a preceded dot
    e.g. \".html\" for " +"Specification of file extension with a preceded dot
    e.g. '.html' for " "http://host/foo/bar.html" msgstr "" -"Angabe der Dateiendung mit einem vorangestellten Punkt,
    z. B. \".html\" " -"für http://host/foo/bar.html" +"Angabe der Dateiendung mit einem vorangestellten Punkt,
    z. B. '.html' für " +"http://host/foo/bar.html" -#: includes/include.mod_rewrite_content.php:246 +#: includes/include.mod_rewrite_content.php:244 msgid "" -"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." +"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." msgstr "" -"Falls die Option \"Artikelname immer an die URLs anhängen\" nicht " -"gewählt wurde,
    ist es zwingend notwending, dass hier eine " -"Dateiendung angegeben wird.

    Sonst haben URLs zu Kategorien und zu " -"Seiten das gleiche Format, und die korrekte
    Auflösung der " -"Kategorie und/oder des Artikels kann nicht gewährleistet werden." +"Falls die Option 'Artikelname immer an die URLs anhängen' nicht gewählt " +"wurde,
    ist es zwingend notwending, dass hier eine Dateiendung angegeben " +"wird.

    Sonst haben URLs zu Kategorien und zu Seiten das gleiche " +"Format, und die korrekte
    Auflösung der Kategorie und/oder des Artikels " +"kann nicht gewährleistet werden." -#: includes/include.mod_rewrite_content.php:247 +#: includes/include.mod_rewrite_content.php:245 msgid "" "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 " @@ -473,150 +333,147 @@ msgstr "" "wurden konnten, sollte unbedingt eine Endung angegeben werden. Ohne eine " "angegebene Endung kann es zur fehlerhaften Erkennung der Artikel kommen." -#: includes/include.mod_rewrite_content.php:249 +#: includes/include.mod_rewrite_content.php:247 msgid "Should the URLs be written in lower case?" msgstr "Sollen die URLs klein geschrieben werden?" -#: includes/include.mod_rewrite_content.php:250 +#: includes/include.mod_rewrite_content.php:248 msgid "URLs in lower case" msgstr "URLs in Kleinbuchstaben" -#: includes/include.mod_rewrite_content.php:252 +#: includes/include.mod_rewrite_content.php:250 msgid "Duplicated content" msgstr "Duplicated Content" -#: includes/include.mod_rewrite_content.php:253 +#: includes/include.mod_rewrite_content.php:251 msgid "Prevent duplicated content" msgstr "Duplicated Content verhindern" -#: includes/include.mod_rewrite_content.php:255 +#: includes/include.mod_rewrite_content.php:253 msgid "" -"Depending on configuration, pages could be found thru different URLs.
    Enabling of this option prevents this. Examples for duplicated content" +"Depending on configuration, pages could be found thru different URLs." +"
    Enabling of this option prevents this. Examples for duplicated content" msgstr "" -"Seiten werden je nach Konfiguration unter verschiedenen URLs gefunden.
    Das Aktivieren dieser Option unterbindet dies. Beispiele für " -"duplicated Content" +"Seiten werden je nach Konfiguration unter verschiedenen URLs gefunden." +"
    Das Aktivieren dieser Option unterbindet dies. Beispiele für duplicated " +"Content" -#: includes/include.mod_rewrite_content.php:256 +#: includes/include.mod_rewrite_content.php:254 msgid "" "Name of the root category in the URL: Feasible is /maincategory/subcategory/ " "and /subcategory/\n" "Language in the URL: Feasible is /german/category/ and /1/category/\n" "Client in the URL: Feasible is /client/category/ und /1/category/" msgstr "" -"Name des Hauptbaumes in der URL: Möglich /hauptkategorie/" -"unterkategorie/ und /unterkategorie/\n" -"Sprache in der URL: Möglich /deutsch/kategorie/ und /1/kategorie/\n" -"Mandant in der URL: Möglich /mandant/kategorie/ und /1/kategorie/" +"Name des Hauptbaumes in der URL: Möglich /hauptkategorie/unterkategorie/ " +"und /unterkategorie/\n" +"Sprache in der URL: Möglich /deutsch/kategorie/ und /1/kategorie/\n" +"Mandant in der URL: Möglich /mandant/kategorie/ und /1/kategorie/" -#: includes/include.mod_rewrite_content.php:259 +#: includes/include.mod_rewrite_content.php:257 msgid "Percentage for similar category paths in URLs" -msgstr "Prozentsatz für ähnliche Kategorie-Pfade in URLs" +msgstr "Prozentsatz für ähnliche Kategorie-Pfade in URLs" -#: includes/include.mod_rewrite_content.php:260 +#: includes/include.mod_rewrite_content.php:258 msgid "" "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.
    A incoming URL will be cleaned from those values and the " -"remaining path (urlpath of the category)
    will be checked against " -"similarities." +"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." msgstr "" "Diese Einstellung bezieht sich nur auf den Kategorieteil einer URL. Ist AMR " -"so konfiguriert, dass z. B. die
    Hauptnavigation und/oder Sprache sowie " -"der Name des Mandanten an die URL vorangestellt wird, so wird der hier
    definierte Prozentsatz nicht auf diese Werte der URL angewendet.
    Eine " -"ankommende URL wird von solchen Präfixen entfernt, der übrig " -"gebliebene Pfad (Urlpfad der Kategorie)
    wird auf die Ähnlichkleit " -"hin geprüft." +"so konfiguriert, dass z. B. die
    Hauptnavigation und/oder Sprache sowie " +"der Name des Mandanten an die URL vorangestellt wird, so wird der hier " +"
    definierte Prozentsatz nicht auf diese Werte der URL angewendet.
    Eine " +"ankommende URL wird von solchen Präfixen entfernt, der übrig gebliebene Pfad " +"(Urlpfad der Kategorie)
    wird auf die Ähnlichkleit hin geprüft." -#: includes/include.mod_rewrite_content.php:261 +#: includes/include.mod_rewrite_content.php:259 msgid "" "100 = exact match with no tolerance\n" "85 = paths with little errors will match to similar ones\n" "0 = matching will work even for total wrong paths" msgstr "" -"100 = exakte überinstimmung, keine fehlertoleranz\n" +"100 = exakte überinstimmung, keine fehlertoleranz\n" "85 = pfade mit kleineren fehlern ergeben auch treffern\n" -"0 = vollständig fehlerhafte pfade ergeben dennoch einen treffer" +"0 = vollständig fehlerhafte pfade ergeben dennoch einen treffer" + +#: includes/include.mod_rewrite_content.php:261 +msgid "Redirect in case of invalid articles" +msgstr "Weiterleitung bei ungültigen Artikeln" + +#: includes/include.mod_rewrite_content.php:262 +msgid "Redirect to error page in case of invaid articles" +msgstr "Bei ungültigen Artikeln zur Fehlerseite weiterleiten" #: includes/include.mod_rewrite_content.php:263 -msgid "Redirect in case of invalid articles" -msgstr "Weiterleitung bei ungültigen Artikeln" - -#: includes/include.mod_rewrite_content.php:264 -msgid "Redirect to error page in case of invaid articles" -msgstr "Bei ungültigen Artikeln zur Fehlerseite weiterleiten" - -#: includes/include.mod_rewrite_content.php:265 msgid "The start page will be displayed if this option is not enabled" msgstr "Ist die Option nicht aktiv, wird die Startseite angezeigt" -#: includes/include.mod_rewrite_content.php:267 +#: includes/include.mod_rewrite_content.php:265 msgid "Moment of URL generation" msgstr "Zeitpunkt zum Generieren der URLs" -#: includes/include.mod_rewrite_content.php:268 +#: includes/include.mod_rewrite_content.php:266 msgid "a.) During the output of HTML code of the page" msgstr "a.) Bei der Ausgabe des HTML Codes der Seite" -#: includes/include.mod_rewrite_content.php:269 +#: includes/include.mod_rewrite_content.php:267 msgid "" "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 " +"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." msgstr "" -"Clean-URLs werden bei der Ausgabe der Seite generiert. Module/Plugins kö" -"nnen URLs zum Frontend,
    wie in früheren Versionen von Contenido " -"üblich, nach dem Muster \"front_content.php?idcat=1&idart=2\"
    ausgeben. Die URLs werden vom Plugin vor der Ausgabe des HTML-Outputs Clean-" -"URLs ersetzt." +"Clean-URLs werden bei der Ausgabe der Seite generiert. Module/Plugins können " +"URLs zum Frontend,
    wie in früheren Versionen von CONTENIDO üblich, nach " +"dem Muster 'front_content.php?idcat=1&idart=2'
    ausgeben. Die URLs " +"werden vom Plugin vor der Ausgabe des HTML-Outputs Clean-URLs ersetzt." -#: includes/include.mod_rewrite_content.php:270 +#: includes/include.mod_rewrite_content.php:268 msgid "Differences to variant b.)" msgstr "Unterschiede zur Variante b.)" -#: includes/include.mod_rewrite_content.php:271 +#: includes/include.mod_rewrite_content.php:269 msgid "" "Still compatible to old modules/plugins, since no changes in codes are " "required\n" "All occurring URLs in HTML code, even those set by wysiwyg, will be switched " "to Clean-URLs\n" -"All URLs will usually be collected and converted to Clean-URLs at once.
    Doing it this way reduces the amount of executed database significantly." +"All URLs will usually be collected and converted to Clean-URLs at once." +"
    Doing it this way reduces the amount of executed database significantly." msgstr "" -"Weiterhin Kompatibel zu älteren Modulen/Plugins, da keine Ä" -"nderungen am Code nötig sind\n" -"Sämtliche im HTML-Code vorkommende URLs, auch über wysiwyg " -"gesetzte URLs,
    werden auf Clean-URLs umgestellt\n" +"Weiterhin Kompatibel zu älteren Modulen/Plugins, da keine Änderungen am Code " +"nötig sind\n" +"Sämtliche im HTML-Code vorkommende URLs, auch über wysiwyg gesetzte URLs, " +"
    werden auf Clean-URLs umgestellt\n" "Alle umzuschreibenden URLs werden in der Regel \"gesammelt\" und auf eimmal " -"umgeschreiben,
    dadurch wird die Anzahl der DB-Abfragen sehr stark " +"umgeschreiben,
    dadurch wird die Anzahl der DB-Abfragen sehr stark " "minimiert" -#: includes/include.mod_rewrite_content.php:274 +#: includes/include.mod_rewrite_content.php:272 msgid "b.) In modules or plugins" msgstr "b.) In Modulen oder Plugins" -#: includes/include.mod_rewrite_content.php:275 +#: includes/include.mod_rewrite_content.php:273 msgid "" "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:" +"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:" msgstr "" "Bei dieser Option werden die Clean-URLs direkt in Modulen/Plugins generiert. " -"Das bedeutet,
    dass alle internen URLs auf Kategorien/Artikel in den " -"Modulausgaben ggf. manuell angepasst werden müssen.
    Clean-URLs " -"müssen dann stets mit folgender Funktion erstellt werden:" +"Das bedeutet,
    dass alle internen URLs auf Kategorien/Artikel in den " +"Modulausgaben ggf. manuell angepasst werden müssen.
    Clean-URLs müssen " +"dann stets mit folgender Funktion erstellt werden:" -#: includes/include.mod_rewrite_content.php:276 +#: includes/include.mod_rewrite_content.php:274 msgid "" "# 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" +"# 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);" @@ -624,38 +481,38 @@ msgstr "" "# aufbau einer normalen url\n" "$url = 'front_content.php?idart=123&lang=2&client=1';\n" "\n" -"# erstellen der neuen Url über Contenidos Url-Builder (seit 4.8.9),\n" +"# erstellen der neuen Url über CONTENIDOs Url-Builder (seit 4.8.9),\n" "# der die Parameter als assoziatives array erwartet\n" "$params = array('idart'=>123, 'lang'=>2, 'client'=>1);\n" "$newUrl = Contenido_Url::getInstance()->build($params);" -#: includes/include.mod_rewrite_content.php:277 +#: includes/include.mod_rewrite_content.php:275 msgid "Differences to variant a.)" msgstr "Unterschiede zur Variante a.)" -#: includes/include.mod_rewrite_content.php:278 +#: includes/include.mod_rewrite_content.php:276 msgid "" "The default way to generate URLs to fronend pages\n" -"Each URL in modules/plugins has to be generated by UrlBuilder\n" +"Each URL in modules/plugins has to be generated by UriBuilder\n" "Each generated Clean-Url requires a database query" msgstr "" "Der Standardweg um URLs zu Frontendseiten zu generieren\n" "Jede URL in Modulen/Plugins ist vom UrlBuilder zu erstellen\n" -"Für jede umzuschreibende URL ist eine Datenbankabfrage nötig" +"Für jede umzuschreibende URL ist eine Datenbankabfrage nötig" -#: includes/include.mod_rewrite_content.php:281 +#: includes/include.mod_rewrite_content.php:279 msgid "Routing" msgstr "Routing" -#: includes/include.mod_rewrite_content.php:282 +#: includes/include.mod_rewrite_content.php:280 msgid "Routing definitions for incoming URLs" -msgstr "Routing Definitionen für eingehende URLs" +msgstr "Routing Definitionen für eingehende URLs" -#: includes/include.mod_rewrite_content.php:283 +#: includes/include.mod_rewrite_content.php:281 msgid "Type one routing definition per line as follows:" msgstr "Pro Zeile eine Routing Definition wie folgt eingeben:" -#: includes/include.mod_rewrite_content.php:284 +#: includes/include.mod_rewrite_content.php:282 msgid "" "# {incoming_url}>>>{new_url}\n" "/incoming_url/name.html>>>new_url/new_name.html\n" @@ -677,51 +534,50 @@ msgstr "" "# request zum wwwroot auf eine bestimmte seite routen\n" "/>>>front_content.php?idart=16" -#: includes/include.mod_rewrite_content.php:285 +#: includes/include.mod_rewrite_content.php:283 msgid "" "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)\n" +"the redirection will happen internally by
    replacing the detected incoming " +"URL against the new destination URL (overwriting of article- categoryid)\n" "Incoming URLs can point to non existing resources (category/article), but " -"the desttination URLs should point
    to valid Contenido articles/" +"the desttination URLs should point
    to valid CONTENIDO articles/" "categories\n" -"Destination URLs should point to real URLs to categories/articles,
    e. g." +"Destination URLs should point to real URLs to categories/articles,
    e. g." "front_content.php?idcat=23 or front_content.php?idart=34\n" -"The language id should attached to the URL in multi language sites
    e. " -"g. front_content.php?idcat=23&lang=1\n" +"The language id should attached to the URL in multi language sites
    e. g. " +"front_content.php?idcat=23&lang=1\n" "The client id should attached to the URL in multi client sites sharing the " -"same folder
    e. g. front_content.php?idcat=23&client=2\n" +"same folder
    e. g. front_content.php?idcat=23&client=2\n" "The destination URL should not start with '/' or './' (wrong: /front_content." "php, correct: front_content.php)" msgstr "" "Das Routing schickt keinen HTTP Header mit einer Weiterleitung zur Ziel-URL, " -"die Umleitung findet intern
    durch das Ersetzen der erkannten " -"Eingangsseite gegen die neue Zielseite statt (Überschreiben der " -"Artikel-/Kategorieid)\n" -"Eingehende URLs können auch nicht vorhandene Ressourcen (Kategorie, " -"Artikel) sein, hinter der Ziel URL muss eine
    gültige Contenido-" -"Seite (Kategorie/Artikel) liegen\n" +"die Umleitung findet intern
    durch das Ersetzen der erkannten " +"Eingangsseite gegen die neue Zielseite statt (Überschreiben der Artikel-/" +"Kategorieid)\n" +"Eingehende URLs können auch nicht vorhandene Ressourcen (Kategorie, Artikel) " +"sein, hinter der Ziel URL muss eine
    gültige CONTENIDO-Seite (Kategorie/" +"Artikel) liegen\n" "Als Ziel URL sollte eine reale URL zur Kategorie/Seite angegeben werden, " -"
    z. B. front_content.php?idcat=23 oder front_content.php?idart=34.\n" -"Bei mehrsprachigen Auftritten sollte die Id der Sprache angehängt " -"werden,
    z. B. front_content.php?idcat=23&lang=1\n" +"
    z. B. front_content.php?idcat=23 oder front_content.php?idart=34.\n" +"Bei mehrsprachigen Auftritten sollte die Id der Sprache angehängt werden, " +"
    z. B. front_content.php?idcat=23&lang=1\n" "Bei mehreren Mandanten im gleichen Verzeichnis sollte die Id des Mandanten " -"angehängt werden,
    z. B. front_content.php?idcat=23&client=2\n" +"angehängt werden,
    z. B. front_content.php?idcat=23&client=2\n" "Die Zielurl sollte nicht mit '/' oder './' beginnen (falsch: /front_content." "php, richtig: front_content.php)" -#: includes/include.mod_rewrite_content.php:288 -#: includes/include.mod_rewrite_contentexpert.php:128 +#: includes/include.mod_rewrite_content.php:286 +#: includes/include.mod_rewrite_contentexpert.php:90 msgid "Discard changes" -msgstr "Änderungen verwerfen" +msgstr "Änderungen verwerfen" -#: includes/include.mod_rewrite_content.php:289 -#: includes/include.mod_rewrite_contentexpert.php:129 +#: includes/include.mod_rewrite_content.php:287 +#: includes/include.mod_rewrite_contentexpert.php:91 msgid "Save changes" -msgstr "Änderungen speichern" +msgstr "Änderungen speichern" -#: includes/include.mod_rewrite_contenttest.php:73 +#: includes/include.mod_rewrite_contenttest.php:55 msgid "" "Define options to genereate the URLs by using the form below and run the " "test." @@ -729,223 +585,360 @@ msgstr "" "Optionen zum Generieren der URLs im folgenden Formular setzen und den Test " "starten." -#: includes/include.mod_rewrite_contenttest.php:74 +#: includes/include.mod_rewrite_contenttest.php:56 msgid "Parameter to use" msgstr "Zu verwendende Parameter" -#: includes/include.mod_rewrite_contenttest.php:75 +#: includes/include.mod_rewrite_contenttest.php:57 msgid "Number of URLs to generate" msgstr "Anzahl der zu generierenden URLs" -#: includes/include.mod_rewrite_contenttest.php:76 +#: includes/include.mod_rewrite_contenttest.php:58 msgid "Run test" msgstr "Test starten" -#: includes/include.mod_rewrite_contenttest.php:78 +#: includes/include.mod_rewrite_contenttest.php:60 msgid "" -"{pref}{name}\n" -"{pref}Builder in: {url_in}\n" -"{pref}Builder out: {url_out}\n" -"{pref}Resolved URL: {url_res}\n" -"{pref}Resolved data: {data}" +"{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}" msgstr "" -"{pref}{name}\n" -"{pref}Builder Eingang: {url_in}\n" -"{pref}Builder Ausgang: {url_out}\n" -"{pref}Aufgelöste URL: {url_res}\n" -"{pref}Aufgelöste Daten: {data}" +"{pref}{name}
    {pref}Builder Eingang: {url_in}
    {pref}" +"Builder Ausgang: {url_out}
    {pref}Aufgelöste " +"URL: {url_res}
    {pref}Aufgelöse-Fehler: {err}
    {pref}" +"Aufgelöste Daten: {data}" -#: includes/include.mod_rewrite_contenttest.php:84 +#: includes/include.mod_rewrite_contenttest.php:62 msgid "" -"Duration of test run: {time} seconds.
    \n" -"Number of processed URLs: {num_urls}
    \n" -"Successful resolved: {num_success}
    \n" -"Errors during resolving: {num_fail}" +"Duration of test run: {time} seconds.
    Number of processed URLs: {num_urls}" +"
    Successful resolved: {num_success}
    Errors during resolving: {num_fail}" msgstr "" -"Dauer des Testdurchlaufs: {time} Sekunden.
    \n" -"Anzahl verarbeiteter URLs: {num_urls}
    \n" -"Erfolgreich aufgelöst: {num_success}
    \n" -"Fehler beim Auflösen: {num_fail}Anzahl verarbeiteter URLs: " +"{num_urls}
    Erfolgreich aufgelöst: {num_success}" +"
    Fehler beim Auflösen: {num_fail}" -#: includes/config.plugin.php:176 -msgid "MR-Options" -msgstr "MR-Einstellungen" - -#: includes/config.plugin.php:177 -msgid "Expert Options" -msgstr "Experteneinstellungen" - -#: includes/config.plugin.php:178 -msgid "MR Test Area" -msgstr "MR Testbereich" - -#: includes/include.mod_rewrite_contentexpert.php:80 +#: includes/include.mod_rewrite_contentexpert.php:61 msgid "Plugin functions" msgstr "Plugin Funktionen" -#: includes/include.mod_rewrite_contentexpert.php:82 +#: includes/include.mod_rewrite_contentexpert.php:63 msgid "Copy/Download .htaccess template" msgstr ".htaccess Vorlage kopieren/downloaden" -#: includes/include.mod_rewrite_contentexpert.php:83 +#: includes/include.mod_rewrite_contentexpert.php:64 msgid "Select .htaccess template" -msgstr ".htaccess Vorlage auswählen" +msgstr ".htaccess Vorlage auswählen" -#: includes/include.mod_rewrite_contentexpert.php:84 +#: includes/include.mod_rewrite_contentexpert.php:65 msgid "Restrictive .htaccess" msgstr "Restriktive .htaccess" -#: includes/include.mod_rewrite_contentexpert.php:85 +#: includes/include.mod_rewrite_contentexpert.php:66 msgid "Simple .htaccess" msgstr "Einfache .htaccess" -#: includes/include.mod_rewrite_contentexpert.php:86 +#: includes/include.mod_rewrite_contentexpert.php:67 msgid "" -"Contains rules with restrictive settings.
    \n" -"All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, " -"jpg, js, mov,
    \n" -"mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom " -"rewriting.
    \n" -"Remaining requests will be rewritten to front_content.php,
    \n" -"except requests to 'contenido/', 'setup/', 'cms/upload', 'cms/front_content." -"php', etc.
    \n" -"Each resource, which has to be excluded from rewriting must be specified " -"explicitly." +"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." msgstr "" -"Enthält Regeln mit restriktiveren Einstellungen.
    Alle Anfragen, " -"die auf die Dateienendung avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, " -"mov,
    mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip gehen, werden " -"vom Umschreiben ausgeschlossen.
    Alle anderen Anfragen, werden an " -"front_content.php umschrieben.
    Ausgeschlossen davon sind 'contenido/', " -"'setup/', 'cms/upload', 'cms/front_content.php', usw.
    Jede neue " +"Enthält Regeln mit restriktiveren Einstellungen.
    Alle Anfragen, die auf " +"die Dateienendung avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, mov, " +"
    mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip gehen, werden vom " +"Umschreiben ausgeschlossen.
    Alle anderen Anfragen, werden an " +"front_content.php umschrieben.
    Ausgeschlossen davon sind 'contenido/', " +"'setup/', 'cms/upload', 'cms/front_content.php', usw.
    Jede neue " "Ressource, die vom Umschreiben ausgeschlossen werden soll, muss explizit " "definiert werden." -#: includes/include.mod_rewrite_contentexpert.php:93 +#: includes/include.mod_rewrite_contentexpert.php:69 msgid "" -"Contains a sipmle collection of rules. Each requests pointing to valid " -"symlinks, folders or
    \n" -"files, will be excluded from rewriting. Remaining requests will be rewritten " -"to front_content.php" +"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" msgstr "" -"Enthält eine einfachere Sammlung an Regeln. Alle Anfragen, die auf " -"gültige Symlinks, Verzeichnisse oder
    Dateien gehen, werden vom " -"Umschreiben ausgeschlossen. Restliche Anfragen werden an front_content." -"php
    umschrieben." +"Enthält eine einfachere Sammlung an Regeln. Alle Anfragen, die auf gültige " +"Symlinks, Verzeichnisse oder
    Dateien gehen, werden vom Umschreiben " +"ausgeschlossen. Restliche Anfragen werden an front_content." +"php
    umschrieben." -#: includes/include.mod_rewrite_contentexpert.php:96 +#: includes/include.mod_rewrite_contentexpert.php:71 msgid "and copy to" msgstr "und kopieren in" -#: includes/include.mod_rewrite_contentexpert.php:97 -msgid "Contenido installation directory" -msgstr "das Contenido Installationsverzeichnis" +#: includes/include.mod_rewrite_contentexpert.php:72 +msgid "CONTENIDO installation directory" +msgstr "das CONTENIDO Installationsverzeichnis" -#: includes/include.mod_rewrite_contentexpert.php:98 +#: includes/include.mod_rewrite_contentexpert.php:73 msgid "" -"Copy the selected .htaccess template into Contenido installation " -"directory
    \n" -"
    \n" -"    {CONTENIDO_FULL_PATH}.
    \n" -"
    \n" -"This is the recommended option for a Contenido installation with one or more " -"clients
    \n" -"who are running on the same domain." +"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." msgstr "" -"Die gewählte .htaccess Vorlage in das Contenido " -"Installationsverzeichnis
    \n" -"
    \n" -"    {CONTENIDO_FULL_PATH}
    \n" -"
    \n" -"kopieren.
    \n" -"Das ist die empfohlene Option für eine Contenido-Installation mit einem " -"Mandanten oder
    \n" +"Die gewählte .htaccess Vorlage in das CONTENIDO " +"Installationsverzeichnis
    \n" +"
    \n" +"    {CONTENIDO_FULL_PATH}
    \n" +"
    \n" +"kopieren.
    \n" +"Das ist die empfohlene Option für eine CONTENIDO-Installation mit einem " +"Mandanten oder
    \n" "mehreren Mandanten, die alle unter der gleichen Domain laufen." -#: includes/include.mod_rewrite_contentexpert.php:105 +#: includes/include.mod_rewrite_contentexpert.php:75 msgid "client directory" msgstr "das Mandantenverzeichnis" -#: includes/include.mod_rewrite_contentexpert.php:106 +#: includes/include.mod_rewrite_contentexpert.php:76 msgid "" -"Copy the selected .htaccess template into client's directory
    \n" -"
    \n" -"    {CLIENT_FULL_PATH}.
    \n" -"
    \n" -"This is the recommended option for a multiple client system
    \n" -"where each client has it's own domain/subdomain" +"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" msgstr "" -"Die gewählte .htaccess Vorlage in das Mandantenerzeichnis
    \n" -"
    \n" -"    {CLIENT_FULL_PATH}
    \n" -"
    \n" -"kopieren.
    \n" -"Diese Option ist z. B. bei einem Mehrmandantensystem empfohlen,
    \n" -"wenn jeder Mandant unter einer eigenen Domain/Subdomain läuft." +"Die gewählte .htaccess Vorlage in das Mandantenerzeichnis
    \n" +"
    \n" +"    {CLIENT_FULL_PATH}
    \n" +"
    \n" +"kopieren.
    \n" +"Diese Option ist z. B. bei einem Mehrmandantensystem empfohlen,
    \n" +"wenn jeder Mandant unter einer eigenen Domain/Subdomain läuft." -#: includes/include.mod_rewrite_contentexpert.php:113 +#: includes/include.mod_rewrite_contentexpert.php:78 msgid "or" msgstr "oder" -#: includes/include.mod_rewrite_contentexpert.php:114 +#: includes/include.mod_rewrite_contentexpert.php:79 msgid "Download" msgstr "Downloaden" -#: includes/include.mod_rewrite_contentexpert.php:115 +#: includes/include.mod_rewrite_contentexpert.php:80 msgid "" "Download selected .htaccess template to copy it to the destination " -"folder
    \n" -"or to take over the settings manually." +"folder
    or to take over the settings manually." msgstr "" -"Die gewählte .htaccess Vorlage downloaden um z. B. die Datei " -"manuell
    \n" -"in das Verzeichnis zu kopieren oder Einstellungen zu übernehmen." +"Die gewählte .htaccess Vorlage downloaden um z. B. die Datei manuell
    \n" +"in das Verzeichnis zu kopieren oder Einstellungen zu übernehmen." -#: includes/include.mod_rewrite_contentexpert.php:118 +#: includes/include.mod_rewrite_contentexpert.php:82 msgid "Reset category-/ and article aliases" -msgstr "Kategorie-/ und Artikel-Aliase zurücksetzen" +msgstr "Kategorie-/ und Artikel-Aliase zurücksetzen" -#: includes/include.mod_rewrite_contentexpert.php:119 +#: includes/include.mod_rewrite_contentexpert.php:83 msgid "Reset only empty aliases" -msgstr "Nur leere Aliase zurücksetzen" +msgstr "Nur leere Aliase zurücksetzen" -#: includes/include.mod_rewrite_contentexpert.php:120 +#: includes/include.mod_rewrite_contentexpert.php:84 msgid "" "Only empty aliases will be reset, existing aliases, e. g. manually set " "aliases, will not be changed." msgstr "" -"Nur leere Kategorie-/Artikelaliase initial setzen
    Vorhandene Aliase, z." -"B. vorher manuell gesetze Aliase werden nicht geändert." +"Nur leere Kategorie-/Artikelaliase initial setzen
    Vorhandene Aliase, z.B. " +"vorher manuell gesetze Aliase werden nicht geändert." -#: includes/include.mod_rewrite_contentexpert.php:121 +#: includes/include.mod_rewrite_contentexpert.php:85 msgid "Reset all aliases" -msgstr "Alle Aliase zurücksetzen" +msgstr "Alle Aliase zurücksetzen" -#: includes/include.mod_rewrite_contentexpert.php:122 +#: includes/include.mod_rewrite_contentexpert.php:86 msgid "" "Reset all category-/article aliases. Existing aliases will be overwritten." msgstr "" -"Alle Kategorie-/Artikelaliase neu setzen.
    Vorhandene Aliase werden " -"überschrieben." +"Alle Kategorie-/Artikelaliase neu setzen.
    Vorhandene Aliase werden " +"überschrieben." -#: includes/include.mod_rewrite_contentexpert.php:124 +#: includes/include.mod_rewrite_contentexpert.php:88 msgid "" "This process could require some time depending on amount of categories/" -"articles.
    \n" -"The aliases will not contain the configured plugin separators, but the " -"Contenido default separators '/' und '-', e. g. '/category-word/article-" -"word'.
    \n" -"Execution of this function ma be helpful to prepare all or empty aliases for " -"the usage by the plugin." +"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." msgstr "" "Dieser Prozess kann je nach Anzahl der Kategorien/Artikel etwas Zeit in " -"Anspruch nehmen.
    \n" +"Anspruch nehmen.
    \n" "Die Aliase erhalten nicht die oben konfigurierten Separatoren, sondern die " -"Contenido-Standardseparatoren '/' und '-', z. B. '/category-word/article-" -"word'.
    \n" -"Das Ausführen dieser Funktion kann Hilfreich sein, um sämtliche " -"oder nur leere Aliase nachträglich auf die Verwendung mit dem Plugin " -"anzupassen." +"CONTENIDO-Standardseparatoren '/' und '-', z. B. '/category-word/article-" +"word'.
    \n" +"Das Ausführen dieser Funktion kann Hilfreich sein, um sämtliche oder nur " +"leere Aliase nachträglich auf die Verwendung mit dem Plugin anzupassen." + +#: includes/config.plugin.php:71 +msgid "Advanced Mod Rewrite" +msgstr "Advanced Mod Rewrite" + +#: includes/config.plugin.php:72 +msgid "Advanced Mod Rewrite functions" +msgstr "Advanced Mod Rewrite Funktionen" + +#: includes/config.plugin.php:73 +msgid "Advanced Mod Rewrite test" +msgstr "Advanced Mod Rewrite Test" + +#: classes/controller/class.modrewrite_controller_abstract.php:107 +msgid "More informations" +msgstr "Weitere Informationen" + +#: classes/controller/class.modrewrite_content_controller.php:65 +msgid "" +"The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\\-_" +"\\/\\.]" +msgstr "" +"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen [a-" +"zA-Z0-9\\-_\\/\\.]" + +#: classes/controller/class.modrewrite_content_controller.php:72 +#, php-format +msgid "The specified directory '%s' does not exists" +msgstr "Das angegebene Verzeichnis '%s' existiert nicht" + +#: classes/controller/class.modrewrite_content_controller.php:79 +#, php-format +msgid "" +"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." +msgstr "" +"Das angegebene Verzeichnis '%s' existiert nicht im DOCUMENT_ROOT '%s'. Das " +"kann vorkommen, wenn das DOCUMENT_ROOT des Mandanten vom CONTENIDO Backend " +"DOCUMENT_ROOT abweicht. Die Einstellung wird dennoch übernommen, da die " +"Überprüfung abgeschaltet wurde." + +#: classes/controller/class.modrewrite_content_controller.php:182 +#, php-format +msgid "Please specify separator (%s) for category" +msgstr "Bitte Trenner (%s) für Kategoriewörter angeben" + +#: classes/controller/class.modrewrite_content_controller.php:187 +#, php-format +msgid "Invalid separator for category, allowed one of following characters: %s" +msgstr "Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: %s" + +#: classes/controller/class.modrewrite_content_controller.php:194 +#, php-format +msgid "Please specify separator (%s) for category words" +msgstr "Bitte Trenner (%s) für Kategorie angeben" + +#: classes/controller/class.modrewrite_content_controller.php:199 +#, php-format +msgid "" +"Invalid separator for category words, allowed one of following characters: %s" +msgstr "Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: %s" + +#: classes/controller/class.modrewrite_content_controller.php:206 +#, php-format +msgid "Please specify separator (%s) for article" +msgstr "Bitte Trenner (%s) für Kategoriewörter angeben" + +#: classes/controller/class.modrewrite_content_controller.php:211 +#, php-format +msgid "" +"Invalid separator for article, allowed is one of following characters: %s" +msgstr "Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: %s" + +#: classes/controller/class.modrewrite_content_controller.php:218 +#, php-format +msgid "Please specify separator (%s) for article words" +msgstr "Bitte Trenner (%s) für Kategorie angeben" + +#: classes/controller/class.modrewrite_content_controller.php:223 +#, php-format +msgid "" +"Invalid separator for article words, allowed is one of following characters: " +"%s" +msgstr "Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: %s" + +#: classes/controller/class.modrewrite_content_controller.php:230 +msgid "Separator for category and category words must not be identical" +msgstr "Trenner für Kategorie und Kategoriewörter dürfen nicht identisch sein" + +#: classes/controller/class.modrewrite_content_controller.php:235 +msgid "Separator for category and article words must not be identical" +msgstr "Separator for category and article words must not be identical" + +#: classes/controller/class.modrewrite_content_controller.php:240 +msgid "Separator for category-article and article words must not be identical" +msgstr "" +"Trenner für Kategorie-Artikel und Artikelwörter dürfen nicht identisch sein" + +#: classes/controller/class.modrewrite_content_controller.php:257 +msgid "" +"The file extension has a invalid format, allowed are the chars \\.([a-zA-" +"Z0-9\\-_\\/])" +msgstr "" +"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen [a-" +"zA-Z0-9\\-_\\/\\.]" + +#: classes/controller/class.modrewrite_content_controller.php:271 +msgid "Value has to be numeric." +msgstr "Wert muss numerisch sein." + +#: classes/controller/class.modrewrite_content_controller.php:275 +msgid "Value has to be between 0 an 100." +msgstr "Wert muss zwischen 0 und 100 sein." + +#: classes/controller/class.modrewrite_content_controller.php:292 +msgid "" +"The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\\-_" +"\\/\\.]*$/" +msgstr "" +"Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen [a-" +"zA-Z0-9\\-_\\/\\.]" + +#: classes/controller/class.modrewrite_content_controller.php:355 +msgid "Please check your input" +msgstr "Bitte überprüfen Sie ihre Eingaben" + +#: classes/controller/class.modrewrite_content_controller.php:365 +msgid "Configuration has not been saved, because of enabled debugging" +msgstr "Konfiguration wurde nicht gespeichert, weil debugging aktiv ist" + +#: classes/controller/class.modrewrite_content_controller.php:373 +msgid "Configuration has been saved" +msgstr "Die Konfiguration wurde gespeichert" + +#: classes/controller/class.modrewrite_content_controller.php:379 +#, php-format +msgid "Configuration could not saved. Please check write permissions for %s " +msgstr "" +"Konfiguration konnte nicht gespeichert werden. Überprüfen Sie bitte die " +"Schreibrechte für %s" + +#: classes/controller/class.modrewrite_content_controller.php:412 +msgid "" +"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" +msgstr "" +"Ihre Contenido-Installation läuft mit der Einstellung 'is_start_compatible'. " +"Dieses Plugin wird mit dieser Einstellung nicht wie gewünscht funktionieren." +"
    Bitte überprüfen Sie folngenden Beitrag im Contenido Forum, um dies zu " +"ändern:

    is_start_compatible auf neue Version " +"umstellen" + +#: classes/controller/class.modrewrite_content_controller.php:420 +#, php-format +msgid "" +"It seems as if some categories don't have a set 'urlpath' entry in the " +"database. Please reset empty aliases in %sFunctions%s area." +msgstr "" +"Es scheint so zu sein, als ob zu einigen Kategorien die Datenbank-Einträge " +"für 'urlpath' fehlen. Bitte setzen Sie leere Aliase unter %sFunktionen%s " +"zurück." + +#~ msgid "No Client selected" +#~ msgstr "Kein Mandant ausgewählt" diff --git a/conlite/plugins/mod_rewrite/locale/mod_rewrite.pot b/conlite/plugins/mod_rewrite/locale/mod_rewrite.pot index ee5fcd1..7a90803 100644 --- a/conlite/plugins/mod_rewrite/locale/mod_rewrite.pot +++ b/conlite/plugins/mod_rewrite/locale/mod_rewrite.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-20 11:14+0100\n" +"POT-Creation-Date: 2017-07-15 18:37+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,193 +17,81 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: classes/controller/class.modrewrite_controller_abstract.php:73 -msgid "More informations" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:72 -msgid "" -"The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\\-_" -"\\/\\.]" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:79 -#, php-format -msgid "The specified directory \"%s\" does not exists" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:86 -#, php-format -msgid "" -"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." -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:189 -#, php-format -msgid "Please specify separator (%s) for category" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:194 -#, php-format -msgid "Invalid separator for category, allowed one of following characters: %s" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:201 -#, php-format -msgid "Please specify separator (%s) for category words" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:206 -#, php-format -msgid "" -"Invalid separator for category words, allowed one of following characters: %s" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:213 -#, php-format -msgid "Please specify separator (%s) for article" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:218 -#, php-format -msgid "" -"Invalid separator for article, allowed is one of following characters: %s" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:225 -#, php-format -msgid "Please specify separator (%s) for article words" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:230 -#, php-format -msgid "" -"Invalid separator for article words, allowed is one of following characters: " -"%s" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:237 -msgid "Separator for category and category words must not be identical" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:242 -msgid "Separator for category and article words must not be identical" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:247 -msgid "Separator for category-article and article words must not be identical" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:264 -msgid "" -"The file extension has a invalid format, allowed are the chars \\.([a-zA-" -"Z0-9\\-_\\/])" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:278 -msgid "Value has to be numeric." -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:282 -msgid "Value has to be between 0 an 100." -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:299 -msgid "" -"The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\\-_" -"\\/\\.]*$/" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:362 -msgid "Please check your input" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:370 -msgid "Configuration has not been saved, because of enabled debugging" -msgstr "" - -#: classes/controller/class.modrewrite_content_controller.php:384 -#, php-format -msgid "Configuration could not saved. Please check write permissions for %s " -msgstr "" - -#: includes/include.mod_rewrite_content.php:42 -#: includes/include.mod_rewrite_contenttest.php:49 -#: includes/include.mod_rewrite_contentexpert.php:42 -msgid "No Client selected" -msgstr "" - -#: includes/include.mod_rewrite_content.php:183 +#: includes/include.mod_rewrite_content.php:177 msgid "Version" msgstr "" -#: includes/include.mod_rewrite_content.php:184 +#: includes/include.mod_rewrite_content.php:178 msgid "Author" msgstr "" -#: includes/include.mod_rewrite_content.php:185 +#: includes/include.mod_rewrite_content.php:179 msgid "E-Mail to author" msgstr "" -#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_content.php:180 msgid "Plugin page" msgstr "" -#: includes/include.mod_rewrite_content.php:187 +#: includes/include.mod_rewrite_content.php:181 msgid "Visit plugin page" msgstr "" -#: includes/include.mod_rewrite_content.php:188 +#: includes/include.mod_rewrite_content.php:182 msgid "opens page in new window" msgstr "" -#: includes/include.mod_rewrite_content.php:189 -msgid "Contenido forum" +#: includes/include.mod_rewrite_content.php:183 +msgid "CONTENIDO forum" msgstr "" -#: includes/include.mod_rewrite_content.php:190 -msgid "Plugin thread in Contenido forum" +#: includes/include.mod_rewrite_content.php:184 +msgid "Plugin thread in CONTENIDO forum" msgstr "" -#: includes/include.mod_rewrite_content.php:191 +#: includes/include.mod_rewrite_content.php:185 msgid "Plugin settings" msgstr "" -#: includes/include.mod_rewrite_content.php:192 -#: includes/include.mod_rewrite_contentexpert.php:123 +#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_contentexpert.php:87 msgid "Note" msgstr "" -#: includes/include.mod_rewrite_content.php:194 +#: includes/include.mod_rewrite_content.php:189 #, php-format msgid "" -"The .htaccess file could not found either in Contenido installation " -"directory nor in client directory.
    It should set up in %sFunctions%s " +"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." msgstr "" -#: includes/include.mod_rewrite_content.php:197 +#: includes/include.mod_rewrite_content.php:192 +#, php-format +msgid "" +"Found some category and/or article aliases. It is recommended to run the " +"reset function in %sFunctions%s area, if needed." +msgstr "" + +#: includes/include.mod_rewrite_content.php:195 msgid "Enable Advanced Mod Rewrite" msgstr "" -#: includes/include.mod_rewrite_content.php:199 +#: includes/include.mod_rewrite_content.php:197 msgid "" "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 " +"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" +"processed,
    if the mod rewrite module is disabled" msgstr "" -#: includes/include.mod_rewrite_content.php:201 +#: includes/include.mod_rewrite_content.php:199 msgid "Example" msgstr "" -#: includes/include.mod_rewrite_content.php:203 +#: includes/include.mod_rewrite_content.php:201 msgid "" "# enable apache mod rewrite module\n" "RewriteEngine on\n" @@ -212,75 +100,75 @@ msgid "" "RewriteEngine off" msgstr "" -#: includes/include.mod_rewrite_content.php:205 +#: includes/include.mod_rewrite_content.php:203 msgid "Path to .htaccess from DocumentRoot" msgstr "" -#: includes/include.mod_rewrite_content.php:206 +#: includes/include.mod_rewrite_content.php:204 msgid "" "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/')" +"
    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/')" msgstr "" -#: includes/include.mod_rewrite_content.php:208 +#: includes/include.mod_rewrite_content.php:206 msgid "Check path to .htaccess" msgstr "" -#: includes/include.mod_rewrite_content.php:209 +#: includes/include.mod_rewrite_content.php:207 msgid "" -"The path will be checked, if this option is enabled.
    But this could " +"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." +"and
    clients DocumentRoot differs from CONTENIDO backend DocumentRoot." msgstr "" -#: includes/include.mod_rewrite_content.php:211 +#: includes/include.mod_rewrite_content.php:209 msgid "Should the name of root category be displayed in the URL?" msgstr "" -#: includes/include.mod_rewrite_content.php:212 +#: includes/include.mod_rewrite_content.php:210 msgid "Start from root category" msgstr "" -#: includes/include.mod_rewrite_content.php:213 +#: includes/include.mod_rewrite_content.php:211 msgid "" -"If enabled, the name of the root category (e. g. \"Mainnavigation\" in a " -"Contenido default installation), will be preceded to the URL." +"If enabled, the name of the root category (e. g. 'Mainnavigation' in a " +"CONTENIDO default installation), will be preceded to the URL." msgstr "" -#: includes/include.mod_rewrite_content.php:215 +#: includes/include.mod_rewrite_content.php:213 msgid "Are several clients maintained in one directory?" msgstr "" -#: includes/include.mod_rewrite_content.php:216 +#: includes/include.mod_rewrite_content.php:214 msgid "Prepend client to the URL" msgstr "" -#: includes/include.mod_rewrite_content.php:217 +#: includes/include.mod_rewrite_content.php:215 msgid "Use client name instead of the id" msgstr "" -#: includes/include.mod_rewrite_content.php:219 +#: includes/include.mod_rewrite_content.php:217 msgid "" "Should the language appear in the URL (required for multi language websites)?" msgstr "" -#: includes/include.mod_rewrite_content.php:220 +#: includes/include.mod_rewrite_content.php:218 msgid "Prepend language to the URL" msgstr "" -#: includes/include.mod_rewrite_content.php:221 +#: includes/include.mod_rewrite_content.php:219 msgid "Use language name instead of the id" msgstr "" -#: includes/include.mod_rewrite_content.php:223 +#: includes/include.mod_rewrite_content.php:221 msgid "" -"Configure your own separators with following 4 settings
    to control " +"Configure your own separators with following 4 settings
    to control " "generated URLs to your own taste" msgstr "" -#: includes/include.mod_rewrite_content.php:224 +#: includes/include.mod_rewrite_content.php:222 msgid "" "www.domain.com/category1-category2.articlename.html\n" "www.domain.com/category1/category2-articlename.html\n" @@ -288,127 +176,127 @@ msgid "" "www.domain.com/category_name1-category2-articlename.foo" msgstr "" -#: includes/include.mod_rewrite_content.php:225 +#: includes/include.mod_rewrite_content.php:223 msgid "Category separator has to be different from category-word separator" msgstr "" -#: includes/include.mod_rewrite_content.php:226 +#: includes/include.mod_rewrite_content.php:224 msgid "" "# Example: Category separator (/) and category-word separator (_)\n" "category_one/category_two/articlename.html" msgstr "" -#: includes/include.mod_rewrite_content.php:227 +#: includes/include.mod_rewrite_content.php:225 msgid "Category separator has to be different from article-word separator" msgstr "" -#: includes/include.mod_rewrite_content.php:228 +#: includes/include.mod_rewrite_content.php:226 msgid "" "# Example: Category separator (/) and article-word separator (-)\n" "category_one/category_two/article-description.html" msgstr "" -#: includes/include.mod_rewrite_content.php:229 +#: includes/include.mod_rewrite_content.php:227 msgid "" "Category-article separator has to be different from article-word separator" msgstr "" -#: includes/include.mod_rewrite_content.php:230 +#: includes/include.mod_rewrite_content.php:228 msgid "" "# Example: Category-article separator (/) and article-word separator (-)\n" "category_one/category_two/article-description.html" msgstr "" -#: includes/include.mod_rewrite_content.php:232 +#: includes/include.mod_rewrite_content.php:230 msgid "Category separator (delemiter between single categories)" msgstr "" -#: includes/include.mod_rewrite_content.php:233 -#: includes/include.mod_rewrite_content.php:234 +#: includes/include.mod_rewrite_content.php:231 +#: includes/include.mod_rewrite_content.php:232 #, php-format msgid "(possible values: %s)" msgstr "" -#: includes/include.mod_rewrite_content.php:235 +#: includes/include.mod_rewrite_content.php:233 msgid "Category-word separator (delemiter between category words)" msgstr "" -#: includes/include.mod_rewrite_content.php:236 +#: includes/include.mod_rewrite_content.php:234 msgid "" "Category-article separator (delemiter between category-block and article)" msgstr "" -#: includes/include.mod_rewrite_content.php:237 +#: includes/include.mod_rewrite_content.php:235 msgid "Article-word separator (delemiter between article words)" msgstr "" -#: includes/include.mod_rewrite_content.php:239 +#: includes/include.mod_rewrite_content.php:237 msgid "Append article name to URLs" msgstr "" -#: includes/include.mod_rewrite_content.php:240 +#: includes/include.mod_rewrite_content.php:238 msgid "Append article name always to URLs (even at URLs to categories)" msgstr "" -#: includes/include.mod_rewrite_content.php:241 +#: includes/include.mod_rewrite_content.php:239 msgid "Default article name without extension" msgstr "" -#: includes/include.mod_rewrite_content.php:242 +#: includes/include.mod_rewrite_content.php:240 msgid "" -"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" +"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" msgstr "" -#: includes/include.mod_rewrite_content.php:244 +#: includes/include.mod_rewrite_content.php:242 msgid "File extension at the end of the URL" msgstr "" -#: includes/include.mod_rewrite_content.php:245 +#: includes/include.mod_rewrite_content.php:243 msgid "" -"Specification of file extension with a preceded dot
    e.g. \".html\" for " +"Specification of file extension with a preceded dot
    e.g. '.html' for " "http://host/foo/bar.html" msgstr "" -#: includes/include.mod_rewrite_content.php:246 +#: includes/include.mod_rewrite_content.php:244 msgid "" -"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." +"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." msgstr "" -#: includes/include.mod_rewrite_content.php:247 +#: includes/include.mod_rewrite_content.php:245 msgid "" "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." msgstr "" -#: includes/include.mod_rewrite_content.php:249 +#: includes/include.mod_rewrite_content.php:247 msgid "Should the URLs be written in lower case?" msgstr "" -#: includes/include.mod_rewrite_content.php:250 +#: includes/include.mod_rewrite_content.php:248 msgid "URLs in lower case" msgstr "" -#: includes/include.mod_rewrite_content.php:252 +#: includes/include.mod_rewrite_content.php:250 msgid "Duplicated content" msgstr "" -#: includes/include.mod_rewrite_content.php:253 +#: includes/include.mod_rewrite_content.php:251 msgid "Prevent duplicated content" msgstr "" -#: includes/include.mod_rewrite_content.php:255 +#: includes/include.mod_rewrite_content.php:253 msgid "" -"Depending on configuration, pages could be found thru different URLs.
    Enabling of this option prevents this. Examples for duplicated content" +"Depending on configuration, pages could be found thru different URLs." +"
    Enabling of this option prevents this. Examples for duplicated content" msgstr "" -#: includes/include.mod_rewrite_content.php:256 +#: includes/include.mod_rewrite_content.php:254 msgid "" "Name of the root category in the URL: Feasible is /maincategory/subcategory/ " "and /subcategory/\n" @@ -416,116 +304,115 @@ msgid "" "Client in the URL: Feasible is /client/category/ und /1/category/" msgstr "" -#: includes/include.mod_rewrite_content.php:259 +#: includes/include.mod_rewrite_content.php:257 msgid "Percentage for similar category paths in URLs" msgstr "" -#: includes/include.mod_rewrite_content.php:260 +#: includes/include.mod_rewrite_content.php:258 msgid "" "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.
    A incoming URL will be cleaned from those values and the " -"remaining path (urlpath of the category)
    will be checked against " -"similarities." +"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." msgstr "" -#: includes/include.mod_rewrite_content.php:261 +#: includes/include.mod_rewrite_content.php:259 msgid "" "100 = exact match with no tolerance\n" "85 = paths with little errors will match to similar ones\n" "0 = matching will work even for total wrong paths" msgstr "" -#: includes/include.mod_rewrite_content.php:263 +#: includes/include.mod_rewrite_content.php:261 msgid "Redirect in case of invalid articles" msgstr "" -#: includes/include.mod_rewrite_content.php:264 +#: includes/include.mod_rewrite_content.php:262 msgid "Redirect to error page in case of invaid articles" msgstr "" -#: includes/include.mod_rewrite_content.php:265 +#: includes/include.mod_rewrite_content.php:263 msgid "The start page will be displayed if this option is not enabled" msgstr "" -#: includes/include.mod_rewrite_content.php:267 +#: includes/include.mod_rewrite_content.php:265 msgid "Moment of URL generation" msgstr "" -#: includes/include.mod_rewrite_content.php:268 +#: includes/include.mod_rewrite_content.php:266 msgid "a.) During the output of HTML code of the page" msgstr "" -#: includes/include.mod_rewrite_content.php:269 +#: includes/include.mod_rewrite_content.php:267 msgid "" "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 " +"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." msgstr "" -#: includes/include.mod_rewrite_content.php:270 +#: includes/include.mod_rewrite_content.php:268 msgid "Differences to variant b.)" msgstr "" -#: includes/include.mod_rewrite_content.php:271 +#: includes/include.mod_rewrite_content.php:269 msgid "" "Still compatible to old modules/plugins, since no changes in codes are " "required\n" "All occurring URLs in HTML code, even those set by wysiwyg, will be switched " "to Clean-URLs\n" -"All URLs will usually be collected and converted to Clean-URLs at once.
    Doing it this way reduces the amount of executed database significantly." +"All URLs will usually be collected and converted to Clean-URLs at once." +"
    Doing it this way reduces the amount of executed database significantly." msgstr "" -#: includes/include.mod_rewrite_content.php:274 +#: includes/include.mod_rewrite_content.php:272 msgid "b.) In modules or plugins" msgstr "" -#: includes/include.mod_rewrite_content.php:275 +#: includes/include.mod_rewrite_content.php:273 msgid "" "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:" +"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:" msgstr "" -#: includes/include.mod_rewrite_content.php:276 +#: includes/include.mod_rewrite_content.php:274 msgid "" "# 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" +"# 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);" msgstr "" -#: includes/include.mod_rewrite_content.php:277 +#: includes/include.mod_rewrite_content.php:275 msgid "Differences to variant a.)" msgstr "" -#: includes/include.mod_rewrite_content.php:278 +#: includes/include.mod_rewrite_content.php:276 msgid "" "The default way to generate URLs to fronend pages\n" -"Each URL in modules/plugins has to be generated by UrlBuilder\n" +"Each URL in modules/plugins has to be generated by UriBuilder\n" "Each generated Clean-Url requires a database query" msgstr "" -#: includes/include.mod_rewrite_content.php:281 +#: includes/include.mod_rewrite_content.php:279 msgid "Routing" msgstr "" -#: includes/include.mod_rewrite_content.php:282 +#: includes/include.mod_rewrite_content.php:280 msgid "Routing definitions for incoming URLs" msgstr "" -#: includes/include.mod_rewrite_content.php:283 +#: includes/include.mod_rewrite_content.php:281 msgid "Type one routing definition per line as follows:" msgstr "" -#: includes/include.mod_rewrite_content.php:284 +#: includes/include.mod_rewrite_content.php:282 msgid "" "# {incoming_url}>>>{new_url}\n" "/incoming_url/name.html>>>new_url/new_name.html\n" @@ -538,203 +425,320 @@ msgid "" "/>>>front_content.php?idart=16" msgstr "" -#: includes/include.mod_rewrite_content.php:285 +#: includes/include.mod_rewrite_content.php:283 msgid "" "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)\n" +"the redirection will happen internally by
    replacing the detected incoming " +"URL against the new destination URL (overwriting of article- categoryid)\n" "Incoming URLs can point to non existing resources (category/article), but " -"the desttination URLs should point
    to valid Contenido articles/" +"the desttination URLs should point
    to valid CONTENIDO articles/" "categories\n" -"Destination URLs should point to real URLs to categories/articles,
    e. g." +"Destination URLs should point to real URLs to categories/articles,
    e. g." "front_content.php?idcat=23 or front_content.php?idart=34\n" -"The language id should attached to the URL in multi language sites
    e. " -"g. front_content.php?idcat=23&lang=1\n" +"The language id should attached to the URL in multi language sites
    e. g. " +"front_content.php?idcat=23&lang=1\n" "The client id should attached to the URL in multi client sites sharing the " -"same folder
    e. g. front_content.php?idcat=23&client=2\n" +"same folder
    e. g. front_content.php?idcat=23&client=2\n" "The destination URL should not start with '/' or './' (wrong: /front_content." "php, correct: front_content.php)" msgstr "" -#: includes/include.mod_rewrite_content.php:288 -#: includes/include.mod_rewrite_contentexpert.php:128 +#: includes/include.mod_rewrite_content.php:286 +#: includes/include.mod_rewrite_contentexpert.php:90 msgid "Discard changes" msgstr "" -#: includes/include.mod_rewrite_content.php:289 -#: includes/include.mod_rewrite_contentexpert.php:129 +#: includes/include.mod_rewrite_content.php:287 +#: includes/include.mod_rewrite_contentexpert.php:91 msgid "Save changes" msgstr "" -#: includes/include.mod_rewrite_contenttest.php:73 +#: includes/include.mod_rewrite_contenttest.php:55 msgid "" "Define options to genereate the URLs by using the form below and run the " "test." msgstr "" -#: includes/include.mod_rewrite_contenttest.php:74 +#: includes/include.mod_rewrite_contenttest.php:56 msgid "Parameter to use" msgstr "" -#: includes/include.mod_rewrite_contenttest.php:75 +#: includes/include.mod_rewrite_contenttest.php:57 msgid "Number of URLs to generate" msgstr "" -#: includes/include.mod_rewrite_contenttest.php:76 +#: includes/include.mod_rewrite_contenttest.php:58 msgid "Run test" msgstr "" -#: includes/include.mod_rewrite_contenttest.php:78 +#: includes/include.mod_rewrite_contenttest.php:60 msgid "" -"{pref}{name}\n" -"{pref}Builder in: {url_in}\n" -"{pref}Builder out: {url_out}\n" -"{pref}Resolved URL: {url_res}\n" -"{pref}Resolved data: {data}" +"{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}" msgstr "" -#: includes/include.mod_rewrite_contenttest.php:84 +#: includes/include.mod_rewrite_contenttest.php:62 msgid "" -"Duration of test run: {time} seconds.
    \n" -"Number of processed URLs: {num_urls}
    \n" -"Successful resolved: {num_success}
    \n" -"Errors during resolving: {num_fail}" +"Duration of test run: {time} seconds.
    Number of processed URLs: {num_urls}" +"
    Successful resolved: {num_success}
    Errors during resolving: {num_fail}" msgstr "" -#: includes/config.plugin.php:176 -msgid "MR-Options" -msgstr "" - -#: includes/config.plugin.php:177 -msgid "Expert Options" -msgstr "" - -#: includes/config.plugin.php:178 -msgid "MR Test Area" -msgstr "" - -#: includes/include.mod_rewrite_contentexpert.php:80 +#: includes/include.mod_rewrite_contentexpert.php:61 msgid "Plugin functions" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:82 +#: includes/include.mod_rewrite_contentexpert.php:63 msgid "Copy/Download .htaccess template" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:83 +#: includes/include.mod_rewrite_contentexpert.php:64 msgid "Select .htaccess template" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:84 +#: includes/include.mod_rewrite_contentexpert.php:65 msgid "Restrictive .htaccess" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:85 +#: includes/include.mod_rewrite_contentexpert.php:66 msgid "Simple .htaccess" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:86 +#: includes/include.mod_rewrite_contentexpert.php:67 msgid "" -"Contains rules with restrictive settings.
    \n" -"All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, " -"jpg, js, mov,
    \n" -"mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom " -"rewriting.
    \n" -"Remaining requests will be rewritten to front_content.php,
    \n" -"except requests to 'contenido/', 'setup/', 'cms/upload', 'cms/front_content." -"php', etc.
    \n" -"Each resource, which has to be excluded from rewriting must be specified " -"explicitly." +"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." msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:93 +#: includes/include.mod_rewrite_contentexpert.php:69 msgid "" -"Contains a sipmle collection of rules. Each requests pointing to valid " -"symlinks, folders or
    \n" -"files, will be excluded from rewriting. Remaining requests will be rewritten " -"to front_content.php" +"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" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:96 +#: includes/include.mod_rewrite_contentexpert.php:71 msgid "and copy to" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:97 -msgid "Contenido installation directory" +#: includes/include.mod_rewrite_contentexpert.php:72 +msgid "CONTENIDO installation directory" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:98 +#: includes/include.mod_rewrite_contentexpert.php:73 msgid "" -"Copy the selected .htaccess template into Contenido installation " -"directory
    \n" -"
    \n" -"    {CONTENIDO_FULL_PATH}.
    \n" -"
    \n" -"This is the recommended option for a Contenido installation with one or more " -"clients
    \n" -"who are running on the same domain." +"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." msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:105 +#: includes/include.mod_rewrite_contentexpert.php:75 msgid "client directory" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:106 +#: includes/include.mod_rewrite_contentexpert.php:76 msgid "" -"Copy the selected .htaccess template into client's directory
    \n" -"
    \n" -"    {CLIENT_FULL_PATH}.
    \n" -"
    \n" -"This is the recommended option for a multiple client system
    \n" -"where each client has it's own domain/subdomain" +"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" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:113 +#: includes/include.mod_rewrite_contentexpert.php:78 msgid "or" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:114 +#: includes/include.mod_rewrite_contentexpert.php:79 msgid "Download" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:115 +#: includes/include.mod_rewrite_contentexpert.php:80 msgid "" "Download selected .htaccess template to copy it to the destination " -"folder
    \n" -"or to take over the settings manually." +"folder
    or to take over the settings manually." msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:118 +#: includes/include.mod_rewrite_contentexpert.php:82 msgid "Reset category-/ and article aliases" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:119 +#: includes/include.mod_rewrite_contentexpert.php:83 msgid "Reset only empty aliases" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:120 +#: includes/include.mod_rewrite_contentexpert.php:84 msgid "" "Only empty aliases will be reset, existing aliases, e. g. manually set " "aliases, will not be changed." msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:121 +#: includes/include.mod_rewrite_contentexpert.php:85 msgid "Reset all aliases" msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:122 +#: includes/include.mod_rewrite_contentexpert.php:86 msgid "" "Reset all category-/article aliases. Existing aliases will be overwritten." msgstr "" -#: includes/include.mod_rewrite_contentexpert.php:124 +#: includes/include.mod_rewrite_contentexpert.php:88 msgid "" "This process could require some time depending on amount of categories/" -"articles.
    \n" -"The aliases will not contain the configured plugin separators, but the " -"Contenido default separators '/' und '-', e. g. '/category-word/article-" -"word'.
    \n" -"Execution of this function ma be helpful to prepare all or empty aliases for " -"the usage by the plugin." +"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." +msgstr "" + +#: includes/config.plugin.php:71 +msgid "Advanced Mod Rewrite" +msgstr "" + +#: includes/config.plugin.php:72 +msgid "Advanced Mod Rewrite functions" +msgstr "" + +#: includes/config.plugin.php:73 +msgid "Advanced Mod Rewrite test" +msgstr "" + +#: classes/controller/class.modrewrite_controller_abstract.php:107 +msgid "More informations" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:65 +msgid "" +"The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\\-_" +"\\/\\.]" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:72 +#, php-format +msgid "The specified directory '%s' does not exists" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:79 +#, php-format +msgid "" +"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." +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:182 +#, php-format +msgid "Please specify separator (%s) for category" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:187 +#, php-format +msgid "Invalid separator for category, allowed one of following characters: %s" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:194 +#, php-format +msgid "Please specify separator (%s) for category words" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:199 +#, php-format +msgid "" +"Invalid separator for category words, allowed one of following characters: %s" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:206 +#, php-format +msgid "Please specify separator (%s) for article" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:211 +#, php-format +msgid "" +"Invalid separator for article, allowed is one of following characters: %s" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:218 +#, php-format +msgid "Please specify separator (%s) for article words" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:223 +#, php-format +msgid "" +"Invalid separator for article words, allowed is one of following characters: " +"%s" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:230 +msgid "Separator for category and category words must not be identical" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:235 +msgid "Separator for category and article words must not be identical" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:240 +msgid "Separator for category-article and article words must not be identical" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:257 +msgid "" +"The file extension has a invalid format, allowed are the chars \\.([a-zA-" +"Z0-9\\-_\\/])" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:271 +msgid "Value has to be numeric." +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:275 +msgid "Value has to be between 0 an 100." +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:292 +msgid "" +"The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\\-_" +"\\/\\.]*$/" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:355 +msgid "Please check your input" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:365 +msgid "Configuration has not been saved, because of enabled debugging" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:373 +msgid "Configuration has been saved" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:379 +#, php-format +msgid "Configuration could not saved. Please check write permissions for %s " +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:412 +msgid "" +"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" +msgstr "" + +#: classes/controller/class.modrewrite_content_controller.php:420 +#, php-format +msgid "" +"It seems as if some categories don't have a set 'urlpath' entry in the " +"database. Please reset empty aliases in %sFunctions%s area." msgstr "" diff --git a/conlite/plugins/mod_rewrite/locale/potfiles.txt b/conlite/plugins/mod_rewrite/locale/potfiles.txt index 597ffc9..99d35d7 100644 --- a/conlite/plugins/mod_rewrite/locale/potfiles.txt +++ b/conlite/plugins/mod_rewrite/locale/potfiles.txt @@ -1,22 +1,24 @@ -./classes/class.modrewriteurlutil.php -./classes/class.modrewriteurlstack.php -./classes/class.modrewritecontroller.php -./classes/class.modrewritedebugger.php -./classes/class.modrewrite.php +./includes/include.mod_rewrite_content.php +./includes/include.mod_rewrite_contenttest.php +./includes/functions.mod_rewrite.php +./includes/include.mod_rewrite_contentexpert.php +./includes/front_content_controller.php +./includes/config.mod_rewrite_default.php +./includes/include.mod_rewrite_content_top.php +./includes/config.plugin.php +./external/aToolTip/demos.html +./templates/content.html +./templates/contenttest.html +./templates/content_top.html +./templates/contentexpert.html +./classes/controller/class.modrewrite_contenttest_controller.php +./classes/controller/class.modrewrite_contentexpert_controller.php ./classes/controller/class.modrewrite_controller_abstract.php ./classes/controller/class.modrewrite_content_controller.php -./classes/controller/class.modrewrite_contentexpert_controller.php -./classes/controller/class.modrewrite_contenttest_controller.php -./classes/class.modrewritebase.php +./classes/class.modrewritedebugger.php ./classes/class.modrewritetest.php -./external/aToolTip/demos.html -./templates/contenttest.html -./templates/contentexpert.html -./templates/content.html -./includes/functions.mod_rewrite.php -./includes/include.mod_rewrite_content.php -./includes/config.mod_rewrite_default.php -./includes/include.mod_rewrite_contenttest.php -./includes/config.plugin.php -./includes/front_content_controller.php -./includes/include.mod_rewrite_contentexpert.php +./classes/class.modrewrite.php +./classes/class.modrewriteurlstack.php +./classes/class.modrewritebase.php +./classes/class.modrewritecontroller.php +./classes/class.modrewriteurlutil.php diff --git a/conlite/plugins/mod_rewrite/readme.txt b/conlite/plugins/mod_rewrite/readme.txt deleted file mode 100644 index 1ce678f..0000000 --- a/conlite/plugins/mod_rewrite/readme.txt +++ /dev/null @@ -1,294 +0,0 @@ -Advanced Mod Rewrite Plugin für Contenido >= 4.8.15 - -################################################################################ -TOC (Table of contents) - -- BESCHREIBUNG -- CHANGELOG -- BEKANNTE BUGS -- FEATURES -- VORAUSSETZUNGEN -- INSTALLATION -- FAQ -- ADVANCED MOD REWRITE THEMEN IM CONTENIDO FORUM -- SCHLUSSBEMERKUNG - - - -################################################################################ -BESCHREIBUNG - -Das Plugin Advanced Mod Rewrite ist eine Erweiterung für das Contenido-CMS zur Generierung von -alternativen URLs. - -Normalerweise werden die URLs zu Seiten einer auf ein CMS (z. B. Contenido) basierenden -Webpräsenz nach dem Muster "/index.php?page=12&language=de" generiert, also in Form von -dynamischen URLs. Eine Möglichkeit solche dynamische URLs zu Webseiten, deren Inhalt in der Regel -aus Datenbanken kommen, gegen statische URLs wie z. B. "/de/page-name.html" umzustellen, gibt es in -Kombination mit dem Apache mod_rewrite-Modul. Dabei werden die URLs zu den Seiten als sogenannte -"Clean URLs" ausgegeben, Requests zur der gewünschten Ressource werden vom Webserver nach -definierten Regeln verarbeitet und intern an die Webanwendung weitergeleitet. - -Solche statische URLs können aufgrund der Keyworddichte (die Ressource beschreibende Wörter in der -URL) vorteilhaft für Suchmaschinen sein und User können sich die URLs einfacher merken. - -Bei einer Contenido-Installation lassen sich solche URLs mit dem Advanced Mod Rewrite Plugin -generieren, URLs zu Frontendseiten, wie z. B. "/cms/front_content.php?idart=12&lang=1" werden -vom Plugin als statische URLs wie "/de/page-name.html" ausgegeben. Diverse Einstellungen zum -Ausgabeformat der URLs lassen sich im Contenido-Backend konfigurieren. - -Das Plugin Advanced Mod Rewrite basiert auf die geniale Erweiterung Advanced Mod Rewrite für -Contenido, welches als Bundle von stese bis zur Contenido Version 4.6.15 entwickelt und betreut -wurde. - -Wichtiger Aspekt bei der Umsetzung war die Implementierung als Plugin mit so wenig wie möglichen -Eingriffen in den Contenido Core (trotzdem ging es nicht ohne einige Anpassungen an bestimmten -Sourcen). - -Daher enthält das Archiv einige überarbeitete Contenido Sourcen, die eventuell nicht auf dem -neuesten Stand sein können. - - - -################################################################################ -CHANGELOG - -2011-04-11 Advanced Mod Rewrite Plugin integration into the Contenido core - - - -################################################################################ -BEKANNTE BUGS - -Urls sollten unbedingt eine Endung wie z. B. '.html' bekommen, da ansonsten die Erkennungsroutine den -Artikel aus der ankommenden URL nicht ermitteln kann. - -Wenn der Clean-URL die Sprache oder der Mandant vorangestellt wird, funktioniert die Fehlererkennung -unter Unständen nicht richtig, d. h. es gibt keine Weiterleitung zur Fehlerseite, sofern dies im -Plugin eingestellt wurde. - - - -################################################################################ -FEATURES - -- Erstellung Suchmaschinenoptimierter URLs, Contenido interne URLs wie - /front_content.php?idcat=12&idart=34 werden z. B. als /kategoriename/artikelname.html umschrieben -- Unterstützung mehrerer Sprachen -- Unterstützung mehrerer Mandanten im gleichen Verzeichnis -- Umschreiben der URLs entweder bei der Ausgabe des HTML Codes oder beim Generieren des Codes der - Seiten -- Routing von URLs (Umleiten eingehender URLs auf andere Ziel-URLs) - - - -################################################################################ -VORAUSSETZUNGEN - -- Alle Voraussetzungen von Contenido 4.8.x gelten auch für das Plugin -- PHP ab Version 5.1 (Das Plugin war bis Version 0.3.3 PHP 4.4.x kompatibel) -- Apache HTTP Server 2 mit Mod Rewrite - - - -################################################################################ -INSTALLATION - -Das Plugin kann im Contenido Setupprocess installiert werden. - -################################################################################ -WICHTIGES ZUM INHALT - -ALLGEMEIN -========= - -.htaccess: ----------- -Die Konfiguration des Apache, in der das mod_rewrite-Modul aktiviert und mit diversen Anweisungen -konfiguriert wird. Die Einstellungen bewirken, dass ankommende Anfragen wie z. B. -/kategorie/artikel.html an die front_content.php im Mandantenverzeichnis weitergeleitet werden. - -Die .htaccess liegt nicht im Contenido Installationsverzeichnis vor, es muss entweder dorthin -kopiert oder eine vorhanene .htaccess Datei angepasst werden. - -Als Vorlage existieren folgende 2 Versionen der .htaccess: - -htaccess_restrictive.txt: -Enthält Regeln mit restriktiveren Einstellungen. -Alle Anfragen, die auf die Dateienendung js, ico, gif, jpg, jpeg, png, css, pdf gehen, werden vom -Umschreiben ausgeschlossen. Alle anderen Anfragen, werden an front_content.php umschrieben. -Ausgeschlossen davon sind 'contenido/', 'setup/', 'cms/upload', 'cms/front_content.php', usw. -Jede neue Ressource, die vom Umschreiben ausgeschlossen werden soll, muss explizit definiert werden. - -htaccess_simple.txt: -Enthält eine einfachere Sammlung an Regeln. Alle Anfragen, die auf gültige symlinks, Verzeichnisse oder -Dateien gehen, werden vom Umschreiben ausgeschlossen. Restliche Anfragen werden an front_content.php -umschrieben. - - -contenido/plugins/mod_rewrite/*: --------------------------------- -Die Sourcen des Plugins. - -contenido/classes/UrlBuilder/Contenido_UrlBuilder_MR.class.php: ---------------------------------------------------------------- -UrlBuilder Klasse des Plugins (seit Version 0.4.0), zum Generieren der URLs anhand der Pluginkonfiguration. -Verwendet die in den Contenido Core implementierte UrlBuilder-Funktionalität und erweitert diesen um die -pluginspezifischen Features. - - -################################################################################ -FAQ - -Der Plugininstaller lässt sich nicht aufrufen, wie kann ich dennoch das Plugin installieren? --------------------------------------------------------------------------------------------- -Normalerweise wird der Plugininstaller mit folgender URL aufgerufen: -http://localhost/contenido/plugins/mod_rewrite/install.php -("http://localhost/" ist eventuell gegen anderen virtual Host oder Domainnamen ersetzen) - -Es erscheint das Anmeldeformular zum Backend, über den man sich am System anmelden kann. Nach -erfolgreicher Anmeldung wird man normalerweise zum Plugininstaller weitergeleitet. - -Manchmal kann es vorkommen, dass die Weiterleitung nach der Anmeldung nicht klappt und man nicht den -Plugininstaller aufrufen kann. -Um dennoch den Installer aufzurufen, reicht es aus, der URL die aktuell gültige Contenido Session ID -anzuhängen, z. B. /contenido/plugins/mod_rewrite/install.php?contenido={my_session_id}. - - -Wie teste ich, ob mod_rewrite am Server richtig konfiguriert ist? ------------------------------------------------------------------ -Obwohl mod_rewrite am Server installiert ist, kommt es manchmal vor, dass es nicht funktioniert. - -Das kann einfach getestet werden, erstelle eine .htaccess im Rootverzeichnis und schreibe folgendes -rein: -[code] -RewriteEngine on -RewriteRule ^ http://www.contenido.org [R,L] -[/code] - -Nach Eingabe der URL in die Adresszeile des Browsers, sollte auf www.contenido.org weitergeleitet -werden. -Wenn nicht, dann kann eines der folgenden Punkte der Grund dafür sein: -Das mod_rewrite Modul ist nicht geladen, das ist in der httpd.conf zu setzen -[code] -LoadModule rewrite_module modules/mod_rewrite.so -[/code] - -Die Direktive "AllowOverride" ist nicht korrekt gesetzt. Damit die Angaben in der .htaccess auch -benützt werden können, muss für das betreffende Verzeichnis die Direktive "AllowOverride" in der -httpd.conf angegeben werden: -[code] -# Beispielkonfiguration - - AllowOverride FileInfo - -[/code] - - -Wie richte ich Advanced Mod Rewrite für eine Contenidoinstallation in einem Unterverzeichnis ein? -------------------------------------------------------------------------------------------------- - -Als Beispiel gehen wir davon aus, dass Contenido im Verzeichnis /mypage/ unterhalb vom Webroot -installiert wurde und das Mandantenverzeichnis per default /mypage/cms/ ist. - -In der Pluginkonfiguration (Backend) den Pfad zur .htaccess Datei (aus Sicht des Web-Browsers) -folgendermaßen anpassen: -[code] -/mypage/ -[/code] - -Die /mypage/.htaccess öffnen und die RewriteBase folgendermaßen anpassen: -[code] -RewriteBase /mypage/cms/ -[/code] - - -Welche Einstellungen sind nötig, wenn das Mandantenverzeichnis das wwwroot ist? -------------------------------------------------------------------------------- -Normalerweise liegt das Mandantenverzeichnis innerhalb des wwwroot und ist über -http://domain.tld/cms/front_content.php erreichbar. -Manchmal ist es erwünscht, dass der Ordner /cms/ in der URL nicht sichbar sein soll, also -erreichbar über http://domain.tld/front_content.php. - -In diesem Fall sind zwei Anpassungen nötig, damit Mod Rewrite korrekt funktioniert: -1. Die .htaccess Datei in das Verzeichnis /cms/ kopieren, da die Datei im wwwroot sein muss. -2. In der .htaccess die RewriteBase Option anpassen - -# von -RewriteBase /cms - -# auf -RewriteBase / - - -Wie kann ich das Verarbeiten bestimmter Seiten vom Plugin unterbinden? ----------------------------------------------------------------------- -Wenn das Plugin so konfiguriert wurde, dass die URLs bei der Ausgabe des HTML Codes der Seite -angepasst werden, kann dieses Verhalten bei manchen Seiten unerwünscht sein. Das kann bei einer -Ausgabe der Fall sein, dessen Inhalt kein HTML ist (z. B. Dateidownload), dann macht es keinen Sinn, -die Ausgabe anzupassen. - -Ab Contenido 4.8.8 gibt es eine neue Einstellung, mit der man unterbinden kann, dass die Ausgabe im -Frontend nicht in den Ausgabepuffer geschrieben wird. Ist dies für eine Seite definiert worden, wird -auch die Funktion vom Plugin, die die URLs anpasst, nicht ausgeführt. - -Einstellen lässt sich das über Mandanteneinstellungen wie folgt: -[code] -Typ Name Wert -frontend.no_outputbuffer idart 12,14,40 -[/code] -Inhalte der Artikel mit der id 12, 14 und 40 werden dann von der Ausgabepufferung ausgeschlossen. - - -Warum werden URLs trotz richtiger Vorraussetzungen nicht umschrieben? ---------------------------------------------------------------------- -Ist die .htaccess und die Konfiguration des Plugins als Fehlerquelle auszuschließen und das Plugin -soll die URLs bei der Ausgabe der Seite umschreiben (Standardeinstellung), könnte ein vorzeitig -geleerter Ausgabepuffer der Grund sein. - -In der front_content.php wird der HTML-Code in den Ausgabepuffer geschrieben, damit der Code vor der -endgültigen Ausgabe bearbeitet werden kann. Das Plugin fügt der Chain -"Contenido.Frontend.HTMLCodeOutput" eine eigene Funktion, die den Code aus dem Ausgabepuffer erhält, -um die darin URLs zu umschreiben. - -Wird aber der Ausgabepuffer vorher geleert, z. B. durch Verwendung von ob_flush() in einem Modul, -wird der Code direkt an den Client rausgeschickt. Das hat den Effekt, dass in der front_content.php -kein Code mehr aus dem Ausgabepuffer zur Verfügung steht, der nicht weiterverarbeitet werden kann, -auch das Plugin kann dann keine URLs umschreiben. - - -Alle URLs zu Kategorien werden mit / oder /index.html umschrieben: ------------------------------------------------------------------- -Ist Contenido mit der Konfiguration $cfg["is_start_compatible"] = true; -(siehe contenidoincludes/config.php) eingestellt, um die Startartikeldefinition in Kategorien -kompatibel zu älteren Contenido-Versionen halten, kann das Plugin die URLs zu Kategorien nicht -generieren, weil es diese Konfiguration nicht unterstützt. - -Die einfachste Lösung ist, die Konfiguration $cfg["is_start_compatible"] auf false zu setzen und im -Backend in den vorhandenen Kategorien erneut die Startartikel zu setzen. - - - -################################################################################ -ADVANCED MOD REWRITE THEMEN IM CONTENIDO FORUM - -Plugin Advanced Mod Rewrite für Contenido 4.8.x: -http://www.contenido.de/forum/viewtopic.php?t=21578 - -Original Advanced Mod Rewrite 4.6.23: -http://www.contenido.de/forum/viewtopic.php?t=18454 - -Original Advanced Mod Rewrite 4.6.15: -http://www.contenido.de/forum/viewtopic.php?t=11162 - -Advanced Mod Rewriting Contenido 4.4.4: -http://www.contenido.de/forum/viewtopic.php?t=6713 - - - -################################################################################ -SCHLUSSBEMERKUNG - -Benutzung des Plugins auf eigene Gefahr! - -Murat Purc, murat@purc.de diff --git a/conlite/plugins/mod_rewrite/scripts/mod_rewrite.js b/conlite/plugins/mod_rewrite/scripts/mod_rewrite.js index 43b4d2c..8db8f47 100644 --- a/conlite/plugins/mod_rewrite/scripts/mod_rewrite.js +++ b/conlite/plugins/mod_rewrite/scripts/mod_rewrite.js @@ -1,87 +1,96 @@ -/** - * Project: - * Contenido Content Management System - * - * Description: - * Plugin Advanced Mod Rewrite JavaScript functions. - * - * Requirements: - * @con_php_req 5.0 - * - * - * @package Contenido Backend plugins - * @version 0.1 - * @author Murat Purc - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: mod_rewrite.js 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -var mrPlugin = { - lng: { - more_informations: "More informations" - }, - - toggle: function(id) { - // do some animation ;-) - $('#' + id).slideToggle("slow"); - }, - - showReadme: function() { - }, - - initializeSettingsPage: function() { - $(document).ready(function() { - $("#mr_use_language").click(function() { - $("#mr_use_language_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled")); - }); - - $("#mr_use_client").click(function() { - $("#mr_use_client_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled")); - }); - - $("#mr_add_startart_name_to_url").click(function() { - $("#mr_default_startart_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled")); - if ($(this).attr("checked")) { - $("#mr_default_startart_name").removeClass("disabled"); - } else { - $("#mr_default_startart_name").addClass("disabled"); - } - }); - - mrPlugin._initializeTooltip(); - }); - }, - - initializeExterpPage: function() { - $(document).ready(function() { - mrPlugin._initializeTooltip(); - }); - }, - - _initializeTooltip: function() { - $(".mrPlugin a.i-link").each(function () { - $(this).attr("href", "javascript:void(0);"); - $(this).attr("title", mrPlugin.lng.more_informations); - var id = $(this).attr("id").substring(0, $(this).attr("id").indexOf("-link")); - $(this).aToolTip({ - clickIt: true, - xOffset: -20, - yOffset: 4, - outSpeed: 250, - tipContent: $("#" + id).html() - }); - }); - } -}; - +/** + * Project: + * CONTENIDO Content Management System + * + * Description: + * Plugin Advanced Mod Rewrite JavaScript functions. + * + * Requirements: + * @con_php_req 5.0 + * + * + * @package CONTENIDO Plugins + * @version 0.1 + * @author Murat Purc + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + * @since file available since CONTENIDO release 4.9.0 + * + * {@internal + * created 2011-04-11 + * + * $Id$: + * }} + * + */ + + +var mrPlugin = { + lng: { + more_informations: "More informations" + }, + + toggle: function(id) { + // do some animation ;-) + $('#' + id).slideToggle("slow"); + }, + + showReadme: function() { + }, + + initializeSettingsPage: function() { + $(document).ready(function() { + $("#mr_use_language").change(function() { + if (true == $(this).attr("checked")) { + $("#mr_use_language_name").removeAttr("disabled"); + } else { + $("#mr_use_language_name").attr("disabled", "disabled"); + } + }); + + $("#mr_use_client").change(function() { + if (true == $(this).attr("checked")) { + $("#mr_use_client_name").removeAttr("disabled"); + } else { + $("#mr_use_client_name").attr("disabled", "disabled"); + } + }); + + $("#mr_add_startart_name_to_url").change(function() { + if (true == $(this).attr("checked")) { + $("#mr_default_startart_name").removeAttr("disabled") + .removeClass("disabled"); + } else { + $("#mr_default_startart_name").attr("disabled", "disabled") + .addClass("disabled"); + } + }); + + mrPlugin._initializeTooltip(); + }); + }, + + initializeExterpPage: function() { + $(document).ready(function() { + mrPlugin._initializeTooltip(); + }); + }, + + _initializeTooltip: function() { + $(".mrPlugin a.i-link").each(function () { + $(this).attr("href", "javascript:void(0);"); + $(this).attr("title", mrPlugin.lng.more_informations); + var id = $(this).attr("id").substring(0, $(this).attr("id").indexOf("-link")); + $(this).aToolTip({ + clickIt: true, + xOffset: -20, + yOffset: 4, + outSpeed: 250, + tipContent: $("#" + id).html() + }); + }); + } +}; + diff --git a/conlite/plugins/mod_rewrite/styles/styles.css b/conlite/plugins/mod_rewrite/styles/styles.css index 6ad9035..b39003c 100644 --- a/conlite/plugins/mod_rewrite/styles/styles.css +++ b/conlite/plugins/mod_rewrite/styles/styles.css @@ -1,100 +1,101 @@ -/** - * Project: - * Contenido Content Management System - * - * Description: - * Plugin Advanced Mod Rewrite JavaScript functions. - * - * Requirements: - * @con_php_req 5.0 - * - * - * @package Contenido Backend plugins - * @version 0.1 - * @author Murat Purc - * @copyright four for business AG - * @license http://www.contenido.org/license/LIZENZ.txt - * @link http://www.4fb.de - * @link http://www.contenido.org - * @since file available since Contenido release 4.8.15 - * - * {@internal - * created 2011-04-11 - * - * $Id: styles.css 2 2011-07-20 12:00:48Z oldperl $: - * }} - * - */ - - -/** - * mrPlugin main page - * @section mrPlugin - */ - -body.mrPlugin {margin:10px;} - -.mrPlugin a {color:#0060b1;} -.mrPlugin strong {font-weight:bold;} -.mrPlugin img {border:none;} - -.mrPlugin pre.example {padding:3px 5px; border:1px #000 dashed; width:60%; min-width:650px;} - -.mrPlugin li {padding-bottom:0.4em;} - -.mrPlugin span.note {color:red;} -.mrPlugin input.disabled {background-color:#dadada;} - -.mrPlugin .altBg {background-color:#f1f1f1;} -.mrPlugin .aToolTip ul {padding-left:1em;} -.mrPlugin .clear {clear:both; font-size:0pt !important; height:0pt !important; line-height:0pt !important;} -.mrPlugin .blockLeft {display:block; float:left;} -.mrPlugin .blockRight {display:block; float:right;} - - -/* Header box */ -.mrPlugin .headerBox {background-color:#e2e2e2; border:1px solid #b5b5b5; padding:6px; margin-bottom:10px;} -.mrPlugin .headerBox p {margin:0; padding:0;} -.mrPlugin .headerBox ul {margin-bottom:0;} - - -/* Content table */ -.mrPlugin table#contenttable {border:0; border-top:1px; border-left:1px; border-bottom:1px; border-color:#b3b3b3; border-style:solid;} -.mrPlugin table#contenttable th {font-weight:bold; text-align:left;} -.mrPlugin table#contenttable tr {background-color:#fff;} -.mrPlugin th, .mrPlugin td {vertical-align:top;} -.mrPlugin td.col-I {border:0; border-bottom:1px; border-right:1px; border-color:#b3b3b3; border-style:solid;} -.mrPlugin td.col-II {border:0; border-bottom:1px; border-right:1px; border-color:#b3b3b3; border-style:solid;} - -.mrPlugin tr.marked td {background-color:#f2b7a1;} - - -/* Info button */ -.mrPlugin a.infoButton, -.mrPlugin a.infoButton:hover {display:block; float:left; width:16px; height:16px; background:transparent url(../../../images/info.gif) no-repeat; margin:0 0 0 5px;} -.mrPlugin a.infoButton.v2, -.mrPlugin a.infoButton:hover.v2 {margin-top:2px;} - - -/* Plugininfo layer */ -.mrPlugin .pluginInfo {} -.mrPlugin .pluginInfo p {font-weight:bold; margin:0; padding:0;} -.mrPlugin .pluginInfo ul {margin:0; padding:0; list-style-type:none;} -.mrPlugin .pluginInfo li {margin:0; padding:0;} -.mrPlugin .pluginInfo li.first {margin-top:0.6em;} - - - -/** - * mrPlugin test page - * @section mrPluginTest - */ - -/** @extends body.mrPlugin */ -body.mrPluginTest {} - -.mrPluginTest .headerBox form {float:left; width:35%; background:#e2e2e2; margin:0; padding-top:10px;} -.mrPluginTest .headerBox fieldset {margin-bottom:10px;} -.mrPluginTest .headerBox fieldset p {margin:0;} -.mrPluginTest .headerBox form .chk {width:24%; float:left;} -.mrPluginTest a {font-family:monospace;} +/** + * Project: + * CONTENIDO Content Management System + * + * Description: + * Plugin Advanced Mod Rewrite JavaScript functions. + * + * Requirements: + * @con_php_req 5.0 + * + * + * @package CONTENIDO Plugins + * @version 0.1 + * @author Murat Purc + * @copyright four for business AG + * @license http://www.contenido.org/license/LIZENZ.txt + * @link http://www.4fb.de + * @link http://www.contenido.org + * @since file available since CONTENIDO release 4.9.0 + * + * {@internal + * created 2011-04-11 + * + * $Id$: + * }} + * + */ + + +/** + * mrPlugin main page + * @section mrPlugin + */ + +body.mrPlugin {margin:10px;} + +.mrPlugin a {color:#0060b1;} +.mrPlugin strong {font-weight:bold;} +.mrPlugin img {border:none;} + +.mrPlugin pre.example {padding:3px 5px; border:1px #000 dashed; width:60%; min-width:650px;} + +.mrPlugin li {padding-bottom:0.4em;} + +.mrPlugin span.note {color:red;} +.mrPlugin input.disabled {background-color:#dadada;} + +.mrPlugin .altBg {background-color:#f1f1f1;} +.mrPlugin .aToolTip ul {padding-left:1em;} +.mrPlugin .clear {clear:both; font-size:0pt !important; height:0pt !important; line-height:0pt !important;} +.mrPlugin .blockLeft {display:block; float:left;} +.mrPlugin .blockRight {display:block; float:right;} +.mrPlugin .nodisplay {display:none;} + + +/* Header box */ +.mrPlugin .headerBox {background-color:#e2e2e2; border:1px solid #b5b5b5; padding:6px; margin-bottom:10px;} +.mrPlugin .headerBox p {margin:0; padding:0;} +.mrPlugin .headerBox ul {margin-bottom:0;} + + +/* Content table */ +.mrPlugin table#contenttable {border:0; border-top:1px; border-left:1px; border-bottom:1px; border-color:#b3b3b3; border-style:solid;} +.mrPlugin table#contenttable th {font-weight:bold; text-align:left;} +.mrPlugin table#contenttable tr {background-color:#fff;} +.mrPlugin th, .mrPlugin td {vertical-align:top;} +.mrPlugin td.col-I {border:0; border-bottom:1px; border-right:1px; border-color:#b3b3b3; border-style:solid;} +.mrPlugin td.col-II {border:0; border-bottom:1px; border-right:1px; border-color:#b3b3b3; border-style:solid;} + +.mrPlugin tr.marked td {background-color:#f2b7a1;} + + +/* Info button */ +.mrPlugin a.infoButton, +.mrPlugin a.infoButton:hover {display:block; float:left; width:16px; height:16px; background:transparent url(../../../images/info.gif) no-repeat; margin:0 0 0 5px;} +.mrPlugin a.infoButton.v2, +.mrPlugin a.infoButton:hover.v2 {margin-top:2px;} + + +/* Plugininfo layer */ +.mrPlugin .pluginInfo {} +.mrPlugin .pluginInfo p {font-weight:bold; margin:0; padding:0;} +.mrPlugin .pluginInfo ul {margin:0; padding:0; list-style-type:none;} +.mrPlugin .pluginInfo li {margin:0; padding:0;} +.mrPlugin .pluginInfo li.first {margin-top:0.6em;} + + + +/** + * mrPlugin test page + * @section mrPluginTest + */ + +/** @extends body.mrPlugin */ +body.mrPluginTest {} + +.mrPluginTest .headerBox form {float:left; width:35%; background:#e2e2e2; margin:0; padding-top:10px;} +.mrPluginTest .headerBox fieldset {margin-bottom:10px;} +.mrPluginTest .headerBox fieldset p {margin:0;} +.mrPluginTest .headerBox form .chk {width:24%; float:left;} +.mrPluginTest a {font-family:monospace;} diff --git a/conlite/plugins/mod_rewrite/templates/content.html b/conlite/plugins/mod_rewrite/templates/content.html index aea348f..fb5fb68 100644 --- a/conlite/plugins/mod_rewrite/templates/content.html +++ b/conlite/plugins/mod_rewrite/templates/content.html @@ -1,366 +1,368 @@ - - - - mod_rewrite_content - - - - - - - - - - - - - - -
    -
    -
    Plugin Advanced Mod Rewrite -
    - -
    -
    - -{CONTENT_BEFORE} - -
    - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    {LNG_PLUGIN_SETTINGS}
    -
    - {LNG_NOTE}
    - {LNG_MSG_NO_HTACCESS_FOUND}
    -
    -
    -
    - - -
    -
    - -
    {LNG_ROOTDIR} - {ROOTDIR_ERROR} - -
    - -
    -
    - - -
    -
    - -
    {LNG_STARTFROMROOT} -
    - - -
    -
    - -
    {LNG_USE_CLIENT} - -
    -
    - -
    -
    {LNG_USE_LANGUAGE} - -
    -
    - -
    -
    - {LNG_USERDEFINED_SEPARATORS_HEADER} -
    - -
    {LNG_CATEGORY_SEPARATOR} - {CATEGORY_SEPARATOR_ERROR} - - {LNG_CATART_SEPARATOR_INFO} -
    {LNG_CATEGORY_WORD_SEPARATOR} - {CATEGORY_WORD_SEPARATOR_ERROR} - - {LNG_WORD_SEPARATOR_INFO} -
    {LNG_ARTICLE_SEPARATOR} - {ARTICLE_SEPARATOR_ERROR} - - {LNG_CATART_SEPARATOR_INFO} -
    {LNG_ARTICLE_WORD_SEPARATOR} - {ARTICLE_WORD_SEPARATOR_ERROR} - - {LNG_WORD_SEPARATOR_INFO} -
    {LNG_ADD_STARTART_NAME_TO_URL} - {ADD_STARTART_NAME_TO_URL_ERROR} - -
    -
    -
    -
    - -
    -
    - -
    {LNG_FILE_EXTENSION} - {FILE_EXTENSION_ERROR} -
    -
    -
    -
    - -

    {LNG_FILE_EXTENSION_INFO3}

    -
    {LNG_USE_LOWERCASE_URI} - - -
    {LNG_PREVENT_DUPLICATED_CONTENT} -
    -
    -
    -
    - -
    {LNG_CATEGORY_RESOLVE_MIN_PERCENTAGE} - {CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR} -
    - (0 - 100) -
    -
    - -
    {LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE} -
    - -
    -
    -
    - -
    {LNG_REWRITE_URLS_AT} -
    - - -
    -
    - -
    - -
    - -
    -
    -
    - -
    {LNG_REWRITE_ROUTING} -
    {LNG_REWRITE_ROUTING_INFO}
    -
    - - -
    - - - -
    - -
    - -{CONTENT_AFTER} - - + + + + mod_rewrite_content + + + + + + + + + + + + + + +
    +
    +
    Plugin Advanced Mod Rewrite +
    + +
    +
    + +{CONTENT_BEFORE} + +
    + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    {LNG_PLUGIN_SETTINGS}
    + {LNG_NOTE}
    +

    + {LNG_MSG_NO_HTACCESS_FOUND}
    +

    +

    + {LNG_MSG_NO_EMPTYALIASES_FOUND}
    +

    +
    +
    + + +
    +
    + +
    {LNG_ROOTDIR} + {ROOTDIR_ERROR} + +
    + +
    +
    + + +
    +
    + +
    {LNG_USE_CLIENT} + +
    +
    + +
    +
    {LNG_USE_LANGUAGE} + +
    +
    + +
    +
    {LNG_STARTFROMROOT} +
    + + +
    +
    + +
    + {LNG_USERDEFINED_SEPARATORS_HEADER} +
    + +
    {LNG_CATEGORY_SEPARATOR} + {CATEGORY_SEPARATOR_ERROR} + + {LNG_CATART_SEPARATOR_INFO} +
    {LNG_CATEGORY_WORD_SEPARATOR} + {CATEGORY_WORD_SEPARATOR_ERROR} + + {LNG_WORD_SEPARATOR_INFO} +
    {LNG_ARTICLE_SEPARATOR} + {ARTICLE_SEPARATOR_ERROR} + + {LNG_CATART_SEPARATOR_INFO} +
    {LNG_ARTICLE_WORD_SEPARATOR} + {ARTICLE_WORD_SEPARATOR_ERROR} + + {LNG_WORD_SEPARATOR_INFO} +
    {LNG_ADD_STARTART_NAME_TO_URL} + {ADD_STARTART_NAME_TO_URL_ERROR} + +
    +
    +
    +
    + +
    +
    + +
    {LNG_FILE_EXTENSION} + {FILE_EXTENSION_ERROR} +
    +
    +
    +
    + +

    {LNG_FILE_EXTENSION_INFO3}

    +
    {LNG_USE_LOWERCASE_URI} + + +
    {LNG_PREVENT_DUPLICATED_CONTENT} +
    +
    +
    +
    + +
    {LNG_CATEGORY_RESOLVE_MIN_PERCENTAGE} + {CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR} +
    + (0 - 100) +
    +
    + +
    {LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE} +
    + +
    +
    +
    + +
    {LNG_REWRITE_URLS_AT} +
    + + +
    +
    + +
    + +
    + +
    +
    +
    + +
    {LNG_REWRITE_ROUTING} +
    {LNG_REWRITE_ROUTING_INFO}
    +
    + + +
    + + + +
    + +
    + +{CONTENT_AFTER} + + \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/templates/content_top.html b/conlite/plugins/mod_rewrite/templates/content_top.html new file mode 100755 index 0000000..dfcdf35 --- /dev/null +++ b/conlite/plugins/mod_rewrite/templates/content_top.html @@ -0,0 +1,36 @@ + + + + mod_rewrite_content_menu_top + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/templates/contentexpert.html b/conlite/plugins/mod_rewrite/templates/contentexpert.html index e286563..c30c08c 100644 --- a/conlite/plugins/mod_rewrite/templates/contentexpert.html +++ b/conlite/plugins/mod_rewrite/templates/contentexpert.html @@ -1,153 +1,151 @@ - - - - mod_rewrite_content_expert - - - - - - - - - - - - - - -
    -{LNG_PLUGIN_FUNCTIONS} -
    - -{CONTENT_BEFORE} - -
    - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - -
    {LNG_COPY_HTACCESS_TYPE} - {COPY_HTACCESS_ERROR} - -
    - -
    - - -
    -
    - - {LNG_COPY_HTACCESS_TO}
    -
    - - {LNG_COPY_HTACCESS_TO_CONTENIDO} -
    - -
    - - - {LNG_COPY_HTACCESS_TO_CLIENT} -
    - -
    - - {LNG_OR}
    -
    - - {LNG_DOWNLOAD} -
    - -
    - -
    -
    - {LNG_RESETALIASES} - - - {LNG_RESETEMPTY_LINK} -
    - -
    - - - {LNG_RESETALL_LINK} -
    - -
    - {LNG_NOTE}:
    - {LNG_RESETALIASES_NOTE} -
    - - - -
    - -
    - -{CONTENT_AFTER} - - + + + + mod_rewrite_content_expert + + + + + + + + + + + + + + +
    +{LNG_PLUGIN_FUNCTIONS} +
    + +{CONTENT_BEFORE} + +
    + + + + + + + + ++ + + + + + + + + + + + + + + + + + + + + +
    {LNG_COPY_HTACCESS_TYPE} + {COPY_HTACCESS_ERROR} + +
    + +
    + + +
    +
    + + {LNG_COPY_HTACCESS_TO}
    +
    + + {LNG_COPY_HTACCESS_TO_CONTENIDO} +
    + +
    + + + {LNG_COPY_HTACCESS_TO_CLIENT} +
    + +
    + + {LNG_OR}
    +
    + + {LNG_DOWNLOAD} +
    + +
    + +
    +
    + {LNG_RESETALIASES} + + + {LNG_RESETEMPTY_LINK} +
    + +
    + + + {LNG_RESETALL_LINK} +
    + +
    + {LNG_NOTE}:
    + {LNG_RESETALIASES_NOTE} +
    + + + +
    + +
    + +{CONTENT_AFTER} + + \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/templates/contenttest.html b/conlite/plugins/mod_rewrite/templates/contenttest.html index 2b5035b..972e815 100644 --- a/conlite/plugins/mod_rewrite/templates/contenttest.html +++ b/conlite/plugins/mod_rewrite/templates/contenttest.html @@ -1,64 +1,63 @@ - - - - mod_rewrite_content_test - - - - - - - - - - - - -
    -

    {LNG_FORM_INFO}

    -

    - - - -
    - {LNG_FORM_LABEL} -

    -
    - -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    - -{CONTENT} - - - + + + + mod_rewrite_content_test + + + + + + + + + + + + +
    +

    {LNG_FORM_INFO}

    +

    + + + +
    + {LNG_FORM_LABEL} +

    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +{CONTENT} + + + diff --git a/conlite/plugins/mod_rewrite/xml/lang_de_DE.xml b/conlite/plugins/mod_rewrite/xml/lang_de_DE.xml index 219aeeb..284d0fc 100644 --- a/conlite/plugins/mod_rewrite/xml/lang_de_DE.xml +++ b/conlite/plugins/mod_rewrite/xml/lang_de_DE.xml @@ -1,14 +1,14 @@ - - - - - - -
    AMR
    - Einstellungen - Funktionen - Test -
    -
    -
    -
    + + + + + + +
    AMR
    + Einstellungen + Funktionen + Test +
    +
    +
    +
    \ No newline at end of file diff --git a/conlite/plugins/mod_rewrite/xml/lang_en_US.xml b/conlite/plugins/mod_rewrite/xml/lang_en_US.xml index e97222b..e762395 100644 --- a/conlite/plugins/mod_rewrite/xml/lang_en_US.xml +++ b/conlite/plugins/mod_rewrite/xml/lang_en_US.xml @@ -1,14 +1,14 @@ - - - - - - -
    AMR
    - Settings - Functions - Test -
    -
    -
    -
    + + + + + + +
    AMR
    + Settings + Functions + Test +
    +
    +
    +
    \ No newline at end of file