From 16ad56ae48500cea2c5d1438d9d39658ab43fc02 Mon Sep 17 00:00:00 2001 From: Ortwin Pinke Date: Mon, 4 Nov 2019 16:57:28 +0100 Subject: [PATCH] init files --- classes/class.modrewrite.php | 1071 +++++++++++++++++ classes/class.modrewritebase.php | 87 ++ classes/class.modrewritecontroller.php | 678 +++++++++++ classes/class.modrewritedebugger.php | 88 ++ classes/class.modrewritetest.php | 300 +++++ classes/class.modrewriteurlstack.php | 314 +++++ classes/class.modrewriteurlutil.php | 306 +++++ .../class.modrewrite_content_controller.php | 426 +++++++ ...ss.modrewrite_contentexpert_controller.php | 143 +++ ...lass.modrewrite_contenttest_controller.php | 176 +++ .../class.modrewrite_controller_abstract.php | 226 ++++ external/aToolTip/css/atooltip.css | 43 + external/aToolTip/css/style.css | 174 +++ external/aToolTip/demos.html | 81 ++ external/aToolTip/images/bg.png | Bin 0 -> 1218 bytes external/aToolTip/images/infoBtn.gif | Bin 0 -> 90 bytes external/aToolTip/js/atooltip.jquery.js | 118 ++ external/aToolTip/js/atooltip.min.jquery.js | 2 + external/aToolTip/js/jquery.min.js | 19 + files/htaccess_restrictive.txt | 61 + files/htaccess_simple.txt | 59 + includes/config.mod_rewrite_default.php | 114 ++ includes/config.plugin.php | 167 +++ includes/front_content_controller.php | 102 ++ includes/functions.mod_rewrite.php | 912 ++++++++++++++ includes/include.mod_rewrite_content.php | 312 +++++ includes/include.mod_rewrite_content_top.php | 18 + .../include.mod_rewrite_contentexpert.php | 119 ++ includes/include.mod_rewrite_contenttest.php | 83 ++ locale/de_DE/LC_MESSAGES/mod_rewrite.mo | Bin 0 -> 30156 bytes locale/de_DE/LC_MESSAGES/mod_rewrite.po | 944 +++++++++++++++ locale/mod_rewrite.pot | 744 ++++++++++++ locale/potfiles.txt | 24 + scripts/mod_rewrite.js | 96 ++ styles/styles.css | 101 ++ templates/content.html | 368 ++++++ templates/content_top.html | 36 + templates/contentexpert.html | 151 +++ templates/contenttest.html | 63 + xml/lang_de_DE.xml | 14 + xml/lang_en_US.xml | 14 + 41 files changed, 8754 insertions(+) create mode 100644 classes/class.modrewrite.php create mode 100644 classes/class.modrewritebase.php create mode 100644 classes/class.modrewritecontroller.php create mode 100644 classes/class.modrewritedebugger.php create mode 100644 classes/class.modrewritetest.php create mode 100644 classes/class.modrewriteurlstack.php create mode 100644 classes/class.modrewriteurlutil.php create mode 100644 classes/controller/class.modrewrite_content_controller.php create mode 100644 classes/controller/class.modrewrite_contentexpert_controller.php create mode 100644 classes/controller/class.modrewrite_contenttest_controller.php create mode 100644 classes/controller/class.modrewrite_controller_abstract.php create mode 100644 external/aToolTip/css/atooltip.css create mode 100644 external/aToolTip/css/style.css create mode 100644 external/aToolTip/demos.html create mode 100644 external/aToolTip/images/bg.png create mode 100644 external/aToolTip/images/infoBtn.gif create mode 100644 external/aToolTip/js/atooltip.jquery.js create mode 100644 external/aToolTip/js/atooltip.min.jquery.js create mode 100644 external/aToolTip/js/jquery.min.js create mode 100644 files/htaccess_restrictive.txt create mode 100644 files/htaccess_simple.txt create mode 100644 includes/config.mod_rewrite_default.php create mode 100644 includes/config.plugin.php create mode 100644 includes/front_content_controller.php create mode 100644 includes/functions.mod_rewrite.php create mode 100644 includes/include.mod_rewrite_content.php create mode 100644 includes/include.mod_rewrite_content_top.php create mode 100644 includes/include.mod_rewrite_contentexpert.php create mode 100644 includes/include.mod_rewrite_contenttest.php create mode 100644 locale/de_DE/LC_MESSAGES/mod_rewrite.mo create mode 100644 locale/de_DE/LC_MESSAGES/mod_rewrite.po create mode 100644 locale/mod_rewrite.pot create mode 100644 locale/potfiles.txt create mode 100644 scripts/mod_rewrite.js create mode 100644 styles/styles.css create mode 100644 templates/content.html create mode 100644 templates/content_top.html create mode 100644 templates/contentexpert.html create mode 100644 templates/contenttest.html create mode 100644 xml/lang_de_DE.xml create mode 100644 xml/lang_en_US.xml diff --git a/classes/class.modrewrite.php b/classes/class.modrewrite.php new file mode 100644 index 0000000..92c5387 --- /dev/null +++ b/classes/class.modrewrite.php @@ -0,0 +1,1071 @@ + + * @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); + 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/classes/class.modrewritebase.php b/classes/class.modrewritebase.php new file mode 100644 index 0000000..ff7fe8a --- /dev/null +++ b/classes/class.modrewritebase.php @@ -0,0 +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 + */ + +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($clientId) { + } + + /** + * 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/classes/class.modrewritecontroller.php b/classes/class.modrewritecontroller.php new file mode 100644 index 0000000..aa59e24 --- /dev/null +++ b/classes/class.modrewritecontroller.php @@ -0,0 +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 + */ + +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/classes/class.modrewritedebugger.php b/classes/class.modrewritedebugger.php new file mode 100644 index 0000000..2e3a302 --- /dev/null +++ b/classes/class.modrewritedebugger.php @@ -0,0 +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 + */ + +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/classes/class.modrewritetest.php b/classes/class.modrewritetest.php new file mode 100644 index 0000000..5801ea7 --- /dev/null +++ b/classes/class.modrewritetest.php @@ -0,0 +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 + */ + +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/classes/class.modrewriteurlstack.php b/classes/class.modrewriteurlstack.php new file mode 100644 index 0000000..99713fd --- /dev/null +++ b/classes/class.modrewriteurlstack.php @@ -0,0 +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 + */ + +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/classes/class.modrewriteurlutil.php b/classes/class.modrewriteurlutil.php new file mode 100644 index 0000000..37d42ce --- /dev/null +++ b/classes/class.modrewriteurlutil.php @@ -0,0 +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 + */ + +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/classes/controller/class.modrewrite_content_controller.php b/classes/controller/class.modrewrite_content_controller.php new file mode 100644 index 0000000..17477cb --- /dev/null +++ b/classes/controller/class.modrewrite_content_controller.php @@ -0,0 +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 + */ + +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/classes/controller/class.modrewrite_contentexpert_controller.php b/classes/controller/class.modrewrite_contentexpert_controller.php new file mode 100644 index 0000000..8c647dc --- /dev/null +++ b/classes/controller/class.modrewrite_contentexpert_controller.php @@ -0,0 +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 + */ + +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/classes/controller/class.modrewrite_contenttest_controller.php b/classes/controller/class.modrewrite_contenttest_controller.php new file mode 100644 index 0000000..067e3f3 --- /dev/null +++ b/classes/controller/class.modrewrite_contenttest_controller.php @@ -0,0 +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 + */ + +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/classes/controller/class.modrewrite_controller_abstract.php b/classes/controller/class.modrewrite_controller_abstract.php new file mode 100644 index 0000000..8f8d06c --- /dev/null +++ b/classes/controller/class.modrewrite_controller_abstract.php @@ -0,0 +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 + */ + +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/external/aToolTip/css/atooltip.css b/external/aToolTip/css/atooltip.css new file mode 100644 index 0000000..978487f --- /dev/null +++ b/external/aToolTip/css/atooltip.css @@ -0,0 +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; +} diff --git a/external/aToolTip/css/style.css b/external/aToolTip/css/style.css new file mode 100644 index 0000000..1d3236c --- /dev/null +++ b/external/aToolTip/css/style.css @@ -0,0 +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; +} + + + diff --git a/external/aToolTip/demos.html b/external/aToolTip/demos.html new file mode 100644 index 0000000..b9f91c8 --- /dev/null +++ b/external/aToolTip/demos.html @@ -0,0 +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. +

+ + +
+ + + + \ No newline at end of file diff --git a/external/aToolTip/images/bg.png b/external/aToolTip/images/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..35d844bb7170cfd7fa492fca7f4f2b6465ff769a GIT binary patch literal 1218 zcmV;z1U>tSP)pEOG|?z}&w{a)lP55qvq+m5_=A0pm!hpflpGUoeq&G%C` zD+hTo&-3>6ylkR^2>S_;^Npi|&Bt_7p+(3C6Wjau*lfSnPjAe9pYp`DzU}q2lHx@M zh`hm!pSAvjjzs`^<%uuija%;oB+Lz0y>*9?{@Z{5`N_^e_I4d!yg;JCPo#W%y4c zwvGGC(l&mZ~tmMhUb47@gzh7q0v_-!LO&e&3Rkc(lZ!<|U0hQLij& zT>W?S$*|}EZ?sh(tZ5_^;^ku%r~1hyH}Jb%Wqr)J!0d+&5;SiLavv?6c$Wt+nk-ur zobtiR4_jYyN`R@qQu9to(B2nve@!SgzZm=Y0IYuc2k-Z-OJ9KhXiAUYiLx&kv@%aCt6CQvcGXy!yoMkH6<{`|QvD?9cw}&;IPs{_M~G?9cw} g&;IP|_fLQU00A?kT&QvP%m4rY07*qoM6N<$g8amQ1^@s6 literal 0 HcmV?d00001 diff --git a/external/aToolTip/images/infoBtn.gif b/external/aToolTip/images/infoBtn.gif new file mode 100644 index 0000000000000000000000000000000000000000..8f8629e962a5ddf25582ec9694fa4843dea54d84 GIT binary patch literal 90 zcmZ?wbhEHb6krfwSj57>kg)Op|No5}Zq%*6!GHu5f3h$#Ft9M_fW$y*8JOigHr!dO icgi!8W9!{BEe}o`G#p@?B{OTKsQ1p4KNDP-7_0$)${WQ1 literal 0 HcmV?d00001 diff --git a/external/aToolTip/js/atooltip.jquery.js b/external/aToolTip/js/atooltip.jquery.js new file mode 100644 index 0000000..83efbbf --- /dev/null +++ b/external/aToolTip/js/atooltip.jquery.js @@ -0,0 +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); \ No newline at end of file diff --git a/external/aToolTip/js/atooltip.min.jquery.js b/external/aToolTip/js/atooltip.min.jquery.js new file mode 100644 index 0000000..626b478 --- /dev/null +++ b/external/aToolTip/js/atooltip.min.jquery.js @@ -0,0 +1,2 @@ +/*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/external/aToolTip/js/jquery.min.js b/external/aToolTip/js/jquery.min.js new file mode 100644 index 0000000..55c2e6d --- /dev/null +++ b/external/aToolTip/js/jquery.min.js @@ -0,0 +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/ + */ +(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/files/htaccess_restrictive.txt b/files/htaccess_restrictive.txt new file mode 100644 index 0000000..1ce3a7a --- /dev/null +++ b/files/htaccess_restrictive.txt @@ -0,0 +1,61 @@ +################################################################################ +# ConLite AMR plugin restrictive rewrite rules set. +# +# Contains strict rules, each rewrite exclusion must be set manually. +# - Exclude requests to directories usage/, conlite/, setup/, cms/upload/ +# - Exclude requests to cms/front_content.php, cms/dbfs.php +# - Pass thru requests to common ressources (pictures, movies, js, css, pdf) +# +# @version 1.0.0 +# @author Ortwin Pinke +# @author Murat Purc +# @copyright 2019 ConLite Team +# @link http://www.conlite.org +# +# Versions before 1.0 copyright 4fb, author Murat Purc +# +# $Id: htaccess_restrictive.txt 145 2019-10-25 16:00:47Z oldperl $ +################################################################################ + + + + # 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] + RewriteRule ^cms/dbfs.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|svg|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 + + \ No newline at end of file diff --git a/files/htaccess_simple.txt b/files/htaccess_simple.txt new file mode 100644 index 0000000..05df099 --- /dev/null +++ b/files/htaccess_simple.txt @@ -0,0 +1,59 @@ +################################################################################ +# ConLite AMR plugin simple rewrite rules set. +# +# Contains few easy to handle rewrite rules. +# +# @version 1.0.0 +# @author Ortwin Pinke +# @author Murat Purc +# @copyright 2019 ConLite Team +# @link http://www.conlite.org +# +# Versions before 1.0 copyright 4fb, author Murat Purc +# +# $Id: htaccess_simple.txt 145 2019-10-25 16:00:47Z oldperl $ +################################################################################ + + + + # 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 + + \ No newline at end of file diff --git a/includes/config.mod_rewrite_default.php b/includes/config.mod_rewrite_default.php new file mode 100644 index 0000000..3476a5b --- /dev/null +++ b/includes/config.mod_rewrite_default.php @@ -0,0 +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 + */ + +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/includes/config.plugin.php b/includes/config.plugin.php new file mode 100644 index 0000000..2cb5754 --- /dev/null +++ b/includes/config.plugin.php @@ -0,0 +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 + */ + +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/includes/front_content_controller.php b/includes/front_content_controller.php new file mode 100644 index 0000000..d5a8f1a --- /dev/null +++ b/includes/front_content_controller.php @@ -0,0 +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 + */ + +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/includes/functions.mod_rewrite.php b/includes/functions.mod_rewrite.php new file mode 100644 index 0000000..76d32dc --- /dev/null +++ b/includes/functions.mod_rewrite.php @@ -0,0 +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 + */ + +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/includes/include.mod_rewrite_content.php b/includes/include.mod_rewrite_content.php new file mode 100644 index 0000000..23fcc74 --- /dev/null +++ b/includes/include.mod_rewrite_content.php @@ -0,0 +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 + */ + +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/includes/include.mod_rewrite_content_top.php b/includes/include.mod_rewrite_content_top.php new file mode 100644 index 0000000..cb5b555 --- /dev/null +++ b/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/includes/include.mod_rewrite_contentexpert.php b/includes/include.mod_rewrite_contentexpert.php new file mode 100644 index 0000000..50d88ce --- /dev/null +++ b/includes/include.mod_rewrite_contentexpert.php @@ -0,0 +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 + */ + +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/includes/include.mod_rewrite_contenttest.php b/includes/include.mod_rewrite_contenttest.php new file mode 100644 index 0000000..9bff07f --- /dev/null +++ b/includes/include.mod_rewrite_contenttest.php @@ -0,0 +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 + */ + +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/locale/de_DE/LC_MESSAGES/mod_rewrite.mo b/locale/de_DE/LC_MESSAGES/mod_rewrite.mo new file mode 100644 index 0000000000000000000000000000000000000000..bd03a829d8549e97f4b1a61a503ba79a08193d6d GIT binary patch literal 30156 zcmds=e~et$b>E+3JGM8DWBHey*s-7WYnS%U4oUs=N~BD3ml7pXq`8#jAF}DUGjDdE zcIM6ay%{c-svJjE?4~K)HmPAWHJTz(T@;3sAgI-%6^y0?QWQ!3N7?{IU=)a*qHb)Y zZcw*K+M@k@&%O7(H@mYGrPOWF0pFgPdGFnK@44s4_ndpr@ZY}aRiBS|eU{^$92Z^{ zMPG&fmDloz*C&1?ib`k#?L&VL`V{o|>!avN=+~etuZW@pKN>~vf#z?BqPOz>U;D8r z`s>gyLEi$s=Z#VHF6bHPk3;*=`=OtKz61JO(1Xx#LhpgT`GzR^Vd!b-+h}(UN>kC3 zZ;GNAdIhTM{ucB&^j||yKyQ3=6rF;86#5YK??RWM--F%=eIK29FYTRxuJSpjv!ee1 zs`39BvtjJKN&@0@vC7<34H^UAwG`Ag7S zpuY;;f&MG#v(Phf6rF|sE>z>c={y-fihdLNGte7e!MU61JD)#H zqp&zCpnnK`7Wyh^cB|`u4(;;!XQArXA49n{`k&Ai^k$eK{(ca80GdJD&|iSQ7kU+{ z`Tb+4?tk}u6d_8{L8$m~A2f!ZhDtsLP|3w-q2k}KK7&qFp!Y*N(38+#f$}fe zp*P)&EJ5#u{u}5~=r^G^-Up9q@6Vu@`TQ?nY5_eCQ$G#;D)cGnT_4~(uKNw>-O%qJ zbMw_YLEkuk0*Z=8{|WkT=nt>B{@ey#(>{cf5`c- zKwqQwKI-)O7opGa`JX@~H%Fg{qT8X5LlN=l=b*PhzXm-B{T5XE_Lh&i&qty9JcQl= z{hQDqfqohKX6QeJ#?aq}N>0A(>FYo4__qkXjqe|V-U;lfe;WFF=$HNZe*}FepT7=03jGcg(TLvr3Fik&sP6k`P^L8cF7zJg zk;Ki{C1{V&KMTDP`aNj+3g&7(ihhUBc?TZ`y|)YRp);EW#~=N z-+_u>{}C#FyzY}uFK>YUCEB|UD*pXi;pFZc(0B0pyHL&dYs)D5`_T75HP62deHHY3 z&~HG$5B*cfZw#JYwo~1D{SczB$5s@kB3;LH6x4 z9OAoPlA||pNFVk3G{+k`4sygCk`KLp)R8@Zukek=ga}2O9Cvd_c0SCp%%K<4X|IR) zD}G8BHE)syy-st;&h!P?mSd&y-8=pJ40?#;Jscn4 z_z=hA96!VnUO&N`Ee_Pj@F{9(ufzP6oL=I%jpHOo&Y>5oWU~EJ(DVAjzgp1OaY&B! zI>&L0V~67t9Ehx8)V~PT>jK9b$IToI9M5n>H^-}&lfkH;F2^U5ak?=qcH%M}B}FnG z7V$#+K%C^=I4QD+nu zaW&t_@-!aib8|Px-K>0RclCPkv>X?c&UjMLN-s|0d{_*Uemp7qbGPs(J`&IOieWy! z*x^r_kC#T9qx-WitT=M$@a?xD1NZimeB;Prd)w(}Tyx~m{JrW>r$`e`pKDpIt?$H> zGRrsOF~d4>_K^##kDOXLTgHzT{nqhG*6*eW4;OUO_>QG}mfnA0k!H5D&Ssom9;Kae zX*WvD2I-hhxu@rx30rF zbKu^&Tk>?9o^aa<8*J7cUgY!g@TF zp*w?7l5OPe!v`;p(xLme_4!b7e^kCM^qCZCt z-(Gj4NIyAA%dsB2y}exwhxWG7IoFMSS~EGhD_R&0%QBNlUrPEkw;bPE9*7PdJP5DT z%SmS(50Wvnyq%3V5kVf-PYbbo?w&hit{Elc&C;FiXX7#Lq(w0-^i{v_@1=ufHpu!( zfj*?=+`(9PTDy`syAngR6~mf5?qR0J!!e@Hm^f`uh>mqH>8aiL3@Yb!Z0477Z<2Q; z+vV)jV^|g)8;#Q13dWk_IO%UEJBaZxe)Rn5GG4IGBxCo9Z@u}-Qus6Let%zCV9(-V@zI8ALjk3PHZ2OBBj${Wb$Y>2va4jW_d9VQUE4#QX-P_W@yQ%NH1l>Nm={H7&R|tYrOMJ zBx@M9xSwsMv;8xCKXS-ivh&r4=e@3_t_wj?i*(daWbhDj`DCYS>T+ZJ>nYEZxyid4 zwXS>c!kN=ydmcl?{FgREaAW85Y%M#kZ_N?3OuKo-h%?_0a#C+-!1THMaCE~sDUw+39TN`97TGW z2WXDt}J$?G(xnma|eA))4yUfw!>t#QHCBwl0gFqizL7&h0)a>7TSxn%6fHZoXQxAp3)=rOWDi~@m6YL|=%4AqwYQnjeF4~s~ zhIGwrUi+teKiM79gj^lgQGCUHyC__j?G4*y z{Kc*9bR8R7;MU_-+`zw@bA!}fn*gGIc?z|vyK1eKw3lPqe?lh9I^v7&I4COu1RkX8rs$E$V4aq^tYU+y92e)4fzk@)(`J;)Q38S)@AT6nIH3NpSl%cA zO7ln8CI(`AlfEQ#*awICn@e}*>HFHc*{u0}dz&fJ?)=eJ7h-oE)^+V5*S?`%lJ%=r z+F%2s=%dkU>kQvZs}dJBuDVRt%)r{~X><}mQ(K=HU@N9#GJ?Kf0HTv-8Ok9>Jp>gp zHErf21gxMYfF=gu6q;C0`4~DBY!U-W36p&ME@8a2JQ?Y!Zts6XOBGKn%&HrF zdHo8ly@YlMKhku-bYeeyaZ_%{t>8NI`LW9m0Me0%d9+GF;5>3SCYkMRZZ{bx>j+g9 z#W?8!HH~+$)FyAUMTjYrpU#=fvP@`^*>w1f8)ISky&^wAx^qx%cOvA%`AimQgZV5; zngu*4>n|JW^cqu-Cx~}aLeOKmod_nla_HElora6byetL1>5@xz!3m@GoRS{75jfQ* zgVV%pQ-i6Wvk6{lT5J#P=4WNHrZZvlKzZj%gORSh)mfCF*v^Rf40rHoFAkc>#xesD zoQ0k)i6gTt1n5F#ho*$4r&%${on5m)y>7P3AZc!!964h%B+a5PArd6SiOvX=X1RNs z;@apDJ$wbeYfA{vOp^$Gf{=S{ z;u|xfAx&r6S)H?+CHx>2=jSod=c@GpWP{8AU+l`}xY&4Q*qKPd&XdHB&beHgG4!qZ@&S=5KWOe!+dH6B5ZVx^` zpE_8nhjo-XLW_3UtTL)DqD@;2aM`$Bw~$8hR!(=w&?{r@#i{X4;AJalez-=_gtx-M z+y?;`{8KuMsAK$mnvhOYszIT7 zTwPAwRd^}8@XoKOr&CI;kV zP6%Bh)#w*$8Y?euNtT5T7DmL_6=b)`=YtXK3 ziM0z{UQMH$wL1CjG8rkk6(kTY)K;?z`;if*RV#ELH@nVT(dv8aG67BL#8+&ajMU(Z zL@nxE0C*;$N+TxR=;8akn@tHi32*bI$Ww&Bqt^Lqi@-StU7p)7)X zk<*B(*&&f$>{u6fDbPz9`4dYEyN3R;1Jv7 zr73A%>%`Y=RwZjTBeP`0qRMFz*~KLU#Mq?03sSEtGp1D|P1A!HE}V-ufe@$z`etIU zwE;v(a@S0@ATBP_ZeC}s-;}}5ktMhGD+{nAX1HZ6J=e9Rcm~Eb9b}wrfUdQXfv0Kv z#I7gC3&EeO8Pwk^PpdMQS@*!)DZkIdNjrwXt=ni6IfJRdtfC6#@LAyx);1suBK>uf z3peO0#bnmaYq>3>XkfJKX1$)wfM)_MCkmQdX{4(5w4=^}-LAb-?mP3UR<1Cf-cy`ljV5t zf)HzE!$NLhc`qZJF{*7tt-JHLmh-jRnIx8`lGl5&O!Ugx6OW$JV#fKiXD`HRaw)b1 zwX0-rIt?Y`crRs=$#fPp}TP$_JNQUlmJ|6phcfw0!8&j=>_hJsY7< zwpYR}|F0UNk=4b%nPaNbpo2tUYBTMRlr+X-05{o1r-6X!id`|hu(6bRQYwC)+B={b zfu&(Gi_{#F#XPjCn}R`feodBEMuDttFFtnWypoqSf4mJ;XXL=#K-I_;*j}s+58hEJ zVXx@^i8OCnDcx9WgWoNu5md8;e<3I0Q?G)l@PKtCW0%Xssz>D6rd&%9x{h{2aksf& z2XnFBr0xuxTDPk;d2{LuKI<4B5Lk0SPpMj!pwnt_U_MnrAgCPOg`E+5K#&Fx8+HLw zMxzBJTLw}G!XCbbCKgbpLZ;6^i#4cAt%sh2B%|CVHnu@%#wy7&dn!H$&0R@39wZ5!izU02wO+HRa`&tnTUc%_sp*rC-Y3z1`{ zmklzU1NXW#c)1*zbEF$}U>H5hEPHV=oU9Qj)8Xel>)I8SXWQqR$289kL>o5K9c1cb zHaadvyRTp=CuKtgC*1Cy=&=mH6byo;Vm_>0Dkmylc;31=k>w1(WyPf0ZB>cqv+|-@ zL-y;2s4kdrZ)z%8Cpu^2Q!#{504bXrCJ>NrVN%>aI+gUQR}#j7BzNOi& z;?ywpHU}=M)DDVa#4>Pvs)}P|79CH^$O};AjU#W8Gj=#!cHz0bT_RU5xu=zo*$VmY z_`0&>KBKN)CEh6avb68kNj093jWDS&zvuyD$1u0wJ=NWZLu%(m?^)6nhdxz3>{HkKFxy4l=;hQC z$%sTx;YWH;-{%)ApVD)*gz45UH7)LfuoFFFd6w5x80m{yZcDDy7a%*j!Y<%_OZ6?vMJ>+ngCW9wA6 z<;9;0jbVOTwF7up3I|5RV%$1YZe(4y+;5bv3&Z7j?%df6trG+ZN-nlm*e$UfA3k{K z?$*J(TZit958bnT``zz5c=+H!E^M7=f1db0A{zFR#=bRO#OL&ZB@}!r?>?;P3-Rm+Q*px>voNV1w zU#ABFU0SO|eA>IR9N)8^jpshpIyWSG9k-5?RFsEYj+g2$A5M2H=Xsix@p7CUx+mw{ z18y_4nBeY>4=vrfbVq&H8ac?$<~bT`9bA?HzUX$VrE`=P98bw2qT$Q&!%Pc>Hd)%L zQ@5(L5ez)WLhx4F=i%e#Sqg2o!d(|r{71X~cx5}y3?p)1YdyV^vO1Pe*f{8mZLaUZ zRi}18nsS@^S=V@UWe)Zks~=f&R6n>eCtGZ%$+VGL>4AOgZ_3&AH|fj0-3oDVTkFXr zhE)I;SB673uswhNLL2~wbAXJBw(*TDYmr5}`hxbERQPRo9S+IMMj4K7?Ph6wu3BwN z`mm@jzTtzaZ?IO|SnPECf1wNq=53^#L<(u65NF~(%(bV_?yALcSGC2QV!9k>UCEWf z00UY#V3jymKxb~cN?4_BUHmQj`kT+SB@D`hT47Exyu!lCMdtV-0aaS^j@?bgMKC-? z3~YDvdbdv*4ZbiG<@j=(E0YR@8{knth~Pp`U5BiYh_39@DzkLt5XCuztIuz+M-K4t zxN_&aigUIYnF)&ECw!o*i}98{ua|C8r{jxtu7p~h9yz|4l9G4}Rv^p>o4Zg+&y94Q z&&h<9_%Y5H3!D2&ol7M0%kkCc*eOVXg|)ny^mzEl8Vt9x0F@89TTK&9yEbMP;mrIp zW~+~%nAztqXbH_59oeRsAtU*qcnQD74@tgBH%Uv!3pSATG;=4eOll*YQ#s>|vbDnf z)AvU3nz2y%0x%}dJ_DrFmOX`*Hn@TCtFy|$@{M%V>!%xISI9HN)L($lvK&{~DZx}) z8&}f4nB@Dhef4=}w@}9>xa0@}uQ4Hp@mbsHi2z%dG|{?>MWNfi^7t5gJfo(13sr17!0CZkCjlAvqra_Av_5^feBaxVFZ1k3F zPaWu;8Gr{gIu6|&Tzvr@%9m`Lc%#4mdlm+A?T$-{-zAL%F!WbeEQkQ&Xm&BQ*sSI` zX-nG-qBf5}|9Vq&d8wY9s2WexOI>3^s_U7H>V4zh{XKdZ8%tDlzOzZLLYhmuCCm41 zs(QpOAAOyT`6+7jZ(+~asz)U2^oj_aRjL}6NCTQ9-P>a0;+NIQT{rFRApG&#P<6G| zhjUn%Sk}Bwo(KbH&hCwht1tA@e5xYIDT)+d0(Hy@ti4||SJ2Q5r!{SC&=+W^%}_+25Fh;ye$Sz4^zI%}0rXh>ZEh)|~EEA07xc&a97YnU^} zIH$v7Oc^;ixf^n}?rBT$)h~iXJfq_^`U2MG23exD4hAw?Cm+7aH@&Mbs9b1Q``Z%? zm(>gD305)GcnXWlDO=>KBB9uD8i_`21yAGYuDYfgcSmP19(>j;Ok6(Qucb1!ni;00b(P}=%;jq12 zK2LvoT2aAgtR;hix*+d#KHb3Dvjzi$;15Nf}zp zO#12(x>1=6}v%8!c6CJ9P#OQ0wMUVmV9TaC# zrNr{M3X`swMk!O7`89<&VXZIs3D>M9FpTX!f_OpM<~;fX_=Iy_ zWu?XDvD`7iBT-qy6kG?(s>W-~QV({29_=n`s_)swAc4rh4{_?s zQha;~IGA}Ldj^a<2m^HGP0C$5P8wRA+XlVHPa6K1=! zL4_vs7^KKHF?Ny3XmgXGjNF9+3E*b}=4Pf07UV%8o>ZO|w>|B8+j5#iYWwdO{^=`Z1PGi1SsF~N8WWdwp;p?SoCO(B~wE|kGX;<90z4j z`=3=&6s-^9mEDOC2OP9KK{<|emYf#Ls;>6e@DLm-i8j|=6%-r44H*cgcdN$66h~>W zRajw=h32Zb!e*qNdAILf{Px}ub}J&+x|4JHW)n3*k}6FVxeDiYb<-nqMv6&^b~Y^l z@s8d2F6p09IE4TzCMg+!bN5XYN$rfl8G~4J!Xf#ds-SAESafAYT-BtuYbN+ffBagU zw6V#Q5|?{)Dcfw|W2!f{IL39e7(}JIJo_ReQ6|H@zJ_d3l$#zTGbzw&LaL?c>a%iL z4*zh1JA{!#&6VE1h;6FX5`X4RhPv&LH|AmjzA}^J4gX`c^+HVJpx=gEb^$U@TgoC& zH`(xwovb$*2dQ64Nc5N(N>Od1WL2q-@fBHX=~k_D$MP%5W?zN)fdkwu-SpK^r0HI) zCTq1&1PXpaB6tvJ?dtQ&5?f8zODM}aX{ixe*8zb?Ppzb?BU5SEHH)%<5-#wcRgC2n z#O$1u+Dt~&FpBJpj8~a)Q#l46t>V3L%KcP8w2G-(GJkEkw~%#k8zEwY)k2ltlEtgu zJk)-`B_rI#@t7Rb<+x=#9evW~)>0g|#dhT}oA)gRcEhaEsbmDl0^f z9#J|+hUdX#G8&U?9q@jk>bt&hL74Mj^LAOYjtibQBCz006bg{&u(gu|fj=N4RuDjC ziV{$l5HTBEs2*v!0v&SToQ)hHoyoeY*BscVP>Ftj#5sSf+xq{t9mD~zhgnu#lhj)o z4Q)?l^ToP8^HCU}7B!cUlZfW)tOd6a$Z>J?Ib_m!To-g%E|D1JxP_G7ODo27vU|*S z>UgxVSJbY)pj}2N+6KlBIZ`;Hlo<gp}!yO3xlG8*~Q zJYFr>NTsD6lO_*+u%9ZxUy4p5yQ-qC5Zrtd99<*(IbX%|4zs(lISn!arYrij9HKDz z!*2^&4LJOg2M6G|o6TP<(FW{E;9o&aU&^T!I6|i zBKsc(W-xG+GtH8B-i&rRKI8NAaeGsSYb&hiwGHjnA8nYsznoheQTIu1e|C$?*rIs# zx?tP2a;WjmoR1&&X~HA>#tnO$h#t&xz!<-l+NTsl2A*#DSV5ZM-(%kD z+?xMRsFREqi!luc>~i!$IDt1ZVsOy;UTcE~1o_|Z{9bIR*(YW|7;>+&sQOrjLI42j zb7|Ge3e4T-gc)Op*l=hVdKZzXJ-X&HSkC`owdHD@OuIAHRJL|00E?7f_{~J_k^Ugr zCPHX;NV7E>G!^y6t>s!ew$86}N)8chN6`9PjpADIDB2sIm{h3yFp%yRWOc zHI+405{>&oWCWk9+4OTvJsDS;$yfI4JJJ_;o7?49&TrX=5hSg%XsbZ*h^Nt8};I5Dh^C35pVRJoYG6*4r zD&Ux@0U=Mw!Uvxj)ZI_I<6PQHW9x1`0a4#1(M3{gi@YX3D5|VO1a^0;Cj9mUVl!ou zwOg`LOOa0rRI#JjwL%~3%#X_%cr5KPbBZtu+478i0!f}ijl42X4HUNmd{lvWvpbuV z4{|Yl45q)Vpk)ZzEVU#D+LiaR8S?9&gBhpuf` zbB9i69l{UWoTIv1D()V16?ehl79?F2g9JdMSn(t5F4WJrV*G@k2H_l@TWMrhY$p!X z+00d2=7kMnQd(#hlvG?5IOPWu9n_H?IuB;MvGo{t0{g-KfCXFgt?ZCB6#z-Q^1Uj$ zQ?qVYms6LJzjN4B9Iv|7b}d%1ytm}dEYzOG(?&g>xIgQB zVikEyb3&zBVRGKy(kCP`fNlECf{=R9q@QvLvVb7eAKT&-g4^rsP_s5KJlc8Lu=XQk zT&-n2)-d>Am(}r<7!I5HERi1ch zb$RP4zl|Z=v4H9J-HD+r=hWO71XPE6mR%tqyS!C=j(DwwY6JCb!G7d)lgDS}3Z5G|xv-L5<{(79!n z3`=Q3>%AQcp^|k29|-`=XTz%GZCFBdGc)B3Xa>hgDVAxVm<3BWZ2yK&#$91y+6_M} zt~DS`rEv9zGk)wEw&1J{EFa6!5#cnyVju}Kq4BW~0ik*vu)l^iB&a5#-TOiZ3tU>x)%?TT=`sS`}MTI&*a(yZUBoEwVujGj-cI=@? znxb79dI4Rx_z)~v$?tW$HH#{kspWomMj$|K6KSPpgKQIdC|#*1+8U$Hwlcs~X2*-H z;}we#k4qlRy9i}TUM-z8ws;-(D1X}w6Wo(*+s3djm_qAUpX+6pc}Mn0+hp~-U~~cv zE5IqBB76=a=#kL^`?*JgNV=wCt*;|w{Uc1{)n{GyN%15pRRATsDz(84oN^i`=C(Q1 z$QoNSyJV2kKjul2tNAyO=Dw;#U1$}dLr}yxTSsn!Y7I6t?Uzu*SJ#L}Vc<-*DO^QF zS3k@eU2xLyV&#L@(%$kxemSZb$^;NtsiWY22c+t(1@ofchw8h;yp6IhB79ge`8rku zK%)%XOc8TnM;e5aW&AF!7_KEA@ab8~O$-+8xl*F!_RdsWdkcdfX66<*Z~A-l@p?^9#ABGoU0QLsSL z424?@X*S@LMV!?lo$Y$FA7r#8K4btxg2YfexKARK`9PsCu393j^MX~Kq~!(8*1=4R zu3Tz2|9`n8QGiKOk40C4m-lX$rDY!6I-r5YNU5o6?VDY{z9`Yhg>E(6r!yjX{>t7p zlrQp5MhIW!iHZ^Jz3LOqMm=u8fhqFaoUVUSsM?KSLaH8|q(0Gd`W9Wu80=k=#Vr>4 zrz$3X>BQ>^M(OJFyR9-v8p<8X8EFtTH~VY oFJUB#@cS1msL^AtQO8(aowi&&zPFgMx&*IjOS-zGYZZ\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-KeywordsList: i18n\n" +"X-Generator: Poedit 1.5.4\n" +"X-Poedit-SearchPath-0: mod_rewrite\n" + +#: includes/include.mod_rewrite_content.php:177 +msgid "Version" +msgstr "Version" + +#: includes/include.mod_rewrite_content.php:178 +msgid "Author" +msgstr "Autor" + +#: includes/include.mod_rewrite_content.php:179 +msgid "E-Mail to author" +msgstr "E-Mail an Autor" + +#: includes/include.mod_rewrite_content.php:180 +msgid "Plugin page" +msgstr "Pluginseite" + +#: includes/include.mod_rewrite_content.php:181 +msgid "Visit plugin page" +msgstr "Pluginseite besuchen" + +#: includes/include.mod_rewrite_content.php:182 +msgid "opens page in new window" +msgstr "öffnet Seite in einem neuen Fenster" + +#: includes/include.mod_rewrite_content.php:183 +msgid "CONTENIDO forum" +msgstr "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:185 +msgid "Plugin settings" +msgstr "Plugineinstellungen" + +#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_contentexpert.php:87 +msgid "Note" +msgstr "Hinweis" + +#: 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 " +"area, if needed." +msgstr "" +"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: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: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 " +"defined rewrite rules could remain in the .htaccess and they will not " +"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." + +#: includes/include.mod_rewrite_content.php:199 +msgid "Example" +msgstr "Beispiel" + +#: includes/include.mod_rewrite_content.php:201 +msgid "" +"# enable apache mod rewrite module\n" +"RewriteEngine on\n" +"\n" +"# disable apache mod rewrite module\n" +"RewriteEngine off" +msgstr "" +"# aktivieren des apache mod rewrite moduls\n" +"RewriteEngine on\n" +"\n" +"# deaktivieren des apache mod rewrite moduls\n" +"RewriteEngine off" + +#: 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: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/')" +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 -> " +"Pfad = '/mycontenido/')." + +#: includes/include.mod_rewrite_content.php:206 +msgid "Check path to .htaccess" +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 "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:210 +msgid "Start from root category" +msgstr "Start vom Hauptbaum aus" + +#: 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." +msgstr "" +"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:213 +msgid "Are several clients maintained in one directory?" +msgstr "Werden mehrere Mandanten in einem Verzeichnis gepflegt?" + +#: 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:215 +msgid "Use client name instead of the id" +msgstr "Name des Mandanten anstatt die Id verwenden" + +#: 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 " +"unabdingbar)?" + +#: 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:219 +msgid "Use language name instead of the id" +msgstr "Name der Sprache anstatt die Id verwenden" + +#: includes/include.mod_rewrite_content.php:221 +msgid "" +"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." + +#: includes/include.mod_rewrite_content.php:222 +msgid "" +"www.domain.com/category1-category2.articlename.html\n" +"www.domain.com/category1/category2-articlename.html\n" +"www.domain.com/category.name1~category2~articlename.html\n" +"www.domain.com/category_name1-category2-articlename.foo" +msgstr "" +"www.domain.de/kategorie1-kategorie2.artikelname.html\n" +"www.domain.de/kategorie1/kategorie2-artikelname.html\n" +"www.domain.de/kategorie.name1~kategorie2~artikelname.html\n" +"www.domain.de/kategorie_name1-kategorie2-artikelname.foo" + +#: 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" + +#: includes/include.mod_rewrite_content.php:224 +msgid "" +"# Example: Category separator (/) and category-word separator (_)\n" +"category_one/category_two/articlename.html" +msgstr "" +"# Beispiel: Kategorie-Separator (/) und Kategoriewort-Separator (_)\n" +"kategorie_eins/kategorie_zwei/artikelname.html" + +#: 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" + +#: includes/include.mod_rewrite_content.php:226 +msgid "" +"# Example: Category separator (/) and article-word separator (-)\n" +"category_one/category_two/article-description.html" +msgstr "" +"# Beispiel: Kategorie-Separator (/) und Artikelwort-Separator (-)\n" +"kategorie_eins/kategorie_zwei/artikel-bezeichnung.html" + +#: 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" + +#: 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 "" +"# Beispiel: Kategorie-Artikel-Separator (/) und Artikelwort-Separator (-)\n" +"kategorie_eins/kategorie_zwei/artikel-bezeichnung.html" + +#: 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:231 +#: includes/include.mod_rewrite_content.php:232 +#, php-format +msgid "(possible values: %s)" +msgstr "(mögliche Werte: %s)" + +#: includes/include.mod_rewrite_content.php:233 +msgid "Category-word separator (delemiter between category words)" +msgstr "Kategoriewort-Separator (Trenner zwischen einzelnen Kategoriewörtern)" + +#: 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:235 +msgid "Article-word separator (delemiter between article words)" +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 "Default article name without extension" +msgstr "Standard-Artikelname ohne Dateiendung" + +#: 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" +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." + +#: 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:243 +msgid "" +"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" + +#: 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." +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." + +#: 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 "" +"Aufgrund diverser Probleme, die noch nicht in dieser Version gelöst " +"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:247 +msgid "Should the URLs be written in lower case?" +msgstr "Sollen die URLs klein geschrieben werden?" + +#: includes/include.mod_rewrite_content.php:248 +msgid "URLs in lower case" +msgstr "URLs in Kleinbuchstaben" + +#: includes/include.mod_rewrite_content.php:250 +msgid "Duplicated content" +msgstr "Duplicated Content" + +#: includes/include.mod_rewrite_content.php:251 +msgid "Prevent duplicated content" +msgstr "Duplicated Content verhindern" + +#: 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" +msgstr "" +"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: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/" + +#: includes/include.mod_rewrite_content.php:257 +msgid "Percentage for similar category paths in URLs" +msgstr "Prozentsatz für ähnliche Kategorie-Pfade in URLs" + +#: 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.
    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." + +#: 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" +"85 = pfade mit kleineren fehlern ergeben auch treffern\n" +"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 "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:265 +msgid "Moment of URL generation" +msgstr "Zeitpunkt zum Generieren der URLs" + +#: 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: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 " +"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." + +#: includes/include.mod_rewrite_content.php:268 +msgid "Differences to variant b.)" +msgstr "Unterschiede zur Variante b.)" + +#: 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." +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" +"Alle umzuschreibenden URLs werden in der Regel \"gesammelt\" und auf eimmal " +"umgeschreiben,
    dadurch wird die Anzahl der DB-Abfragen sehr stark " +"minimiert" + +#: 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: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:" +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:" + +#: 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" +"# 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 "" +"# 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" +"# 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:275 +msgid "Differences to variant a.)" +msgstr "Unterschiede zur Variante a.)" + +#: 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 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" + +#: includes/include.mod_rewrite_content.php:279 +msgid "Routing" +msgstr "Routing" + +#: includes/include.mod_rewrite_content.php:280 +msgid "Routing definitions for incoming URLs" +msgstr "Routing Definitionen für eingehende URLs" + +#: 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:282 +msgid "" +"# {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" +msgstr "" +"# {eingehende_url}>>>{neue_url}\n" +"/eingehende_url/name.html>>>neue_url/neuer_name.html\n" +"\n" +"# bestimmte eingehende url zur einer seite weiterleiten\n" +"/aktionen/20_prozent_auf_alles_ausser_tiernahrung.html>>>front_content.php?" +"idcat=23\n" +"\n" +"# request zum wwwroot auf eine bestimmte seite routen\n" +"/>>>front_content.php?idart=16" + +#: 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" +"Incoming URLs can point to non existing resources (category/article), but " +"the desttination URLs should point
    to valid CONTENIDO articles/" +"categories\n" +"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 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" +"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" +"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" +"Bei mehreren Mandanten im gleichen Verzeichnis sollte die Id des Mandanten " +"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:286 +#: includes/include.mod_rewrite_contentexpert.php:90 +msgid "Discard changes" +msgstr "Änderungen verwerfen" + +#: includes/include.mod_rewrite_content.php:287 +#: includes/include.mod_rewrite_contentexpert.php:91 +msgid "Save changes" +msgstr "Änderungen speichern" + +#: includes/include.mod_rewrite_contenttest.php:55 +msgid "" +"Define options to genereate the URLs by using the form below and run the " +"test." +msgstr "" +"Optionen zum Generieren der URLs im folgenden Formular setzen und den Test " +"starten." + +#: includes/include.mod_rewrite_contenttest.php:56 +msgid "Parameter to use" +msgstr "Zu verwendende Parameter" + +#: 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:58 +msgid "Run test" +msgstr "Test starten" + +#: includes/include.mod_rewrite_contenttest.php:60 +msgid "" +"{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}
    {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:62 +msgid "" +"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.
    Anzahl verarbeiteter URLs: " +"{num_urls}
    Erfolgreich aufgelöst: {num_success}" +"
    Fehler beim Auflösen: {num_fail}" + +#: includes/include.mod_rewrite_contentexpert.php:61 +msgid "Plugin functions" +msgstr "Plugin Funktionen" + +#: includes/include.mod_rewrite_contentexpert.php:63 +msgid "Copy/Download .htaccess template" +msgstr ".htaccess Vorlage kopieren/downloaden" + +#: includes/include.mod_rewrite_contentexpert.php:64 +msgid "Select .htaccess template" +msgstr ".htaccess Vorlage auswählen" + +#: includes/include.mod_rewrite_contentexpert.php:65 +msgid "Restrictive .htaccess" +msgstr "Restriktive .htaccess" + +#: includes/include.mod_rewrite_contentexpert.php:66 +msgid "Simple .htaccess" +msgstr "Einfache .htaccess" + +#: includes/include.mod_rewrite_contentexpert.php:67 +msgid "" +"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 " +"Ressource, die vom Umschreiben ausgeschlossen werden soll, muss explizit " +"definiert werden." + +#: includes/include.mod_rewrite_contentexpert.php:69 +msgid "" +"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." + +#: includes/include.mod_rewrite_contentexpert.php:71 +msgid "and copy to" +msgstr "und kopieren in" + +#: includes/include.mod_rewrite_contentexpert.php:72 +msgid "CONTENIDO installation directory" +msgstr "das CONTENIDO Installationsverzeichnis" + +#: includes/include.mod_rewrite_contentexpert.php:73 +msgid "" +"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" +"mehreren Mandanten, die alle unter der gleichen Domain laufen." + +#: includes/include.mod_rewrite_contentexpert.php:75 +msgid "client directory" +msgstr "das Mandantenverzeichnis" + +#: includes/include.mod_rewrite_contentexpert.php:76 +msgid "" +"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." + +#: includes/include.mod_rewrite_contentexpert.php:78 +msgid "or" +msgstr "oder" + +#: includes/include.mod_rewrite_contentexpert.php:79 +msgid "Download" +msgstr "Downloaden" + +#: includes/include.mod_rewrite_contentexpert.php:80 +msgid "" +"Download selected .htaccess template to copy it to the destination " +"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." + +#: includes/include.mod_rewrite_contentexpert.php:82 +msgid "Reset category-/ and article aliases" +msgstr "Kategorie-/ und Artikel-Aliase zurücksetzen" + +#: includes/include.mod_rewrite_contentexpert.php:83 +msgid "Reset only empty aliases" +msgstr "Nur leere Aliase zurücksetzen" + +#: 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." + +#: includes/include.mod_rewrite_contentexpert.php:85 +msgid "Reset all aliases" +msgstr "Alle Aliase zurücksetzen" + +#: 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." + +#: includes/include.mod_rewrite_contentexpert.php:88 +msgid "" +"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." +msgstr "" +"Dieser Prozess kann je nach Anzahl der Kategorien/Artikel etwas Zeit in " +"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." + +#: 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/locale/mod_rewrite.pot b/locale/mod_rewrite.pot new file mode 100644 index 0000000..7a90803 --- /dev/null +++ b/locale/mod_rewrite.pot @@ -0,0 +1,744 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \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" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: includes/include.mod_rewrite_content.php:177 +msgid "Version" +msgstr "" + +#: includes/include.mod_rewrite_content.php:178 +msgid "Author" +msgstr "" + +#: includes/include.mod_rewrite_content.php:179 +msgid "E-Mail to author" +msgstr "" + +#: includes/include.mod_rewrite_content.php:180 +msgid "Plugin page" +msgstr "" + +#: includes/include.mod_rewrite_content.php:181 +msgid "Visit plugin page" +msgstr "" + +#: includes/include.mod_rewrite_content.php:182 +msgid "opens page in new window" +msgstr "" + +#: includes/include.mod_rewrite_content.php:183 +msgid "CONTENIDO forum" +msgstr "" + +#: includes/include.mod_rewrite_content.php:184 +msgid "Plugin thread in CONTENIDO forum" +msgstr "" + +#: includes/include.mod_rewrite_content.php:185 +msgid "Plugin settings" +msgstr "" + +#: includes/include.mod_rewrite_content.php:186 +#: includes/include.mod_rewrite_contentexpert.php:87 +msgid "Note" +msgstr "" + +#: 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 " +"area, if needed." +msgstr "" + +#: 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: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 " +"defined rewrite rules could remain in the .htaccess and they will not " +"processed,
    if the mod rewrite module is disabled" +msgstr "" + +#: includes/include.mod_rewrite_content.php:199 +msgid "Example" +msgstr "" + +#: includes/include.mod_rewrite_content.php:201 +msgid "" +"# enable apache mod rewrite module\n" +"RewriteEngine on\n" +"\n" +"# disable apache mod rewrite module\n" +"RewriteEngine off" +msgstr "" + +#: includes/include.mod_rewrite_content.php:203 +msgid "Path to .htaccess from DocumentRoot" +msgstr "" + +#: 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/')" +msgstr "" + +#: includes/include.mod_rewrite_content.php:206 +msgid "Check path to .htaccess" +msgstr "" + +#: 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 "" + +#: 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:210 +msgid "Start from root category" +msgstr "" + +#: 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." +msgstr "" + +#: includes/include.mod_rewrite_content.php:213 +msgid "Are several clients maintained in one directory?" +msgstr "" + +#: includes/include.mod_rewrite_content.php:214 +msgid "Prepend client to the URL" +msgstr "" + +#: includes/include.mod_rewrite_content.php:215 +msgid "Use client name instead of the id" +msgstr "" + +#: 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:218 +msgid "Prepend language to the URL" +msgstr "" + +#: includes/include.mod_rewrite_content.php:219 +msgid "Use language name instead of the id" +msgstr "" + +#: includes/include.mod_rewrite_content.php:221 +msgid "" +"Configure your own separators with following 4 settings
    to control " +"generated URLs to your own taste" +msgstr "" + +#: includes/include.mod_rewrite_content.php:222 +msgid "" +"www.domain.com/category1-category2.articlename.html\n" +"www.domain.com/category1/category2-articlename.html\n" +"www.domain.com/category.name1~category2~articlename.html\n" +"www.domain.com/category_name1-category2-articlename.foo" +msgstr "" + +#: 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:224 +msgid "" +"# Example: Category separator (/) and category-word separator (_)\n" +"category_one/category_two/articlename.html" +msgstr "" + +#: 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:226 +msgid "" +"# Example: Category separator (/) and article-word separator (-)\n" +"category_one/category_two/article-description.html" +msgstr "" + +#: 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: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:230 +msgid "Category separator (delemiter between single categories)" +msgstr "" + +#: 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:233 +msgid "Category-word separator (delemiter between category words)" +msgstr "" + +#: includes/include.mod_rewrite_content.php:234 +msgid "" +"Category-article separator (delemiter between category-block and article)" +msgstr "" + +#: includes/include.mod_rewrite_content.php:235 +msgid "Article-word separator (delemiter between article words)" +msgstr "" + +#: includes/include.mod_rewrite_content.php:237 +msgid "Append article name to URLs" +msgstr "" + +#: 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:239 +msgid "Default article name without extension" +msgstr "" + +#: 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" +msgstr "" + +#: includes/include.mod_rewrite_content.php:242 +msgid "File extension at the end of the URL" +msgstr "" + +#: includes/include.mod_rewrite_content.php:243 +msgid "" +"Specification of file extension with a preceded dot
    e.g. '.html' for " +"http://host/foo/bar.html" +msgstr "" + +#: 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." +msgstr "" + +#: 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:247 +msgid "Should the URLs be written in lower case?" +msgstr "" + +#: includes/include.mod_rewrite_content.php:248 +msgid "URLs in lower case" +msgstr "" + +#: includes/include.mod_rewrite_content.php:250 +msgid "Duplicated content" +msgstr "" + +#: includes/include.mod_rewrite_content.php:251 +msgid "Prevent duplicated content" +msgstr "" + +#: 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" +msgstr "" + +#: 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 "" + +#: includes/include.mod_rewrite_content.php:257 +msgid "Percentage for similar category paths in URLs" +msgstr "" + +#: 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.
    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: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:261 +msgid "Redirect in case of invalid articles" +msgstr "" + +#: includes/include.mod_rewrite_content.php:262 +msgid "Redirect to error page in case of invaid articles" +msgstr "" + +#: 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:265 +msgid "Moment of URL generation" +msgstr "" + +#: 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: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 " +"will be replaced by the plugin to Clean-URLs before sending the HTML output." +msgstr "" + +#: includes/include.mod_rewrite_content.php:268 +msgid "Differences to variant b.)" +msgstr "" + +#: 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." +msgstr "" + +#: includes/include.mod_rewrite_content.php:272 +msgid "b.) In modules or plugins" +msgstr "" + +#: 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:" +msgstr "" + +#: 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" +"# 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:275 +msgid "Differences to variant a.)" +msgstr "" + +#: 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 UriBuilder\n" +"Each generated Clean-Url requires a database query" +msgstr "" + +#: includes/include.mod_rewrite_content.php:279 +msgid "Routing" +msgstr "" + +#: includes/include.mod_rewrite_content.php:280 +msgid "Routing definitions for incoming URLs" +msgstr "" + +#: includes/include.mod_rewrite_content.php:281 +msgid "Type one routing definition per line as follows:" +msgstr "" + +#: includes/include.mod_rewrite_content.php:282 +msgid "" +"# {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" +msgstr "" + +#: 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" +"Incoming URLs can point to non existing resources (category/article), but " +"the desttination URLs should point
    to valid CONTENIDO articles/" +"categories\n" +"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 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" +"The destination URL should not start with '/' or './' (wrong: /front_content." +"php, correct: front_content.php)" +msgstr "" + +#: includes/include.mod_rewrite_content.php:286 +#: includes/include.mod_rewrite_contentexpert.php:90 +msgid "Discard changes" +msgstr "" + +#: includes/include.mod_rewrite_content.php:287 +#: includes/include.mod_rewrite_contentexpert.php:91 +msgid "Save changes" +msgstr "" + +#: 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:56 +msgid "Parameter to use" +msgstr "" + +#: includes/include.mod_rewrite_contenttest.php:57 +msgid "Number of URLs to generate" +msgstr "" + +#: includes/include.mod_rewrite_contenttest.php:58 +msgid "Run test" +msgstr "" + +#: includes/include.mod_rewrite_contenttest.php:60 +msgid "" +"{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:62 +msgid "" +"Duration of test run: {time} seconds.
    Number of processed URLs: {num_urls}" +"
    Successful resolved: {num_success}
    Errors during resolving: {num_fail}" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:61 +msgid "Plugin functions" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:63 +msgid "Copy/Download .htaccess template" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:64 +msgid "Select .htaccess template" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:65 +msgid "Restrictive .htaccess" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:66 +msgid "Simple .htaccess" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:67 +msgid "" +"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:69 +msgid "" +"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:71 +msgid "and copy to" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:72 +msgid "CONTENIDO installation directory" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:73 +msgid "" +"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:75 +msgid "client directory" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:76 +msgid "" +"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:78 +msgid "or" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:79 +msgid "Download" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:80 +msgid "" +"Download selected .htaccess template to copy it to the destination " +"folder
    or to take over the settings manually." +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:82 +msgid "Reset category-/ and article aliases" +msgstr "" + +#: includes/include.mod_rewrite_contentexpert.php:83 +msgid "Reset only empty aliases" +msgstr "" + +#: 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:85 +msgid "Reset all aliases" +msgstr "" + +#: 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:88 +msgid "" +"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." +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/locale/potfiles.txt b/locale/potfiles.txt new file mode 100644 index 0000000..99d35d7 --- /dev/null +++ b/locale/potfiles.txt @@ -0,0 +1,24 @@ +./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/class.modrewritedebugger.php +./classes/class.modrewritetest.php +./classes/class.modrewrite.php +./classes/class.modrewriteurlstack.php +./classes/class.modrewritebase.php +./classes/class.modrewritecontroller.php +./classes/class.modrewriteurlutil.php diff --git a/scripts/mod_rewrite.js b/scripts/mod_rewrite.js new file mode 100644 index 0000000..521a65f --- /dev/null +++ b/scripts/mod_rewrite.js @@ -0,0 +1,96 @@ +/** + * 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: mod_rewrite.js 128 2019-07-03 11:58:28Z 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").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/styles/styles.css b/styles/styles.css new file mode 100644 index 0000000..e0a1734 --- /dev/null +++ b/styles/styles.css @@ -0,0 +1,101 @@ +/** + * 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: styles.css 128 2019-07-03 11:58:28Z 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;} +.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/templates/content.html b/templates/content.html new file mode 100644 index 0000000..fb5fb68 --- /dev/null +++ b/templates/content.html @@ -0,0 +1,368 @@ + + + + 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/templates/content_top.html b/templates/content_top.html new file mode 100644 index 0000000..dfcdf35 --- /dev/null +++ b/templates/content_top.html @@ -0,0 +1,36 @@ + + + + mod_rewrite_content_menu_top + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/templates/contentexpert.html b/templates/contentexpert.html new file mode 100644 index 0000000..c30c08c --- /dev/null +++ b/templates/contentexpert.html @@ -0,0 +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} + + + \ No newline at end of file diff --git a/templates/contenttest.html b/templates/contenttest.html new file mode 100644 index 0000000..972e815 --- /dev/null +++ b/templates/contenttest.html @@ -0,0 +1,63 @@ + + + + mod_rewrite_content_test + + + + + + + + + + + + +
    +

    {LNG_FORM_INFO}

    +

    + + + +
    + {LNG_FORM_LABEL} +

    +
    + +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    + +{CONTENT} + + + diff --git a/xml/lang_de_DE.xml b/xml/lang_de_DE.xml new file mode 100644 index 0000000..284d0fc --- /dev/null +++ b/xml/lang_de_DE.xml @@ -0,0 +1,14 @@ + + + + + + +
    AMR
    + Einstellungen + Funktionen + Test +
    +
    +
    +
    \ No newline at end of file diff --git a/xml/lang_en_US.xml b/xml/lang_en_US.xml new file mode 100644 index 0000000..e762395 --- /dev/null +++ b/xml/lang_en_US.xml @@ -0,0 +1,14 @@ + + + + + + +
    AMR
    + Settings + Functions + Test +
    +
    +
    +
    \ No newline at end of file