update amr to version from latest contenido 4.8
Dieser Commit ist enthalten in:
Ursprung
d19abbaa0d
Commit
520f406556
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
|
@ -1,35 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR base Mod Rewrite class
|
||||
*
|
||||
* Description:
|
||||
* Includes base mod rewrite class.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-09-24
|
||||
*
|
||||
* $Id: class.modrewritebase.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
/**
|
||||
* Abstract base mod rewrite class.
|
||||
|
@ -38,42 +24,45 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
* access for childs.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package Contenido Backend plugins
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
abstract class ModRewriteBase
|
||||
{
|
||||
abstract class ModRewriteBase {
|
||||
|
||||
/**
|
||||
* Initialization, is to call at least once by an child.
|
||||
* @deprecated
|
||||
*/
|
||||
protected static function initialize() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns enabled state of mod rewrite plugin
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function isEnabled()
|
||||
{
|
||||
public static function isEnabled() {
|
||||
return (self::getConfig('use', 0) == 1) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the enabled state of mod rewrite plugin
|
||||
*
|
||||
* @pparam bool $bEnabled
|
||||
* @param bool $bEnabled
|
||||
*/
|
||||
public static function setEnabled($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)
|
||||
{
|
||||
public static function getConfig($key = null, $default = null) {
|
||||
global $cfg;
|
||||
if ($key == null) {
|
||||
return $cfg['mod_rewrite'];
|
||||
|
@ -90,8 +79,7 @@ abstract class ModRewriteBase
|
|||
* @param string $key Name of configuration key
|
||||
* @param mixed $value The value to set
|
||||
*/
|
||||
public static function setConfig($key, $value)
|
||||
{
|
||||
public static function setConfig($key, $value) {
|
||||
global $cfg;
|
||||
$cfg['mod_rewrite'][$key] = $value;
|
||||
}
|
||||
|
|
|
@ -1,35 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR controller class
|
||||
*
|
||||
* Description:
|
||||
* Includes Mod Rewrite controller class.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-04-16
|
||||
*
|
||||
* $Id: class.modrewritecontroller.php 211 2013-01-25 09:30:14Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
/**
|
||||
* Mod Rewrite controller class. Extracts url parts and sets some necessary globals like:
|
||||
|
@ -41,11 +27,18 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
* - $changelang
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package Contenido Backend plugins
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewriteController extends ModRewriteBase
|
||||
{
|
||||
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 '/'
|
||||
|
@ -89,6 +82,13 @@ class ModRewriteController extends ModRewriteBase
|
|||
*/
|
||||
private $_iClientMR;
|
||||
|
||||
/**
|
||||
* Language id used by this class
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_iLangMR;
|
||||
|
||||
/**
|
||||
* Flag about occured errors
|
||||
*
|
||||
|
@ -96,6 +96,13 @@ class ModRewriteController extends ModRewriteBase
|
|||
*/
|
||||
private $_bError = false;
|
||||
|
||||
/**
|
||||
* One of ERROR_* constants or 0
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $_iError = 0;
|
||||
|
||||
/**
|
||||
* Flag about found routing definition
|
||||
*
|
||||
|
@ -103,128 +110,122 @@ class ModRewriteController extends ModRewriteBase
|
|||
*/
|
||||
private $_bRoutingFound = false;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor, sets several properties.
|
||||
*
|
||||
* @param string $incommingUrl Incomming URL
|
||||
*/
|
||||
public function __construct($incommingUrl)
|
||||
{
|
||||
$this->_sIncommingUrl = $incommingUrl;
|
||||
$this->_aParts = array();
|
||||
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()
|
||||
{
|
||||
public function getClient() {
|
||||
return $GLOBALS['client'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for overwritten change client id (see $GLOBALS['changeclient'])
|
||||
*
|
||||
* @return int Change client id
|
||||
*/
|
||||
public function getChangeClient()
|
||||
{
|
||||
public function getChangeClient() {
|
||||
return $GLOBALS['changeclient'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for article id (see $GLOBALS['idart'])
|
||||
*
|
||||
* @return int Article id
|
||||
*/
|
||||
public function getIdArt()
|
||||
{
|
||||
public function getIdArt() {
|
||||
return $GLOBALS['idart'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for category id (see $GLOBALS['idcat'])
|
||||
*
|
||||
* @return int Category id
|
||||
*/
|
||||
public function getIdCat()
|
||||
{
|
||||
public function getIdCat() {
|
||||
return $GLOBALS['idcat'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for language id (see $GLOBALS['lang'])
|
||||
*
|
||||
* @return int Language id
|
||||
*/
|
||||
public function getLang()
|
||||
{
|
||||
public function getLang() {
|
||||
return $GLOBALS['lang'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for change language id (see $GLOBALS['change_lang'])
|
||||
* Getter for change language id (see $GLOBALS['changelang'])
|
||||
*
|
||||
* @return int Change language id
|
||||
*/
|
||||
public function getChangeLang()
|
||||
{
|
||||
return $GLOBALS['change_lang'];
|
||||
public function getChangeLang() {
|
||||
return $GLOBALS['changelang'];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for path (see $GLOBALS['path'])
|
||||
*
|
||||
* @return string Path, used by path resolver
|
||||
*/
|
||||
public function getPath()
|
||||
{
|
||||
public function getPath() {
|
||||
return $this->_sPath;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for resolved url
|
||||
*
|
||||
* @return string Resolved url
|
||||
*/
|
||||
public function getResolvedUrl()
|
||||
{
|
||||
public function getResolvedUrl() {
|
||||
return $this->_sResolvedUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns a flag about found routing definition
|
||||
*
|
||||
* return bool Flag about found routing
|
||||
*/
|
||||
public function getRoutingFoundState()
|
||||
{
|
||||
public function getRoutingFoundState() {
|
||||
return $this->_bRoutingFound;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Getter for occured error state
|
||||
*
|
||||
* @return bool Flag for occured error
|
||||
*/
|
||||
public function errorOccured()
|
||||
{
|
||||
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.
|
||||
|
@ -232,8 +233,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
* Executes some private functions to extract request URI and to set needed membervariables
|
||||
* (client, language, article id, category id, etc.)
|
||||
*/
|
||||
public function execute()
|
||||
{
|
||||
public function execute() {
|
||||
if (parent::isEnabled() == false) {
|
||||
return;
|
||||
}
|
||||
|
@ -260,19 +260,25 @@ class ModRewriteController extends ModRewriteBase
|
|||
$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)
|
||||
{
|
||||
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($_SERVER['REQUEST_URI'], $this->_sIncommingUrl) === 0) {
|
||||
if (parent::getConfig('rootdir') !== '/' && strpos($requestUri, $this->_sIncommingUrl) === 0) {
|
||||
$this->_sIncommingUrl = str_replace(parent::getConfig('rootdir'), '/', $this->_sIncommingUrl);
|
||||
}
|
||||
|
||||
|
@ -285,12 +291,11 @@ class ModRewriteController extends ModRewriteBase
|
|||
if ($secondCall == true) {
|
||||
|
||||
// @todo: implement real redirect of old front_content.php style urls
|
||||
|
||||
// check for routing definition
|
||||
$routings = parent::getConfig('routing');
|
||||
if (is_array($routings) && isset($routings[$aUrlComponents['path']])) {
|
||||
$aUrlComponents['path'] = $routings[$aUrlComponents['path']];
|
||||
if (strpos($aUrlComponents['path'], 'front_content.php') !== false) {
|
||||
if (strpos($aUrlComponents['path'], self::FRONT_CONTENT) !== false) {
|
||||
// routing destination contains front_content.php
|
||||
|
||||
$this->_bRoutingFound = true;
|
||||
|
@ -305,6 +310,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
|
||||
// add query parameter to superglobal _GET
|
||||
if (isset($aUrlComponents['query'])) {
|
||||
$vars = null;
|
||||
parse_str($aUrlComponents['query'], $vars);
|
||||
$_GET = array_merge($_GET, $vars);
|
||||
}
|
||||
|
@ -315,7 +321,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
return;
|
||||
}
|
||||
}
|
||||
$sPath = (parent::getConfig('use_lowercase_uri') == true)?strtolower($aUrlComponents['path']):$aUrlComponents['path'];
|
||||
|
||||
$aPaths = explode('/', $aUrlComponents['path']);
|
||||
foreach ($aPaths as $p => $item) {
|
||||
if (!empty($item)) {
|
||||
|
@ -324,7 +330,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
$count = count($arr);
|
||||
if ($count > 0 && '.' . strtolower($arr[$count - 1]) == parent::getConfig('file_extension')) {
|
||||
array_pop($arr);
|
||||
$this->_sArtName = implode('.', $arr);
|
||||
$this->_sArtName = trim(implode('.', $arr));
|
||||
} else {
|
||||
$this->_aParts[] = $item;
|
||||
}
|
||||
|
@ -337,37 +343,24 @@ class ModRewriteController extends ModRewriteBase
|
|||
mr_loadConfiguration($this->_iClientMR);
|
||||
$this->_setLanguageId();
|
||||
}
|
||||
|
||||
}
|
||||
ModRewriteDebugger::add($this->_aParts, 'ModRewriteController::_extractRequestUri() $this->_aParts');
|
||||
|
||||
// loop parts array and remove existing 'front_content.php'
|
||||
if ($this->_hasPartArrayItems()) {
|
||||
foreach ($this->_aParts as $p => $item) {
|
||||
if ($item == 'front_content.php') {
|
||||
if ($item == self::FRONT_CONTENT) {
|
||||
unset($this->_aParts[$p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// set parts property top null, if needed
|
||||
if ($this->_hasPartArrayItems() == false) {
|
||||
$this->_aParts = null;
|
||||
}
|
||||
|
||||
// set artname to null if needed
|
||||
if (!isset($this->_sArtName) || empty($this->_sArtName) || strlen($this->_sArtName) == 0) {
|
||||
$this->_sArtName = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Tries to initialize the client id
|
||||
* Tries to initialize the client id.
|
||||
* This is required to load the proper plugin configuration for current client.
|
||||
*/
|
||||
private function _initializeClientId()
|
||||
{
|
||||
private function _initializeClientId() {
|
||||
global $client, $changeclient, $load_client;
|
||||
|
||||
$iClient = (isset($client) && (int) $client > 0) ? $client : 0;
|
||||
|
@ -389,73 +382,108 @@ class ModRewriteController extends ModRewriteBase
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets client id
|
||||
* Detects client id from given url
|
||||
*/
|
||||
private function _setClientId()
|
||||
{
|
||||
global $client, $changeclient, $load_client;
|
||||
private function _setClientId() {
|
||||
global $client;
|
||||
|
||||
if ($this->_hasPartArrayItems() == false || parent::getConfig('use_client') !== 1) {
|
||||
if ($this->_bError) {
|
||||
return;
|
||||
} elseif ($this->_isRootRequest()) {
|
||||
// request to root
|
||||
return;
|
||||
} elseif (parent::getConfig('use_client') !== 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
$iClient = (isset($client) && (int) $client > 0) ? $client : 0;
|
||||
$iLoadClient = (isset($load_client) && (int) $load_client > 0) ? $load_client : 0;
|
||||
|
||||
if (parent::getConfig('use_client_name') == 1) {
|
||||
$changeclient = ModRewrite::getClientId(array_shift($this->_aParts));
|
||||
$this->_iClientMR = $changeclient;
|
||||
$detectedClientId = (int) ModRewrite::getClientId(array_shift($this->_aParts));
|
||||
} else {
|
||||
$changeclient = (int) array_shift($this->_aParts);
|
||||
$this->_iClientMR = $changeclient;
|
||||
}
|
||||
|
||||
if (empty($changeclient) || (int) $changeclient <= 0) {
|
||||
$changeclient = $iLoadClient;
|
||||
}
|
||||
if ($iClient > 0 && $changeclient !== $iClient) {
|
||||
// overwrite existing client variable
|
||||
$this->_iClientMR = $changeclient;
|
||||
$client = $changeclient;
|
||||
$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, $changelang;
|
||||
private function _setLanguageId() {
|
||||
global $lang;
|
||||
|
||||
if ($this->_hasPartArrayItems() == false || parent::getConfig('use_language') !== 1) {
|
||||
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
|
||||
$changelang = ModRewrite::getLanguageId(array_shift($this->_aParts) , $this->_iClientMR);
|
||||
$languageName = array_shift($this->_aParts);
|
||||
$detectedLanguageId = (int) ModRewrite::getLanguageId($languageName, $this->_iClientMR);
|
||||
} else {
|
||||
$changelang = (int) array_shift($this->_aParts);
|
||||
}
|
||||
|
||||
if ((int) $changelang > 0) {
|
||||
$lang = $changelang;
|
||||
$changelang = $changelang;
|
||||
$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()
|
||||
{
|
||||
private function _setPathresolverSetting() {
|
||||
global $client, $lang, $load_lang, $idcat;
|
||||
|
||||
if ($this->_hasPartArrayItems() == false) {
|
||||
if ($this->_bError) {
|
||||
return;
|
||||
} elseif (!$this->_hasPartArrayItems()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -481,7 +509,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
|
||||
if ($idcat == 0) {
|
||||
// category couldn't resolved
|
||||
$this->_bError = true;
|
||||
$this->_setError(self::ERROR_CATEGORY);
|
||||
$idcat = null;
|
||||
} else {
|
||||
// unset $this->_sPath if $idcat could set, otherwhise it would be resolved again.
|
||||
|
@ -492,66 +520,73 @@ class ModRewriteController extends ModRewriteBase
|
|||
ModRewriteDebugger::add($this->_sPath, 'ModRewriteController->_setPathresolverSetting $this->_sPath');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets article id
|
||||
*/
|
||||
private function _setIdart()
|
||||
{
|
||||
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') && isset($this->_sArtName)) {
|
||||
if ($this->_sArtName == parent::getConfig('default_startart_name')) {
|
||||
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
|
||||
$this->_sArtName = null;
|
||||
$currArtName = '';
|
||||
}
|
||||
}
|
||||
|
||||
$idcat = (isset($idcat) && (int) $idcat > 0) ? $idcat : null;
|
||||
$idart = (isset($idart) && (int) $idart > 0) ? $idart : null;
|
||||
// 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 ($idcat !== null && $this->_sArtName && $idart == null) {
|
||||
// existing idcat with article name and no idart
|
||||
$idart = ModRewrite::getArtIdByWebsafeName($this->_sArtName, $idcat, $lang);
|
||||
} elseif ($idcat > 0 && $this->_sArtName == null && $idart == null) {
|
||||
|
||||
if (parent::getConfig('add_startart_name_to_url') && parent::getConfig('default_startart_name') == '') {
|
||||
|
||||
// existing idcat without article name and idart
|
||||
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()) {
|
||||
$idart = $artItem->get('idart');
|
||||
$detectedIdart = (int) $artItem->get('idart');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} elseif ($idcat == null && $idart == null && isset($this->_sArtName)) {
|
||||
} elseif ($iIdCat == 0 && $iIdArt == 0 && !empty($currArtName)) {
|
||||
// no idcat and idart but article name
|
||||
$idart = ModRewrite::getArtIdByWebsafeName($this->_sArtName);
|
||||
$detectedIdart = (int) ModRewrite::getArtIdByWebsafeName($currArtName, $iIdCat, $lang);
|
||||
}
|
||||
|
||||
if ($idart !== null && (!$idart || (int) $idart == 0)) {
|
||||
if (parent::getConfig('redirect_invalid_article_to_errorsite') == 1) {
|
||||
$this->_bError = true;
|
||||
$idart = null;
|
||||
}
|
||||
if ($detectedIdart > 0) {
|
||||
$idart = $detectedIdart;
|
||||
} elseif (!empty($currArtName)) {
|
||||
$this->_setError(self::ERROR_ARTICLE);
|
||||
}
|
||||
|
||||
ModRewriteDebugger::add($idart, 'ModRewriteController->_setIdart $idart');
|
||||
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()
|
||||
{
|
||||
private function _postValidation() {
|
||||
global $idcat, $idart, $client;
|
||||
|
||||
if ($this->_bError || $this->_bRoutingFound || !$this->_hasPartArrayItems()) {
|
||||
|
@ -582,7 +617,7 @@ class ModRewriteController extends ModRewriteBase
|
|||
mr_setClientLanguageId($client);
|
||||
|
||||
//rebuild url
|
||||
$url = mr_buildNewUrl('front_content.php?' . $param);
|
||||
$url = mr_buildNewUrl(self::FRONT_CONTENT . '?' . $param);
|
||||
|
||||
$aUrlComponents = @parse_url($this->_sIncommingUrl);
|
||||
$incommingUrl = (isset($aUrlComponents['path'])) ? $aUrlComponents['path'] : '';
|
||||
|
@ -592,21 +627,19 @@ class ModRewriteController extends ModRewriteBase
|
|||
|
||||
// now the new generated uri should be identical with the request uri
|
||||
if ($incommingUrl !== $url) {
|
||||
$this->_bError = true;
|
||||
$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)
|
||||
{
|
||||
private function _parseUrl($url) {
|
||||
$this->_sResolvedUrl = $url;
|
||||
|
||||
$oMrUrlUtil = ModRewriteUrlUtil::getInstance();
|
||||
|
@ -615,20 +648,31 @@ class ModRewriteController extends ModRewriteBase
|
|||
return @parse_url($url);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns state of parts property.
|
||||
*
|
||||
* @return bool True if $this->_aParts propery is an array and contains items
|
||||
* @access private
|
||||
* @return bool True if $this->_aParts propery contains items
|
||||
*/
|
||||
function _hasPartArrayItems()
|
||||
{
|
||||
if (is_array($this->_aParts) && count($this->_aParts) > 0) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,74 +1,88 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR debugger class
|
||||
*
|
||||
* Description:
|
||||
* Plugin mod rewrite debugger class
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: class.modrewritedebugger.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
/**
|
||||
* Mod rewrite debugger class.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewriteDebugger {
|
||||
|
||||
|
||||
class ModRewriteDebugger
|
||||
{
|
||||
/**
|
||||
* Flag to enable debugger
|
||||
* @var bool
|
||||
*/
|
||||
protected static $_bEnabled = false;
|
||||
|
||||
|
||||
public static function setEnabled($bEnabled)
|
||||
{
|
||||
/**
|
||||
* Enable debugger setter.
|
||||
* @param bool $bEnabled
|
||||
*/
|
||||
public static function setEnabled($bEnabled) {
|
||||
self::$_bEnabled = (bool) $bEnabled;
|
||||
}
|
||||
|
||||
public static function add($mVar, $sLabel = '')
|
||||
{
|
||||
/**
|
||||
* Adds variable to debugger.
|
||||
* Wrapper for <code>DebuggerFactory::getDebugger('visible_adv')</code>.
|
||||
*
|
||||
* @param mixed $mVar The variable to dump
|
||||
* @param string $sLabel Describtion for passed $mVar
|
||||
*/
|
||||
public static function add($mVar, $sLabel = '') {
|
||||
if (!self::$_bEnabled) {
|
||||
return;
|
||||
}
|
||||
$oDebugger = DebuggerFactory::getDebugger('visible_adv');
|
||||
$oDebugger->add($mVar, $sLabel);
|
||||
DebuggerFactory::getDebugger('visible_adv')->add($mVar, $sLabel);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
/**
|
||||
* Returns output of all added variables to debug.
|
||||
* @return string
|
||||
*/
|
||||
public static function getAll() {
|
||||
if (!self::$_bEnabled) {
|
||||
return '';
|
||||
}
|
||||
$oDebugger = DebuggerFactory::getDebugger('visible_adv');
|
||||
|
||||
ob_start();
|
||||
$oDebugger->showAll();
|
||||
$sOutput = ob_get_contents();
|
||||
DebuggerFactory::getDebugger('visible_adv')->showAll();
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
return $sOutput;
|
||||
return $output;
|
||||
}
|
||||
|
||||
public static function log($mVar, $sLabel = '')
|
||||
{
|
||||
/**
|
||||
* Logs variable to debugger.
|
||||
* Wrapper for <code>cDebug::getDebugger(cDebug::DEBUGGER_FILE)</code>.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
$oDebugger = DebuggerFactory::getDebugger('file');
|
||||
$oDebugger->show($mVar, $sLabel);
|
||||
|
||||
DebuggerFactory::getDebugger('file')->show($mVar, $sLabel);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,101 +1,90 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR test class
|
||||
*
|
||||
* Description:
|
||||
* Advanced Mod Rewrite test class.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-05-xx
|
||||
*
|
||||
* $Id: class.modrewritetest.php 306 2014-03-13 23:03:26Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
|
||||
class ModRewriteTest
|
||||
{
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
/**
|
||||
* @var array Global $cfg array
|
||||
* Mod rewrite test class.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewriteTest {
|
||||
|
||||
/**
|
||||
* Global $cfg array
|
||||
* @var array
|
||||
*/
|
||||
protected $_aCfg;
|
||||
|
||||
/**
|
||||
* @var array Global $cfg['tab'] array
|
||||
* Global $cfg['tab'] array
|
||||
* @var array
|
||||
*/
|
||||
protected $_aCfgTab;
|
||||
|
||||
|
||||
/**
|
||||
* @var int Max items to process
|
||||
* Max items to process
|
||||
* @var int
|
||||
*/
|
||||
protected $_iMaxItems;
|
||||
|
||||
/**
|
||||
* @var string Actual resolved url
|
||||
* Actual resolved url
|
||||
* @var string
|
||||
*/
|
||||
protected $_sResolvedUrl;
|
||||
|
||||
|
||||
/**
|
||||
* @var bool Routing found flag
|
||||
* Routing found flag
|
||||
* @var bool
|
||||
*/
|
||||
protected $_bRoutingFound = false;
|
||||
|
||||
|
||||
/**
|
||||
* Constuctor
|
||||
* @param int $maxItems Max items (urls to articles/categories) to process
|
||||
*/
|
||||
public function __construct($maxItems)
|
||||
{
|
||||
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()
|
||||
{
|
||||
public function getResolvedUrl() {
|
||||
return $this->_sResolvedUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns flagz about found routing
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function getRoutingFoundState()
|
||||
{
|
||||
public function getRoutingFoundState() {
|
||||
return $this->_bRoutingFound;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Fetchs full structure of the installation (categories and articles) and returns it back.
|
||||
*
|
||||
|
@ -107,12 +96,11 @@ class ModRewriteTest
|
|||
* $arr[idcat]['articles'][idart] = Article dataset
|
||||
* </code>
|
||||
*/
|
||||
public function fetchFullStructure($idclient = null, $idlang = null)
|
||||
{
|
||||
public function fetchFullStructure($idclient = null, $idlang = null) {
|
||||
global $client, $lang;
|
||||
|
||||
$db = new DB_ConLite();
|
||||
$db2 = new DB_ConLite();
|
||||
$db = new DB_Contenido();
|
||||
$db2 = new DB_Contenido();
|
||||
|
||||
if (!$idclient || (int) $idclient == 0) {
|
||||
$idclient = $client;
|
||||
|
@ -141,7 +129,6 @@ class ModRewriteTest
|
|||
|
||||
$db->query($sql);
|
||||
|
||||
$loop = false;
|
||||
$counter = 0;
|
||||
|
||||
while ($db->next_record()) {
|
||||
|
@ -154,12 +141,6 @@ class ModRewriteTest
|
|||
$aStruct[$idcat] = $db->Record;
|
||||
$aStruct[$idcat]['articles'] = array();
|
||||
|
||||
if ($this->_aCfg['is_start_compatible'] == true) {
|
||||
$compStatement = ' a.is_start DESC, ';
|
||||
} else {
|
||||
$compStatement = '';
|
||||
}
|
||||
|
||||
$sql2 = "SELECT
|
||||
*
|
||||
FROM
|
||||
|
@ -173,7 +154,6 @@ class ModRewriteTest
|
|||
c.idlang = '" . $idlang . "' AND
|
||||
b.idclient = '" . $idclient . "'
|
||||
ORDER BY
|
||||
" . $compStatement . "
|
||||
c.title ASC";
|
||||
|
||||
$db2->query($sql2);
|
||||
|
@ -190,7 +170,6 @@ class ModRewriteTest
|
|||
return $aStruct;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates an URL using passed data.
|
||||
*
|
||||
|
@ -206,8 +185,7 @@ class ModRewriteTest
|
|||
* @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)
|
||||
{
|
||||
public function composeURL($arr, $type) {
|
||||
$type = ($type == 'a') ? 'a' : 'c';
|
||||
|
||||
$param = array();
|
||||
|
@ -232,7 +210,6 @@ class ModRewriteTest
|
|||
return 'front_content.php?' . implode('&', $param);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Resolves variables of an page (idcat, idart, idclient, idlang, etc.) by
|
||||
* processing passed url using ModRewriteController
|
||||
|
@ -240,14 +217,15 @@ class ModRewriteTest
|
|||
* @param string $url Url to resolve
|
||||
* @return array Assoziative array with resolved data
|
||||
*/
|
||||
public function resolveUrl($url)
|
||||
{
|
||||
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]); }
|
||||
if (isset($GLOBALS[$k])) {
|
||||
unset($GLOBALS[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
$aReturn = array();
|
||||
|
@ -260,10 +238,10 @@ class ModRewriteTest
|
|||
|
||||
// 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
|
||||
|
@ -298,21 +276,18 @@ class ModRewriteTest
|
|||
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)
|
||||
{
|
||||
public function getReadableResolvedData(array $data) {
|
||||
// compose resolved string
|
||||
$ret = '';
|
||||
foreach ($data as $k => $v) {
|
||||
|
|
|
@ -1,35 +1,21 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR url stack class
|
||||
*
|
||||
* Description:
|
||||
* Includes mod rewrite url stack class.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-09-10
|
||||
*
|
||||
* $Id: class.modrewriteurlstack.php 306 2014-03-13 23:03:26Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
/**
|
||||
* Mod rewrite url stack class. Provides features to collect urls and to get the
|
||||
|
@ -60,11 +46,10 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
* </code>
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package Contenido Backend plugins
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewriteUrlStack
|
||||
{
|
||||
class ModRewriteUrlStack {
|
||||
|
||||
/**
|
||||
* Self instance
|
||||
|
@ -76,7 +61,7 @@ class ModRewriteUrlStack
|
|||
/**
|
||||
* Database object
|
||||
*
|
||||
* @var DB_ConLite
|
||||
* @var DB_Contenido
|
||||
*/
|
||||
private $_oDb;
|
||||
|
||||
|
@ -95,7 +80,7 @@ class ModRewriteUrlStack
|
|||
private $_aStack = array();
|
||||
|
||||
/**
|
||||
* Contenido related parameter array
|
||||
* CONTENIDO related parameter array
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
|
@ -117,40 +102,34 @@ class ModRewriteUrlStack
|
|||
*/
|
||||
private $_idLang;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor, sets some properties.
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
private function __construct() {
|
||||
global $cfg, $lang;
|
||||
$this->_oDb = new DB_ConLite();
|
||||
$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()
|
||||
{
|
||||
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)
|
||||
{
|
||||
public function add($url) {
|
||||
$url = ModRewrite::urlPreClean($url);
|
||||
if (isset($this->_aUrls[$url])) {
|
||||
return;
|
||||
|
@ -177,7 +156,6 @@ class ModRewriteUrlStack
|
|||
$this->_aStack[$sStackId] = array('params' => $aUrl['params']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the pretty urlparts (only category path an article name) of the
|
||||
* desired url.
|
||||
|
@ -189,8 +167,7 @@ class ModRewriteUrlStack
|
|||
* $arr['urlname']
|
||||
* </code>
|
||||
*/
|
||||
public function getPrettyUrlParts($url)
|
||||
{
|
||||
public function getPrettyUrlParts($url) {
|
||||
$url = ModRewrite::urlPreClean($url);
|
||||
if (!isset($this->_aUrls[$url])) {
|
||||
$this->add($url);
|
||||
|
@ -207,7 +184,6 @@ class ModRewriteUrlStack
|
|||
return $aPretty;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extracts passed url using parse_urla and adds also the 'params' array to it
|
||||
*
|
||||
|
@ -215,8 +191,7 @@ class ModRewriteUrlStack
|
|||
* @return array Components containing result of parse_url with additional
|
||||
* 'params' array
|
||||
*/
|
||||
private function _extractUrl($url)
|
||||
{
|
||||
private function _extractUrl($url) {
|
||||
$aUrl = @parse_url($url);
|
||||
if (isset($aUrl['query'])) {
|
||||
$aUrl['query'] = str_replace('&', '&', $aUrl['query']);
|
||||
|
@ -228,7 +203,6 @@ class ModRewriteUrlStack
|
|||
return $aUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Extracts article or category related parameter from passed params array
|
||||
* and generates an identifier.
|
||||
|
@ -236,8 +210,7 @@ class ModRewriteUrlStack
|
|||
* @param array $aParams Parameter array
|
||||
* @return string Composed stack id
|
||||
*/
|
||||
private function _makeStackId(array $aParams)
|
||||
{
|
||||
private function _makeStackId(array $aParams) {
|
||||
# idcatart
|
||||
if ((int) mr_arrayValue($aParams, 'idart') > 0) {
|
||||
$sStackId = 'idart_' . $aParams['idart'] . '_lang_' . $aParams['lang'];
|
||||
|
@ -255,15 +228,13 @@ class ModRewriteUrlStack
|
|||
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()
|
||||
{
|
||||
private function _chunkSetPrettyUrlParts() {
|
||||
// collect stack parameter to get urlpath and urlname
|
||||
$aStack = array();
|
||||
foreach ($this->_aStack as $stackId => $item) {
|
||||
|
|
|
@ -1,47 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR url utility class
|
||||
*
|
||||
* Description:
|
||||
* Includes Mod Rewrite url utility class.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-05-xx
|
||||
*
|
||||
* $Id: class.modrewriteurlutil.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
/**
|
||||
* Mod Rewrite url utility class. Handles convertion of Urls from contenido core
|
||||
* 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 <murat@purc.de>
|
||||
* @package Contenido Backend plugins
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewriteUrlUtil extends ModRewriteBase
|
||||
{
|
||||
class ModRewriteUrlUtil extends ModRewriteBase {
|
||||
|
||||
/**
|
||||
* Self instance (singleton implementation)
|
||||
|
@ -50,7 +35,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
private static $_instance;
|
||||
|
||||
/**
|
||||
* Contenido category word separator
|
||||
* CONTENIDO category word separator
|
||||
* @var string
|
||||
*/
|
||||
private $_catWordSep = '-';
|
||||
|
@ -62,7 +47,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
private $_mrCatWordSep;
|
||||
|
||||
/**
|
||||
* Contenido category separator
|
||||
* CONTENIDO category separator
|
||||
* @var string
|
||||
*/
|
||||
private $_catSep = '/';
|
||||
|
@ -74,7 +59,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
private $_mrCatSep;
|
||||
|
||||
/**
|
||||
* Contenido article separator
|
||||
* CONTENIDO article separator
|
||||
* @var string
|
||||
*/
|
||||
private $_artSep = '/';
|
||||
|
@ -86,7 +71,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
private $_mrArtSep;
|
||||
|
||||
/**
|
||||
* Contenido article word separator
|
||||
* CONTENIDO article word separator
|
||||
* @var string
|
||||
*/
|
||||
private $_artWordSep = '-';
|
||||
|
@ -103,12 +88,10 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
*/
|
||||
private $_mrExt;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor, sets some AMR configuration related properties
|
||||
*/
|
||||
private function __construct()
|
||||
{
|
||||
private function __construct() {
|
||||
$aCfg = parent::getConfig();
|
||||
$this->_mrCatWordSep = $aCfg['category_word_seperator'];
|
||||
$this->_mrCatSep = $aCfg['category_seperator'];
|
||||
|
@ -117,56 +100,52 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
$this->_mrExt = $aCfg['file_extension'];
|
||||
}
|
||||
|
||||
private function __clone()
|
||||
{
|
||||
/**
|
||||
* Prevent cloning
|
||||
*/
|
||||
private function __clone() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns self instance (singleton pattern)
|
||||
* @return ModRewriteUrlUtil
|
||||
*/
|
||||
public static function getInstance()
|
||||
{
|
||||
public static function getInstance() {
|
||||
if (self::$_instance == null) {
|
||||
self::$_instance = new ModRewriteUrlUtil();
|
||||
}
|
||||
return self::$_instance;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed AMR url path to Contenido url path.
|
||||
* Converts passed AMR url path to CONTENIDO url path.
|
||||
*
|
||||
* @param string $urlPath AMR url path
|
||||
* @return string Contenido url path
|
||||
* @return string CONTENIDO url path
|
||||
*/
|
||||
public function toContenidoUrlPath($urlPath)
|
||||
{
|
||||
public function toContenidoUrlPath($urlPath) {
|
||||
$newUrlPath = $this->_toUrlPath(
|
||||
$urlPath, $this->_mrCatSep, $this->_catSep, $this->_mrCatWordSep, $this->_catWordSep,
|
||||
$this->_mrArtSep, $this->_artSep
|
||||
$urlPath, $this->_mrCatSep, $this->_catSep, $this->_mrCatWordSep, $this->_catWordSep, $this->_mrArtSep, $this->_artSep
|
||||
);
|
||||
return $newUrlPath;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts passed Contenido url path to AMR url path.
|
||||
* Converts passed CONTENIDO url path to AMR url path.
|
||||
*
|
||||
* @param string $urlPath Contenido url path
|
||||
* @param string $urlPath CONTENIDO url path
|
||||
* @return string AMR url path
|
||||
*/
|
||||
public function toModRewriteUrlPath($urlPath)
|
||||
{
|
||||
public function toModRewriteUrlPath($urlPath) {
|
||||
$newUrlPath = $this->_toUrlPath(
|
||||
$urlPath, $this->_catSep, $this->_mrCatSep, $this->_catWordSep, $this->_mrCatWordSep,
|
||||
$this->_artSep, $this->_mrArtSep
|
||||
$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).
|
||||
* 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
|
||||
|
@ -177,9 +156,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
* @param string $toArtSep Destination article seperator
|
||||
* @return string Destination url path
|
||||
*/
|
||||
private function _toUrlPath($urlPath, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep,
|
||||
$fromArtSep, $toArtSep)
|
||||
{
|
||||
private function _toUrlPath($urlPath, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, $fromArtSep, $toArtSep) {
|
||||
if ((string) $urlPath == '') {
|
||||
return $urlPath;
|
||||
}
|
||||
|
@ -201,43 +178,37 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
return $urlPath;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed AMR url name to Contenido url name.
|
||||
* Converts passed AMR url name to CONTENIDO url name.
|
||||
*
|
||||
* @param string $urlName AMR url name
|
||||
* @return string Contenido url name
|
||||
* @return string CONTENIDO url name
|
||||
*/
|
||||
public function toContenidoUrlName($urlName)
|
||||
{
|
||||
public function toContenidoUrlName($urlName) {
|
||||
$newUrlName = $this->_toUrlName($urlName, $this->_mrArtWordSep, $this->_artWordSep);
|
||||
return $newUrlName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed Contenido url name to AMR url name.
|
||||
* Converts passed CONTENIDO url name to AMR url name.
|
||||
*
|
||||
* @param string $urlName Contenido url name
|
||||
* @param string $urlName CONTENIDO url name
|
||||
* @return string AMR url name
|
||||
*/
|
||||
public function toModRewriteUrlName($urlName)
|
||||
{
|
||||
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).
|
||||
* 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)
|
||||
{
|
||||
private function _toUrlName($urlName, $fromArtWordSep, $toArtWordSep) {
|
||||
if ((string) $urlName == '') {
|
||||
return $urlName;
|
||||
}
|
||||
|
@ -252,15 +223,13 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
return $urlName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed AMR url to Contenido url.
|
||||
* Converts passed AMR url to CONTENIDO url.
|
||||
*
|
||||
* @param string $url AMR url
|
||||
* @return string Contenido url
|
||||
* @return string CONTENIDO url
|
||||
*/
|
||||
public function toContenidoUrl($url)
|
||||
{
|
||||
public function toContenidoUrl($url) {
|
||||
if (strpos($url, $this->_mrExt) === false) {
|
||||
$newUrl = $this->toContenidoUrlPath($url);
|
||||
} else {
|
||||
|
@ -272,15 +241,13 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
return $newUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed AMR url to Contenido url.
|
||||
* Converts passed AMR url to CONTENIDO url.
|
||||
*
|
||||
* @param string $url AMR url
|
||||
* @return string Contenido url
|
||||
* @return string CONTENIDO url
|
||||
*/
|
||||
public function toModRewriteUrl($url)
|
||||
{
|
||||
public function toModRewriteUrl($url) {
|
||||
if (strpos($url, $this->_mrExt) === false) {
|
||||
$newUrl = $this->toModRewriteUrlPath($url);
|
||||
} else {
|
||||
|
@ -292,11 +259,10 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
return $newUrl;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts passed url to a another url (Contenido to AMR and vice versa).
|
||||
* Converts passed url to a another url (CONTENIDO to AMR and vice versa).
|
||||
*
|
||||
* @param string $urlPath Source url path
|
||||
* @param string $url Source url
|
||||
* @param string $fromCatSep Source category seperator
|
||||
* @param string $toCatSep Destination category seperator
|
||||
* @param string $fromCatWordSep Source category word seperator
|
||||
|
@ -309,9 +275,7 @@ class ModRewriteUrlUtil extends ModRewriteBase
|
|||
*
|
||||
* @deprecated No more used, is to delete
|
||||
*/
|
||||
private function _toUrl($url, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep,
|
||||
$fromArtSep, $toArtSep, $fromArtWordSep, $toArtWordSep)
|
||||
{
|
||||
private function _toUrl($url, $fromCatSep, $toCatSep, $fromCatWordSep, $toCatWordSep, $fromArtSep, $toArtSep, $fromArtWordSep, $toArtWordSep) {
|
||||
if ((string) $url == '') {
|
||||
return $url;
|
||||
}
|
||||
|
|
|
@ -1,51 +1,44 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR Content controller class
|
||||
*
|
||||
* Description:
|
||||
* Content controller
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: class.modrewrite_content_controller.php 312 2014-06-18 11:01:08Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
|
||||
plugin_include(
|
||||
'mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php'
|
||||
);
|
||||
|
||||
|
||||
class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
||||
{
|
||||
|
||||
public function indexAction()
|
||||
{
|
||||
// donut
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
public function saveAction()
|
||||
{
|
||||
|
||||
/**
|
||||
* Content controller for general settings.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @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');
|
||||
|
@ -69,26 +62,26 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
// root dir
|
||||
if (mr_arrayValue($request, 'rootdir', '') !== '') {
|
||||
if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/', $request['rootdir'])) {
|
||||
$sMsg = i18n('The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\-_\/\.]', 'mod_rewrite');
|
||||
$sMsg = i18n("The root directory has a invalid format, alowed are the chars [a-zA-Z0-9\-_\/\.]", "mod_rewrite");
|
||||
$this->_oView->rootdir_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif (!is_dir($_SERVER['DOCUMENT_ROOT'] . $request['rootdir'])) {
|
||||
|
||||
if (mr_arrayValue($request, 'checkrootdir') == 1) {
|
||||
// root dir check is enabled, this results in error
|
||||
$sMsg = i18n('The specified directory "%s" does not exists', 'mod_rewrite');
|
||||
$sMsg = i18n("The specified directory '%s' does not exists", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $_SERVER['DOCUMENT_ROOT'] . $request['rootdir']);
|
||||
$this->_oView->rootdir_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} else {
|
||||
// root dir check ist disabled, take over the setting and
|
||||
// output a warning.
|
||||
$sMsg = i18n('The specified directory "%s" does not exists in DOCUMENT_ROOT "%s". this could happen, if clients DOCUMENT_ROOT differs from Contenido backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.', 'mod_rewrite');
|
||||
$sMsg = i18n("The specified directory '%s' does not exists in DOCUMENT_ROOT '%s'. This could happen, if clients DOCUMENT_ROOT differs from CONTENIDO backends DOCUMENT_ROOT. However, the setting will be taken over because of disabled check.", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $request['rootdir'], $_SERVER['DOCUMENT_ROOT']);
|
||||
$this->_oView->rootdir_error = $this->_notifyBox('warning', $sMsg);
|
||||
}
|
||||
}
|
||||
$this->_oView->rootdir = clHtmlEntities($request['rootdir']);
|
||||
$this->_oView->rootdir = conHtmlentities($request['rootdir']);
|
||||
$aMR['mod_rewrite']['rootdir'] = $request['rootdir'];
|
||||
}
|
||||
|
||||
|
@ -186,86 +179,86 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
|
||||
// category seperator
|
||||
if ($categorySeperator == '') {
|
||||
$sMsg = i18n('Please specify separator (%s) for category', 'mod_rewrite');
|
||||
$sMsg = i18n("Please specify separator (%s) for category", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $separatorInfo);
|
||||
$this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif (!preg_match($separatorPattern, $categorySeperator)) {
|
||||
$sMsg = i18n('Invalid separator for category, allowed one of following characters: %s', 'mod_rewrite');
|
||||
$sMsg = i18n("Invalid separator for category, allowed one of following characters: %s", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $separatorInfo);
|
||||
$this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
|
||||
// category word seperator
|
||||
} elseif ($categoryWordSeperator == '') {
|
||||
$sMsg = i18n('Please specify separator (%s) for category words', 'mod_rewrite');
|
||||
$sMsg = i18n("Please specify separator (%s) for category words", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $wordSeparatorInfo);
|
||||
$this->_oView->category_word_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif (!preg_match($wordSeparatorPattern, $categoryWordSeperator)) {
|
||||
$sMsg = i18n('Invalid separator for category words, allowed one of following characters: %s', 'mod_rewrite');
|
||||
$sMsg = i18n("Invalid separator for category words, allowed one of following characters: %s", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $wordSeparatorInfo);
|
||||
$this->_oView->category_word_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
|
||||
// article seperator
|
||||
} elseif ($articleSeperator == '') {
|
||||
$sMsg = i18n('Please specify separator (%s) for article', 'mod_rewrite');
|
||||
$sMsg = i18n("Please specify separator (%s) for article", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $separatorInfo);
|
||||
$this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif (!preg_match($separatorPattern, $articleSeperator)) {
|
||||
$sMsg = i18n('Invalid separator for article, allowed is one of following characters: %s', 'mod_rewrite');
|
||||
$sMsg = i18n("Invalid separator for article, allowed is one of following characters: %s", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $separatorInfo);
|
||||
$this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
|
||||
// article word seperator
|
||||
} elseif ($articleWordSeperator == '') {
|
||||
$sMsg = i18n('Please specify separator (%s) for article words', 'mod_rewrite');
|
||||
$sMsg = i18n("Please specify separator (%s) for article words", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $wordSeparatorInfo);
|
||||
$this->_oView->article_word_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif (!preg_match($wordSeparatorPattern, $articleWordSeperator)) {
|
||||
$sMsg = i18n('Invalid separator for article words, allowed is one of following characters: %s', 'mod_rewrite');
|
||||
$sMsg = i18n("Invalid separator for article words, allowed is one of following characters: %s", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $wordSeparatorInfo);
|
||||
$this->_oView->article_word_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
|
||||
// category_seperator - category_word_seperator
|
||||
} elseif ($categorySeperator == $categoryWordSeperator) {
|
||||
$sMsg = i18n('Separator for category and category words must not be identical', 'mod_rewrite');
|
||||
$sMsg = i18n("Separator for category and category words must not be identical", "mod_rewrite");
|
||||
$this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
// category_seperator - article_word_seperator
|
||||
} elseif ($categorySeperator == $articleWordSeperator) {
|
||||
$sMsg = i18n('Separator for category and article words must not be identical', 'mod_rewrite');
|
||||
$sMsg = i18n("Separator for category and article words must not be identical", "mod_rewrite");
|
||||
$this->_oView->category_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
// article_seperator - article_word_seperator
|
||||
} elseif ($articleSeperator == $articleWordSeperator) {
|
||||
$sMsg = i18n('Separator for category-article and article words must not be identical', 'mod_rewrite');
|
||||
$sMsg = i18n("Separator for category-article and article words must not be identical", "mod_rewrite");
|
||||
$this->_oView->article_separator_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
}
|
||||
|
||||
$this->_oView->category_separator = clHtmlEntities($categorySeperator);
|
||||
$this->_oView->category_separator = conHtmlentities($categorySeperator);
|
||||
$aMR['mod_rewrite']['category_seperator'] = $categorySeperator;
|
||||
$this->_oView->category_word_separator = clHtmlEntities($categoryWordSeperator);
|
||||
$this->_oView->category_word_separator = conHtmlentities($categoryWordSeperator);
|
||||
$aMR['mod_rewrite']['category_word_seperator'] = $categoryWordSeperator;
|
||||
$this->_oView->article_separator = clHtmlEntities($articleSeperator);
|
||||
$this->_oView->article_separator = conHtmlentities($articleSeperator);
|
||||
$aMR['mod_rewrite']['article_seperator'] = $articleSeperator;
|
||||
$this->_oView->article_word_separator = clHtmlEntities($articleWordSeperator);
|
||||
$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');
|
||||
$sMsg = i18n("The file extension has a invalid format, allowed are the chars \.([a-zA-Z0-9\-_\/])", "mod_rewrite");
|
||||
$this->_oView->file_extension_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
}
|
||||
$this->_oView->file_extension = clHtmlEntities($request['file_extension']);
|
||||
$this->_oView->file_extension = conHtmlentities($request['file_extension']);
|
||||
$aMR['mod_rewrite']['file_extension'] = $request['file_extension'];
|
||||
} else {
|
||||
$this->_oView->file_extension = '.html';
|
||||
|
@ -275,11 +268,11 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
// category resolve min percentage
|
||||
if (isset($request['category_resolve_min_percentage'])) {
|
||||
if (!is_numeric($request['category_resolve_min_percentage'])) {
|
||||
$sMsg = i18n('Value has to be numeric.', 'mod_rewrite');
|
||||
$sMsg = i18n("Value has to be numeric.", "mod_rewrite");
|
||||
$this->_oView->category_resolve_min_percentage_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
} elseif ($request['category_resolve_min_percentage'] < 0 || $request['category_resolve_min_percentage'] > 100) {
|
||||
$sMsg = i18n('Value has to be between 0 an 100.', 'mod_rewrite');
|
||||
$sMsg = i18n("Value has to be between 0 an 100.", "mod_rewrite");
|
||||
$this->_oView->category_resolve_min_percentage_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
}
|
||||
|
@ -296,11 +289,11 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
$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');
|
||||
$sMsg = i18n("The article name has a invalid format, allowed are the chars /^[a-zA-Z0-9\-_\/\.]*$/", "mod_rewrite");
|
||||
$this->_oView->add_startart_name_to_url_error = $this->_notifyBox('error', $sMsg);
|
||||
$bError = true;
|
||||
}
|
||||
$this->_oView->default_startart_name = clHtmlEntities($request['default_startart_name']);
|
||||
$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 = '';
|
||||
|
@ -342,7 +335,7 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
}
|
||||
$aRouting[$routingDef[0]] = $routingDef[1];
|
||||
}
|
||||
$this->_oView->rewrite_routing = clHtmlEntities($request['rewrite_routing']);
|
||||
$this->_oView->rewrite_routing = conHtmlentities($request['rewrite_routing']);
|
||||
$aMR['mod_rewrite']['routing'] = $aRouting;
|
||||
} else {
|
||||
$this->_oView->rewrite_routing = '';
|
||||
|
@ -359,15 +352,17 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
}
|
||||
|
||||
if ($bError) {
|
||||
$sMsg = i18n('Please check your input', 'mod_rewrite');
|
||||
$this->_oView->content_before = $this->_notifyBox('error', $sMsg);
|
||||
$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 '<pre class="example">';print_r($aMR['mod_rewrite']);echo '</pre>';
|
||||
$sMsg = i18n('Configuration has <b>not</b> been saved, because of enabled debugging', 'mod_rewrite');
|
||||
echo '<pre class="example">';
|
||||
print_r($aMR['mod_rewrite']);
|
||||
echo '</pre>';
|
||||
$sMsg = i18n("Configuration has <b>not</b> been saved, because of enabled debugging", "mod_rewrite");
|
||||
echo $this->_notifyBox('info', $sMsg);
|
||||
return;
|
||||
}
|
||||
|
@ -375,21 +370,24 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
$bSeparatorModified = $this->_separatorModified($aMR['mod_rewrite']);
|
||||
|
||||
if (mr_setConfiguration($this->_client, $aMR)) {
|
||||
$sMsg = 'Configuration has been saved';
|
||||
$sMsg = i18n("Configuration has been saved", "mod_rewrite");
|
||||
if ($bSeparatorModified) {
|
||||
mr_loadConfiguration($this->_client, true);
|
||||
}
|
||||
$this->_oView->content_before = $this->_notifyBox('info', $sMsg);
|
||||
$this->_oView->content_before .= $this->_notifyBox('info', $sMsg);
|
||||
} else {
|
||||
$sMsg = i18n('Configuration could not saved. Please check write permissions for %s ', 'mod_rewrite');
|
||||
$sMsg = i18n("Configuration could not saved. Please check write permissions for %s ", "mod_rewrite");
|
||||
$sMsg = sprintf($sMsg, $options['key']);
|
||||
$this->_oView->content_before = $this->_notifyBox('error', $sMsg);
|
||||
$this->_oView->content_before .= $this->_notifyBox('error', $sMsg);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function _separatorModified($aNewCfg)
|
||||
{
|
||||
/**
|
||||
* 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']) {
|
||||
|
@ -404,4 +402,25 @@ class ModRewrite_ContentController extends ModRewrite_ControllerAbstract
|
|||
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.<br />Please check following topic in Contenido forum to change this:<br /><br /><a href='http://forum.contenido.org/viewtopic.php?t=32530' class='blue' target='_blank'>is_start_compatible auf neue Version umstellen</a>", "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, '<a href="main.php?area=mod_rewrite_expert&frame=4&contenido=' . $this->_oView->sessid . '&idclient=' . $this->_client . '" onclick="parent.right_top.sub.clicked(parent.right_top.document.getElementById(\'c_1\').firstChild);">', '</a>');
|
||||
$this->_oView->content_before .= $this->_notifyBox('warning', $sMsg);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,46 +1,48 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR Content expert controller class
|
||||
*
|
||||
* Description:
|
||||
* Content expert controller
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: class.modrewrite_contentexpert_controller.php 209 2013-01-24 12:31:00Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php');
|
||||
/**
|
||||
* Content expert controller for expert settings/actions.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract {
|
||||
|
||||
|
||||
class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract
|
||||
{
|
||||
/**
|
||||
* Path to restrictive htaccess file
|
||||
* @var string
|
||||
*/
|
||||
protected $_htaccessRestrictive = '';
|
||||
|
||||
/**
|
||||
* Path to simple htaccess file
|
||||
* @var string
|
||||
*/
|
||||
protected $_htaccessSimple = '';
|
||||
|
||||
public function init()
|
||||
{
|
||||
/**
|
||||
* 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/';
|
||||
|
@ -49,15 +51,16 @@ class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract
|
|||
}
|
||||
|
||||
/**
|
||||
* Execute index action
|
||||
* Index action
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
public function indexAction() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function copyHtaccessAction()
|
||||
{
|
||||
/**
|
||||
* Copy htaccess action
|
||||
*/
|
||||
public function copyHtaccessAction() {
|
||||
$type = $this->_getParam('htaccesstype');
|
||||
$copy = $this->_getParam('copy');
|
||||
|
||||
|
@ -70,7 +73,7 @@ class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract
|
|||
$aInfo = $this->getProperty('htaccessInfo');
|
||||
|
||||
if ($aInfo['has_htaccess']) {
|
||||
$this->_oView->content_before = $this->_notifyBox(Contenido_Notification::LEVEL_WARNING, 'Die .htaccess existiert bereits im Contenido-/ oder Mandantenverzeichnis, daher wird es nicht kopiert');
|
||||
$this->_oView->content_before = $this->_notifyBox('info', 'Die .htaccess existiert bereits im Contenido-/ oder Mandantenverzeichnis, daher wird es nicht kopiert');
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -87,17 +90,18 @@ class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract
|
|||
}
|
||||
|
||||
if (!$result = @copy($source, $dest)) {
|
||||
$this->_oView->content_before = $this->_notifyBox(Contenido_Notification::LEVEL_WARNING, 'Die .htaccess konnte nicht von ' . $source . ' nach ' . $dest . ' kopiert werden!');
|
||||
$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(Contenido_Notification::LEVEL_INFO, $msg);
|
||||
$this->_oView->content_before = $this->_notifyBox('info', $msg);
|
||||
}
|
||||
|
||||
|
||||
public function downloadHtaccessAction()
|
||||
{
|
||||
/**
|
||||
* Download htaccess action
|
||||
*/
|
||||
public function downloadHtaccessAction() {
|
||||
$type = $this->_getParam('htaccesstype');
|
||||
|
||||
if ($type != 'restrictive' && $type != 'simple') {
|
||||
|
@ -118,17 +122,19 @@ class ModRewrite_ContentExpertController extends ModRewrite_ControllerAbstract
|
|||
$this->render('{CONTENT}');
|
||||
}
|
||||
|
||||
|
||||
public function resetAction()
|
||||
{
|
||||
/**
|
||||
* Reset aliases action
|
||||
*/
|
||||
public function resetAction() {
|
||||
// recreate all aliases
|
||||
ModRewrite::recreateAliases(false);
|
||||
$this->_oView->content_before = $this->_notifyBox('info', 'Alle Aliase wurden zurückgesetzt');
|
||||
}
|
||||
|
||||
|
||||
public function resetEmptyAction()
|
||||
{
|
||||
/**
|
||||
* 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');
|
||||
|
|
|
@ -1,46 +1,42 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR test controller
|
||||
*
|
||||
* Description:
|
||||
* Content test controller
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: class.modrewrite_contenttest_controller.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
plugin_include('mod_rewrite', 'classes/class.modrewritetest.php');
|
||||
plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_controller_abstract.php');
|
||||
/**
|
||||
* Content controller to run tests.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
*/
|
||||
class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract {
|
||||
|
||||
|
||||
class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
||||
{
|
||||
/**
|
||||
* Number of max items to process
|
||||
* @var int
|
||||
*/
|
||||
protected $_iMaxItems = 0;
|
||||
|
||||
public function init()
|
||||
{
|
||||
/**
|
||||
* 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"' : '';
|
||||
|
@ -51,19 +47,16 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
}
|
||||
|
||||
/**
|
||||
* Execute index action
|
||||
* Index action
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
public function indexAction() {
|
||||
$this->_oView->content = '';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute test action
|
||||
* Test action
|
||||
*/
|
||||
public function testAction()
|
||||
{
|
||||
public function testAction() {
|
||||
$this->_oView->content = '';
|
||||
|
||||
// Array for testcases
|
||||
|
@ -74,7 +67,7 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
|
||||
$startTime = getmicrotime();
|
||||
|
||||
// Fetch complete Contenido page structure
|
||||
// Fetch complete CONTENIDO page structure
|
||||
$aStruct = $oMRTest->fetchFullStructure();
|
||||
ModRewriteDebugger::add($aStruct, 'mr_test.php $aStruct');
|
||||
|
||||
|
@ -114,6 +107,7 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
foreach ($aTests as $p => $v) {
|
||||
$url = mr_buildNewUrl($v['url']);
|
||||
$arr = $oMRTest->resolveUrl($url);
|
||||
$error = '';
|
||||
$resUrl = $oMRTest->getResolvedUrl();
|
||||
$color = 'green';
|
||||
|
||||
|
@ -129,6 +123,27 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
$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
|
||||
|
@ -139,6 +154,7 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
$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";
|
||||
|
@ -155,7 +171,6 @@ class ModRewrite_ContentTestController extends ModRewrite_ControllerAbstract
|
|||
$msg = str_replace('{num_fail}', $failCounter, $msg);
|
||||
|
||||
$this->_oView->content = $msg . $this->_oView->content;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,61 +1,95 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* AMR abstract controller class
|
||||
*
|
||||
* Description:
|
||||
* Abstract controller
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: class.modrewrite_controller_abstract.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
|
||||
abstract class ModRewrite_ControllerAbstract
|
||||
{
|
||||
/**
|
||||
* Abstract controller for all concrete mod_rewrite controller implementations.
|
||||
*
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @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;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
/**
|
||||
* 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();
|
||||
|
@ -70,49 +104,80 @@ abstract class ModRewrite_ControllerAbstract
|
|||
$this->_oView->frame = $this->_frame;
|
||||
$this->_oView->contenido = $this->_contenido;
|
||||
$this->_oView->sessid = $sess->id;
|
||||
$this->_oView->lng_more_informations = i18n('More informations', 'mod_rewrite');
|
||||
$this->_oView->lng_more_informations = i18n("More informations", "mod_rewrite");
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
/**
|
||||
* Initializer method, could be overwritten by childs.
|
||||
* This method will be invoked in constructor of ModRewrite_ControllerAbstract.
|
||||
*/
|
||||
public function init() {
|
||||
|
||||
}
|
||||
|
||||
public function setView($oView)
|
||||
{
|
||||
/**
|
||||
* View property setter.
|
||||
* @param object $oView
|
||||
*/
|
||||
public function setView($oView) {
|
||||
if (is_object($oView)) {
|
||||
$this->_oView = $oView;
|
||||
}
|
||||
}
|
||||
|
||||
public function getView()
|
||||
{
|
||||
/**
|
||||
* View property getter.
|
||||
* @return object
|
||||
*/
|
||||
public function getView() {
|
||||
return $this->_oView;
|
||||
}
|
||||
|
||||
public function setProperty($key, $value)
|
||||
{
|
||||
/**
|
||||
* Property setter.
|
||||
* @param string $key
|
||||
* @param mixed $value
|
||||
*/
|
||||
public function setProperty($key, $value) {
|
||||
$this->_properties[$key] = $value;
|
||||
}
|
||||
|
||||
public function getProperty($key, $default = null)
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
public function setTemplate($sTemplate)
|
||||
{
|
||||
/**
|
||||
* Template setter.
|
||||
* @param string $sTemplate Either full path and name of template file or a template string.
|
||||
*/
|
||||
public function setTemplate($sTemplate) {
|
||||
$this->_template = $sTemplate;
|
||||
}
|
||||
|
||||
public function getTemplate()
|
||||
{
|
||||
/**
|
||||
* Template getter.
|
||||
* @return string
|
||||
*/
|
||||
public function getTemplate() {
|
||||
return $this->_template;
|
||||
}
|
||||
|
||||
public function render($template = null)
|
||||
{
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
@ -128,8 +193,16 @@ abstract class ModRewrite_ControllerAbstract
|
|||
$oTpl->generate($template, 0, 0);
|
||||
}
|
||||
|
||||
protected function _getParam($key, $default = null)
|
||||
{
|
||||
/**
|
||||
* 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])) {
|
||||
|
@ -139,8 +212,13 @@ abstract class ModRewrite_ControllerAbstract
|
|||
}
|
||||
}
|
||||
|
||||
protected function _notifyBox($type, $msg)
|
||||
{
|
||||
/**
|
||||
* 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) . '<br>';
|
||||
}
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<title>aToolTip Demos</title>
|
||||
|
||||
<!-- CSS -->
|
||||
<link type="text/css" href="css/style.css" rel="stylesheet" media="screen" />
|
||||
<link type="text/css" href="css/style.css" rel="stylesheet" media="screen">
|
||||
|
||||
<!-- aToolTip css -->
|
||||
<link type="text/css" href="css/atooltip.css" rel="stylesheet" media="screen" />
|
||||
<link type="text/css" href="css/atooltip.css" rel="stylesheet" media="screen">
|
||||
|
||||
|
||||
<!-- Scripts -->
|
||||
|
@ -70,7 +70,7 @@
|
|||
</p>
|
||||
|
||||
<p class="license">
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png" /></a><br />This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
|
||||
<a rel="license" href="http://creativecommons.org/licenses/by/3.0/"><img alt="Creative Commons License" style="border-width:0" src="http://creativecommons.org/images/public/somerights20.png"></a><br>This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 Unported License</a>.
|
||||
</p>
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
################################################################################
|
||||
# Contenido AMR plugin restrictive rewrite rules set.
|
||||
# CONTENIDO AMR plugin restrictive rewrite rules set.
|
||||
#
|
||||
# Contains strict rules, each rewrite exclusion must be set manually.
|
||||
# - Exclude requests to directories usage/, contenido/, setup/, cms/upload/
|
||||
|
@ -12,9 +12,8 @@
|
|||
# @license http://www.contenido.org/license/LIZENZ.txt
|
||||
# @link http://www.4fb.de
|
||||
# @link http://www.contenido.org
|
||||
# @since file available since Contenido release 4.8.15
|
||||
#
|
||||
# $Id: htaccess_restrictive.txt 447 2016-07-08 14:04:12Z oldperl $
|
||||
# $Id: htaccess_restrictive.txt 3503 2012-10-19 19:49:39Z xmurrix $
|
||||
################################################################################
|
||||
|
||||
|
||||
|
@ -53,10 +52,9 @@
|
|||
RewriteRule ^cms/front_content.php.*$ - [L]
|
||||
|
||||
|
||||
# One RewriteRule to rule them all.
|
||||
# Exclude common extensions from rewriting and pass remaining requests to
|
||||
# front_content.php.
|
||||
RewriteRule !\.(avi|css|doc|flv|gif|gzip|ico|jpeg|jpg|js|mov|mp3|pdf|png|ppt|rar|txt|wav|wmv|xml|zip)$ front_content.php [NC,QSA,L]
|
||||
RewriteRule !\.(avi|css|doc|flv|gif|gzip|ico|jpeg|jpg|js|mov|mp3|pdf|png|ppt|rar|swf|txt|wav|wmv|xml|zip)$ front_content.php [NC,QSA,L]
|
||||
|
||||
</IfModule>
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
################################################################################
|
||||
# Contenido AMR plugin simple rewrite rules set.
|
||||
# CONTENIDO AMR plugin simple rewrite rules set.
|
||||
#
|
||||
# Contains few easy to handle rewrite rules.
|
||||
#
|
||||
|
@ -9,9 +9,8 @@
|
|||
# @license http://www.contenido.org/license/LIZENZ.txt
|
||||
# @link http://www.4fb.de
|
||||
# @link http://www.contenido.org
|
||||
# @since file available since Contenido release 4.8.15
|
||||
#
|
||||
# $Id: htaccess_simple.txt 2 2011-07-20 12:00:48Z oldperl $
|
||||
# $Id: htaccess_simple.txt 3503 2012-10-19 19:49:39Z xmurrix $
|
||||
################################################################################
|
||||
|
||||
|
||||
|
@ -46,7 +45,8 @@
|
|||
|
||||
|
||||
# Exclude following request from rewriting
|
||||
# tests for valid symlinks (-s), not empty files (-l) and folders (-d)
|
||||
# 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
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin Advanced Mod Rewrite default settings. This file will be included if
|
||||
* mod rewrite settings of an client couldn't loaded.
|
||||
*
|
||||
* Containing settings are taken over from contenido-4.6.15mr setup installer
|
||||
* Containing settings are taken over from CONTENIDO-4.6.15mr setup installer
|
||||
* template beeing made originally by stese.
|
||||
*
|
||||
* NOTE:
|
||||
|
@ -16,29 +12,20 @@
|
|||
* PHP needs write permissions to the folder, where this file resides. Mod Rewrite
|
||||
* configuration files will be created in this folder.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-05-xx
|
||||
*
|
||||
* $Id: config.mod_rewrite_default.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
global $cfg;
|
||||
|
@ -101,7 +88,6 @@ $cfg['mod_rewrite']['rewrite_urls_at_front_content_output'] = 1;
|
|||
// 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'] = '/';
|
||||
|
||||
|
|
|
@ -1,38 +1,26 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin Advanced Mod Rewrite initialization file.
|
||||
*
|
||||
* This file will be included by Contenido plugin loader routine, and the content
|
||||
* This file will be included by CONTENIDO plugin loader routine, and the content
|
||||
* of this file ensures that the AMR Plugin will be initialized correctly.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-05-xx
|
||||
*
|
||||
* $Id: config.plugin.php 275 2013-09-11 12:49:00Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
global $_cecRegistry, $cfg, $contenido, $area, $client, $load_client;
|
||||
|
||||
####################################################################################################
|
||||
/**
|
||||
|
@ -40,7 +28,7 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
* 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.
|
||||
* There is no need for this chain since CONTENIDO 4.8.9 contains its own Url building feature.
|
||||
* @deprecated
|
||||
*
|
||||
* Parameters & order:
|
||||
|
@ -51,13 +39,6 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
*/
|
||||
$_cecRegistry->registerChain("Contenido.Frontend.CreateURL", "string");
|
||||
####################################################################################################
|
||||
|
||||
|
||||
global $cfg, $contenido, $mr_statics;
|
||||
|
||||
// used for caching
|
||||
$mr_statics = array();
|
||||
|
||||
// initialize client id
|
||||
if (isset($client) && (int) $client > 0) {
|
||||
$clientId = (int) $client;
|
||||
|
@ -69,15 +50,29 @@ if (isset($client) && (int) $client > 0) {
|
|||
|
||||
|
||||
// include necessary sources
|
||||
plugin_include('mod_rewrite', 'classes/class.modrewritedebugger.php');
|
||||
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);
|
||||
|
@ -92,52 +87,51 @@ if (ModRewrite::isEnabled()) {
|
|||
|
||||
$aMrCfg = ModRewrite::getConfig();
|
||||
|
||||
$_cecRegistry = cApiCECRegistry::getInstance();
|
||||
$_cecRegistry = cApiCecRegistry::getInstance();
|
||||
|
||||
// Add new tree function to Contenido Extension Chainer
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// Add copy category function to CONTENIDO Extension Chainer
|
||||
$_cecRegistry->addChainFunction('Contenido.Category.strCopyCategory', 'mr_strCopyCategory');
|
||||
|
||||
// Add category sync function to Contenido Extension Chainer
|
||||
// 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
|
||||
// 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
|
||||
// Add move article function to CONTENIDO Extension Chainer
|
||||
$_cecRegistry->addChainFunction('Contenido.Article.conMoveArticles_Loop', 'mr_conMoveArticles');
|
||||
|
||||
// Add duplicate article function to Contenido Extension Chainer
|
||||
// Add duplicate article function to CONTENIDO Extension Chainer
|
||||
$_cecRegistry->addChainFunction('Contenido.Article.conCopyArtLang_AfterInsert', 'mr_conCopyArtLang');
|
||||
|
||||
// Add sync article function to Contenido Extension Chainer
|
||||
// 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
|
||||
// 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,
|
||||
// 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');
|
||||
|
@ -145,20 +139,21 @@ if (ModRewrite::isEnabled()) {
|
|||
// 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
|
||||
// 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
|
||||
// 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
|
||||
// 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') {
|
||||
|
@ -170,9 +165,3 @@ if (isset($contenido) && isset($area) && $area == 'mod_rewrite_test') {
|
|||
}
|
||||
|
||||
unset($clientId, $options);
|
||||
|
||||
// administration > users > area translations
|
||||
global $lngAct, $_cecRegistry;
|
||||
$lngAct['mod_rewrite']['mod_rewrite'] = i18n("MR-Options", "mod_rewrite");
|
||||
$lngAct['mod_rewrite']['mod_rewrite_expert'] = i18n("Expert Options", "mod_rewrite");
|
||||
$lngAct['mod_rewrite']['mod_rewrite_test'] = i18n("MR Test Area", "mod_rewrite");
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Mod Rewrite front_content.php controller. Does some preprocessing jobs, tries
|
||||
* to set following variables, depending on mod rewrite configuration and if
|
||||
* request part exists:
|
||||
|
@ -14,32 +10,23 @@
|
|||
* - $idart
|
||||
* - $idcat
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-05-xx
|
||||
*
|
||||
* $Id: front_content_controller.php 220 2013-02-14 08:40:43Z Mansveld $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
|
||||
global $client, $changeclient, $cfgClient, $lang, $changelang, $idart, $idcat, $path;
|
||||
global $client, $changeclient, $cfgClient, $lang, $changelang, $idart, $idcat, $path, $mr_preprocessedPageError;
|
||||
|
||||
ModRewriteDebugger::add(ModRewrite::getConfig(), 'front_content_controller.php mod rewrite config');
|
||||
|
||||
|
@ -67,11 +54,9 @@ if ($oMRController->errorOccured()) {
|
|||
'lang' => $lang, 'error' => '1'
|
||||
);
|
||||
$errsite = 'Location: ' . Contenido_Url::getInstance()->buildRedirect($aParams);
|
||||
header("HTTP/1.0 404 Not found");
|
||||
mr_header($errsite);
|
||||
exit();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// set some global variables
|
||||
|
@ -103,11 +88,13 @@ if ($oMRController->errorOccured()) {
|
|||
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__);
|
||||
|
|
|
@ -1,37 +1,33 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* Mod Rewrite front_content.php controller. Does some preprocessing jobs, tries
|
||||
* to set following variables, depending on mod rewrite configuration and if
|
||||
* request part exists:
|
||||
* - $client
|
||||
* - $changeclient
|
||||
* - $lang
|
||||
* - $changelang
|
||||
* - $idart
|
||||
* - $idcat
|
||||
*
|
||||
* Description:
|
||||
* Defines the 'modrewrite' related helper functions
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Stefan Seifarth / stese
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright <EFBFBD> www.polycoder.de
|
||||
* @copyright www.polycoder.de
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2004-12-04
|
||||
* modified 2005-12-18
|
||||
*
|
||||
* $Id: functions.mod_rewrite.php 391 2015-11-09 21:12:36Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
cInclude('classes', 'contenido/class.articlelanguage.php');
|
||||
|
||||
|
||||
/**
|
||||
|
@ -42,8 +38,7 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strNewTree(array $data)
|
||||
{
|
||||
function mr_strNewTree(array $data) {
|
||||
global $lang;
|
||||
|
||||
ModRewriteDebugger::log($data, 'mr_strNewTree $data');
|
||||
|
@ -58,7 +53,6 @@ function mr_strNewTree(array $data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job for created new category.
|
||||
*
|
||||
|
@ -67,8 +61,7 @@ function mr_strNewTree(array $data)
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strNewCategory(array $data)
|
||||
{
|
||||
function mr_strNewCategory(array $data) {
|
||||
global $lang;
|
||||
|
||||
ModRewriteDebugger::log($data, 'mr_strNewCategory $data');
|
||||
|
@ -83,7 +76,6 @@ function mr_strNewCategory(array $data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job for renamed category
|
||||
* 2010-02-01: and now all existing subcategories and modify their paths too...
|
||||
|
@ -94,8 +86,7 @@ function mr_strNewCategory(array $data)
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strRenameCategory(array $data)
|
||||
{
|
||||
function mr_strRenameCategory(array $data) {
|
||||
ModRewriteDebugger::log($data, 'mr_strRenameCategory $data');
|
||||
|
||||
// hes 20100102
|
||||
|
@ -121,8 +112,7 @@ function mr_strRenameCategory(array $data)
|
|||
// hes 20100102
|
||||
$str = 'idcat=' . $oCat->get('idcat') . ' AND idlang=' . (int) $data['lang'];
|
||||
$oCatLanColl = new cApiCategoryLanguageCollection($str);
|
||||
$oCatLan = $oCatLanColl->next();
|
||||
|
||||
if ($oCatLan = $oCatLanColl->next()) {
|
||||
// hes 20100102
|
||||
$childData = array(
|
||||
'idcat' => $oCat->get('idcat'),
|
||||
|
@ -134,11 +124,11 @@ function mr_strRenameCategory(array $data)
|
|||
|
||||
$resData = mr_strRenameCategory($childData);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job after moving a category up.
|
||||
*
|
||||
|
@ -150,8 +140,7 @@ function mr_strRenameCategory(array $data)
|
|||
* @param int $idcat Category id
|
||||
* @return int Category id
|
||||
*/
|
||||
function mr_strMoveUpCategory($idcat)
|
||||
{
|
||||
function mr_strMoveUpCategory($idcat) {
|
||||
ModRewriteDebugger::log($idcat, 'mr_strMoveUpCategory $idcat');
|
||||
|
||||
// category check
|
||||
|
@ -174,7 +163,6 @@ function mr_strMoveUpCategory($idcat)
|
|||
return $idcat;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job after moving a category down.
|
||||
*
|
||||
|
@ -186,8 +174,7 @@ function mr_strMoveUpCategory($idcat)
|
|||
* @param int $idcat Id of category beeing moved down
|
||||
* @return int Category id
|
||||
*/
|
||||
function mr_strMovedownCategory($idcat)
|
||||
{
|
||||
function mr_strMovedownCategory($idcat) {
|
||||
ModRewriteDebugger::log($idcat, 'mr_strMovedownCategory $idcat');
|
||||
|
||||
// category check
|
||||
|
@ -209,7 +196,6 @@ function mr_strMovedownCategory($idcat)
|
|||
return $idcat;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job after moving a category subtree.
|
||||
*
|
||||
|
@ -218,8 +204,7 @@ function mr_strMovedownCategory($idcat)
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strMoveSubtree(array $data)
|
||||
{
|
||||
function mr_strMoveSubtree(array $data) {
|
||||
ModRewriteDebugger::log($data, 'mr_strMoveSubtree $data');
|
||||
|
||||
// category check
|
||||
|
@ -253,7 +238,6 @@ function mr_strMoveSubtree(array $data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job after copying a category subtree.
|
||||
*
|
||||
|
@ -262,8 +246,7 @@ function mr_strMoveSubtree(array $data)
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strCopyCategory(array $data)
|
||||
{
|
||||
function mr_strCopyCategory(array $data) {
|
||||
ModRewriteDebugger::log($data, 'mr_strCopyCategory $data');
|
||||
|
||||
$idcat = (int) $data['newcat']->get('idcat');
|
||||
|
@ -283,7 +266,6 @@ function mr_strCopyCategory(array $data)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job during structure synchronisation process,
|
||||
* sets the urlpath of current category.
|
||||
|
@ -293,14 +275,12 @@ function mr_strCopyCategory(array $data)
|
|||
* @param array $data Assoziative array with some values
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_strSyncCategory(array $data)
|
||||
{
|
||||
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).
|
||||
*
|
||||
|
@ -309,8 +289,7 @@ function mr_strSyncCategory(array $data)
|
|||
* @param array $data Assoziative array with some article properties
|
||||
* @return array Passed parameter
|
||||
*/
|
||||
function mr_conSaveArticle(array $data)
|
||||
{
|
||||
function mr_conSaveArticle(array $data) {
|
||||
global $tmp_firstedit, $client;
|
||||
|
||||
ModRewriteDebugger::log($data, 'mr_conSaveArticle $data');
|
||||
|
@ -342,7 +321,6 @@ function mr_conSaveArticle(array $data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job for articles beeing moved.
|
||||
*
|
||||
|
@ -351,8 +329,7 @@ function mr_conSaveArticle(array $data)
|
|||
* @param array $data Assoziative array with record entries
|
||||
* @return array Loop through of arguments
|
||||
*/
|
||||
function mr_conMoveArticles($data)
|
||||
{
|
||||
function mr_conMoveArticles($data) {
|
||||
ModRewriteDebugger::log($data, 'mr_conMoveArticles $data');
|
||||
|
||||
// too defensive but secure way
|
||||
|
@ -372,7 +349,6 @@ function mr_conMoveArticles($data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job for duplicated articles.
|
||||
*
|
||||
|
@ -381,8 +357,7 @@ function mr_conMoveArticles($data)
|
|||
* @param array $data Assoziative array with record entries
|
||||
* @return array Loop through of arguments
|
||||
*/
|
||||
function mr_conCopyArtLang($data)
|
||||
{
|
||||
function mr_conCopyArtLang($data) {
|
||||
ModRewriteDebugger::log($data, 'mr_conCopyArtLang $data');
|
||||
|
||||
// too defensive but secure way
|
||||
|
@ -401,7 +376,6 @@ function mr_conCopyArtLang($data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Processes mod_rewrite related job for synchronized articles.
|
||||
*
|
||||
|
@ -417,8 +391,7 @@ function mr_conCopyArtLang($data)
|
|||
*
|
||||
* @return array Loop through of argument
|
||||
*/
|
||||
function mr_conSyncArticle($data)
|
||||
{
|
||||
function mr_conSyncArticle($data) {
|
||||
ModRewriteDebugger::log($data, 'mr_conSyncArticle $data');
|
||||
|
||||
// too defensive but secure way
|
||||
|
@ -448,7 +421,6 @@ function mr_conSyncArticle($data)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Works as a wrapper for Contenido_Url.
|
||||
*
|
||||
|
@ -459,8 +431,7 @@ function mr_conSyncArticle($data)
|
|||
* @param string $url URL to rebuild
|
||||
* @return string New URL
|
||||
*/
|
||||
function mr_buildNewUrl($url)
|
||||
{
|
||||
function mr_buildNewUrl($url) {
|
||||
global $lang;
|
||||
|
||||
ModRewriteDebugger::add($url, 'mr_buildNewUrl() in -> $url');
|
||||
|
@ -481,14 +452,15 @@ function mr_buildNewUrl($url)
|
|||
$newUrl .= '#' . $aUrl['fragment'];
|
||||
}
|
||||
|
||||
$arr['in'] = $url;
|
||||
$arr['out'] = $newUrl;
|
||||
$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.
|
||||
*
|
||||
|
@ -498,8 +470,7 @@ function mr_buildNewUrl($url)
|
|||
* @param string $code Code to prepare
|
||||
* @return string New code
|
||||
*/
|
||||
function mr_buildGeneratedCode($code)
|
||||
{
|
||||
function mr_buildGeneratedCode($code) {
|
||||
global $client, $cfgClient;
|
||||
|
||||
ModRewriteDebugger::add($code, 'mr_buildGeneratedCode() in');
|
||||
|
@ -511,11 +482,11 @@ function mr_buildGeneratedCode($code)
|
|||
// anchor hack
|
||||
$code = preg_replace_callback(
|
||||
"/<a([^>]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i",
|
||||
create_function('$arr_matches' , 'return ModRewrite::rewriteHtmlAnchor($arr_matches);'),
|
||||
create_function('$matches', 'return ModRewrite::rewriteHtmlAnchor($matches);'),
|
||||
$code
|
||||
);
|
||||
|
||||
// remove fucking tinymce single quote entities:
|
||||
// remove tinymce single quote entities:
|
||||
$code = str_replace("'", "'", $code);
|
||||
|
||||
// get base uri
|
||||
|
@ -523,7 +494,11 @@ function mr_buildGeneratedCode($code)
|
|||
$sBaseUri = CEC_Hook::execute("Contenido.Frontend.BaseHrefGeneration", $sBaseUri);
|
||||
|
||||
// IE hack with wrong base href interpretation
|
||||
$code = preg_replace("/([\"|\'|=])upload\/(.?|.+?)([\"|\'|>])/ie", "stripslashes('\\1{$sBaseUri}upload/\\2\\3')", $code);
|
||||
$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
|
||||
|
@ -544,12 +519,13 @@ function mr_buildGeneratedCode($code)
|
|||
$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, start mod rewrite class
|
||||
// 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(
|
||||
|
@ -565,7 +541,7 @@ function mr_buildGeneratedCode($code)
|
|||
// anchor hack for non modrewrite websites
|
||||
$code = preg_replace_callback(
|
||||
"/<a([^>]*)href\s*=\s*[\"|\'][\/]#(.?|.+?)[\"|\']([^>]*)>/i",
|
||||
create_function('$arr_matches' , 'return ModRewrite::contenidoHtmlAnchor($arr_matches, $GLOBALS["is_XHTML"]);'),
|
||||
create_function('$matches', 'return ModRewrite::contenidoHtmlAnchor($matches, $GLOBALS["is_XHTML"]);'),
|
||||
$code
|
||||
);
|
||||
}
|
||||
|
@ -573,28 +549,26 @@ function mr_buildGeneratedCode($code)
|
|||
ModRewriteDebugger::add(($sseEndtime - $sseStarttime), 'mr_buildGeneratedCode() total spend time');
|
||||
|
||||
if ($debug = mr_debugOutput(false)) {
|
||||
$code = str_ireplace_once("</body>", $debug . "\n</body>", $code);
|
||||
$code = cString::iReplaceOnce("</body>", $debug . "\n</body>", $code);
|
||||
}
|
||||
|
||||
return $code;
|
||||
// print "\n\n<!-- modrewrite generation time: " . ($sseEndtime - $sseStarttime) . " seconds -->";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sets language of client, like done in front_content.php
|
||||
*
|
||||
* @param int $client Client id
|
||||
*/
|
||||
function mr_setClientLanguageId($client)
|
||||
{
|
||||
function mr_setClientLanguageId($client) {
|
||||
global $lang, $load_lang, $cfg;
|
||||
|
||||
if ((int) $lang > 0) {
|
||||
// there is nothing to do
|
||||
return;
|
||||
} elseif ($load_lang) {
|
||||
// use the first language of this client, load_client is set in cms/config.php
|
||||
// load_client is set in frontend/config.php
|
||||
$lang = $load_lang;
|
||||
return;
|
||||
}
|
||||
|
@ -612,7 +586,6 @@ function mr_setClientLanguageId($client)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Loads Advanced Mod Rewrite configuration for passed client using serialized
|
||||
* file containing the settings.
|
||||
|
@ -624,8 +597,7 @@ function mr_setClientLanguageId($client)
|
|||
* @param bool $forceReload Flag to force to reload configuration, e. g. after
|
||||
* done changes on it
|
||||
*/
|
||||
function mr_loadConfiguration($clientId, $forceReload = false)
|
||||
{
|
||||
function mr_loadConfiguration($clientId, $forceReload = false) {
|
||||
global $cfg;
|
||||
static $aLoaded;
|
||||
|
||||
|
@ -649,7 +621,6 @@ function mr_loadConfiguration($clientId, $forceReload = false)
|
|||
$aLoaded[$clientId] = true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns the mod rewrite configuration array of an client.
|
||||
*
|
||||
|
@ -659,19 +630,12 @@ function mr_loadConfiguration($clientId, $forceReload = false)
|
|||
* @param int $clientId Id of client
|
||||
* @return array|null
|
||||
*/
|
||||
function mr_getConfiguration($clientId)
|
||||
{
|
||||
function mr_getConfiguration($clientId) {
|
||||
global $cfg;
|
||||
|
||||
|
||||
$file = $cfg['path']['config'] . 'config.mod_rewrite_' . $clientId . '.php';
|
||||
if (!is_file($file) || !is_readable($file)) {
|
||||
$file = $cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/includes/config.mod_rewrite_' . $clientId . '.php';
|
||||
if (!is_file($file) || !is_readable($file)) {
|
||||
return null;
|
||||
} else {
|
||||
cWarning(__FILE__, __LINE__, "Configuration file of AMR-Plugin still using plugin folder, move it to data/config folder!");
|
||||
}
|
||||
}
|
||||
if ($content = file_get_contents($file)) {
|
||||
return unserialize($content);
|
||||
|
@ -680,7 +644,6 @@ function mr_getConfiguration($clientId)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Saves the mod rewrite configuration array of an client.
|
||||
*
|
||||
|
@ -691,16 +654,14 @@ function mr_getConfiguration($clientId)
|
|||
* @param array $config Configuration to save
|
||||
* @return bool
|
||||
*/
|
||||
function mr_setConfiguration($clientId, array $config)
|
||||
{
|
||||
function mr_setConfiguration($clientId, array $config) {
|
||||
global $cfg;
|
||||
|
||||
$file = $cfg['path']['config'] . 'config.mod_rewrite_' . $clientId . '.php';
|
||||
$result = file_put_contents($file, serialize($config), LOCK_EX);
|
||||
$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.
|
||||
|
@ -709,8 +670,7 @@ function mr_setConfiguration($clientId, array $config)
|
|||
*
|
||||
* @return bool Just a return value
|
||||
*/
|
||||
function mr_runFrontendController()
|
||||
{
|
||||
function mr_runFrontendController() {
|
||||
$iStartTime = getmicrotime();
|
||||
|
||||
plugin_include('mod_rewrite', 'includes/config.plugin.php');
|
||||
|
@ -725,7 +685,6 @@ function mr_runFrontendController()
|
|||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Cleanups passed string from characters beeing repeated two or more times
|
||||
*
|
||||
|
@ -733,23 +692,20 @@ function mr_runFrontendController()
|
|||
* @param string $string String to clean from character
|
||||
* @return string Cleaned string
|
||||
*/
|
||||
function mr_removeMultipleChars($char, $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)
|
||||
{
|
||||
function mr_i18n($key) {
|
||||
global $lngAMR;
|
||||
return (is_array($lngAMR) && isset($lngAMR[$key])) ? $lngAMR[$key] : 'n. a.';
|
||||
}
|
||||
|
@ -757,7 +713,6 @@ function mr_i18n($key)
|
|||
################################################################################
|
||||
### 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.
|
||||
|
@ -765,7 +720,7 @@ function mr_i18n($key)
|
|||
* Minimizes following code:
|
||||
* <code>
|
||||
* // default way
|
||||
* $db = new DB_ConLite();
|
||||
* $db = new DB_Contenido();
|
||||
* $sql = "SELECT * FROM foo WHERE bar='foobar'";
|
||||
* $db->query($sql);
|
||||
* $db->next_record();
|
||||
|
@ -779,11 +734,10 @@ function mr_i18n($key)
|
|||
* @param string $query Query to execute
|
||||
* @return mixed Assoziative array including recordset or null
|
||||
*/
|
||||
function mr_queryAndNextRecord($query)
|
||||
{
|
||||
function mr_queryAndNextRecord($query) {
|
||||
static $db;
|
||||
if (!isset($db)) {
|
||||
$db = new DB_ConLite();
|
||||
$db = new DB_Contenido();
|
||||
}
|
||||
if (!$db->query($query)) {
|
||||
return null;
|
||||
|
@ -791,7 +745,6 @@ function mr_queryAndNextRecord($query)
|
|||
return ($db->next_record()) ? $db->Record : null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns value of an array key (assoziative or indexed).
|
||||
*
|
||||
|
@ -823,8 +776,7 @@ function mr_queryAndNextRecord($query)
|
|||
* @param mixed $default Default value to return
|
||||
* @return mixed Either the found value or the default value
|
||||
*/
|
||||
function mr_arrayValue($array, $key, $default = null)
|
||||
{
|
||||
function mr_arrayValue($array, $key, $default = null) {
|
||||
if (!is_array($array)) {
|
||||
return $default;
|
||||
} elseif (!isset($array[$key])) {
|
||||
|
@ -834,7 +786,6 @@ function mr_arrayValue($array, $key, $default = null)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Request cleanup function. Request data is allways tainted and must be filtered.
|
||||
* Pass the array to cleanup using several options.
|
||||
|
@ -859,8 +810,7 @@ function mr_arrayValue($array, $key, $default = null)
|
|||
*
|
||||
* @return mixed Cleaned data
|
||||
*/
|
||||
function mr_requestCleanup(&$data, $options = null)
|
||||
{
|
||||
function mr_requestCleanup(&$data, $options = null) {
|
||||
if (!mr_arrayValue($options, 'filter')) {
|
||||
$options['filter'] = array('trim', 'strip_tags', 'stripslashes');
|
||||
}
|
||||
|
@ -885,7 +835,6 @@ function mr_requestCleanup(&$data, $options = null)
|
|||
return $data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Minimalistic'n simple way to get request variables.
|
||||
*
|
||||
|
@ -895,8 +844,7 @@ function mr_requestCleanup(&$data, $options = null)
|
|||
* @param mixed $default Default value to return
|
||||
* @return mixed The value
|
||||
*/
|
||||
function mr_getRequest($key, $default = null)
|
||||
{
|
||||
function mr_getRequest($key, $default = null) {
|
||||
static $cache;
|
||||
if (!isset($cache)) {
|
||||
$cache = array();
|
||||
|
@ -915,16 +863,15 @@ function mr_getRequest($key, $default = null)
|
|||
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;
|
||||
function mr_header($header) {
|
||||
header($header);
|
||||
return;
|
||||
|
||||
$header = str_replace('Location: ', '', $header);
|
||||
echo '<html>
|
||||
|
@ -936,15 +883,13 @@ function mr_header($header)
|
|||
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)
|
||||
{
|
||||
function mr_debugOutput($print = true) {
|
||||
global $DB_Contenido_QueryCache;
|
||||
if (isset($DB_Contenido_QueryCache) && is_array($DB_Contenido_QueryCache) &&
|
||||
count($DB_Contenido_QueryCache) > 0) {
|
||||
|
|
|
@ -1,52 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin mod_rewrite backend include file to administer settings (in content frame)
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2008-04-22
|
||||
* modified 2011-05-17 Murat Purc, added check for available client id
|
||||
*
|
||||
* $Id: include.mod_rewrite_content.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
global $client, $cfg;
|
||||
|
||||
################################################################################
|
||||
##### Initialization
|
||||
|
||||
if ((int) $client <= 0) {
|
||||
// if there is no client selected, display empty page
|
||||
$oPage = new cPage();
|
||||
$sMsg = $notification->returnNotification(
|
||||
Contenido_Notification::LEVEL_ERROR, i18n("No Client selected")
|
||||
);
|
||||
$oPage->setContent($sMsg);
|
||||
$oPage = new cPage;
|
||||
$oPage->render();
|
||||
return;
|
||||
}
|
||||
|
||||
plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_content_controller.php');
|
||||
|
||||
$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index';
|
||||
$bDebug = false;
|
||||
|
@ -97,14 +79,26 @@ $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->htaccess_info_css = 'display:table-row;';
|
||||
$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
|
||||
|
@ -180,138 +174,132 @@ $oView->rewrite_routing = $data;
|
|||
$oView->redirect_invalid_article_to_errorsite_chk = ($aMrCfg['redirect_invalid_article_to_errorsite'] == 1) ? ' checked="checked"' : '';
|
||||
|
||||
|
||||
$oView->lng_version = i18n('Version', 'mod_rewrite');
|
||||
$oView->lng_author = i18n('Author', 'mod_rewrite');
|
||||
$oView->lng_mail_to_author = i18n('E-Mail to author', 'mod_rewrite');
|
||||
$oView->lng_pluginpage = i18n('Plugin page', 'mod_rewrite');
|
||||
$oView->lng_visit_pluginpage = i18n('Visit plugin page', 'mod_rewrite');
|
||||
$oView->lng_opens_in_new_window = i18n('opens page in new window', 'mod_rewrite');
|
||||
$oView->lng_contenido_forum = i18n('Contenido forum', 'mod_rewrite');
|
||||
$oView->lng_pluginthread_in_contenido_forum = i18n('Plugin thread in Contenido forum', 'mod_rewrite');
|
||||
$oView->lng_plugin_settings = i18n('Plugin settings', 'mod_rewrite');
|
||||
$oView->lng_note = i18n('Note', 'mod_rewrite');
|
||||
$oView->lng_version = i18n("Version", "mod_rewrite");
|
||||
$oView->lng_author = i18n("Author", "mod_rewrite");
|
||||
$oView->lng_mail_to_author = i18n("E-Mail to author", "mod_rewrite");
|
||||
$oView->lng_pluginpage = i18n("Plugin page", "mod_rewrite");
|
||||
$oView->lng_visit_pluginpage = i18n("Visit plugin page", "mod_rewrite");
|
||||
$oView->lng_opens_in_new_window = i18n("opens page in new window", "mod_rewrite");
|
||||
$oView->lng_contenido_forum = i18n("CONTENIDO forum", "mod_rewrite");
|
||||
$oView->lng_pluginthread_in_contenido_forum = i18n("Plugin thread in CONTENIDO forum", "mod_rewrite");
|
||||
$oView->lng_plugin_settings = i18n("Plugin settings", "mod_rewrite");
|
||||
$oView->lng_note = i18n("Note", "mod_rewrite");
|
||||
|
||||
$sMsg = i18n('The .htaccess file could not found either in Contenido installation directory nor in client directory.<br />It should set up in %sFunctions%s area, if needed.', '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.<br>It should set up in %sFunctions%s area, if needed.", "mod_rewrite");
|
||||
$oView->lng_msg_no_htaccess_found = sprintf($sMsg, '<a href="main.php?area=mod_rewrite_expert&frame=4&contenido=' . $oView->sessid . '&idclient=' . $client . '" onclick="parent.right_top.sub.clicked(parent.right_top.document.getElementById(\'c_1\').firstChild);">', '</a>');
|
||||
|
||||
$oView->lng_enable_amr = i18n('Enable Advanced Mod Rewrite', 'mod_rewrite');
|
||||
$sMsg = i18n("Found", "mod_rewrite");
|
||||
$oView->lng_msg_no_emptyaliases_found = sprintf($sMsg, '<a href="main.php?area=mod_rewrite_expert&frame=4&contenido=' . $oView->sessid . '&idclient=' . $client . '" onclick="parent.right_top.sub.clicked(parent.right_top.document.getElementById(\'c_1\').firstChild);">', '</a>');
|
||||
|
||||
$oView->lng_msg_enable_amr_info = i18n('Disabling of plugin does not result in disabling mod rewrite module of the web server - This means,<br /> all defined rules in the .htaccess are still active and could create unwanted side effects.<br /><br />Apache mod rewrite could be enabled/disabled by setting the RewriteEngine directive.<br />Any defined rewrite rules could remain in the .htaccess and they will not processed,<br />if the mod rewrite module is disabled', 'mod_rewrite');
|
||||
$oView->lng_enable_amr = i18n("Enable Advanced Mod Rewrite", "mod_rewrite");
|
||||
|
||||
$oView->lng_example = i18n('Example', '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,<br> all defined rules in the .htaccess are still active and could create unwanted side effects.<br><br>Apache mod rewrite could be enabled/disabled by setting the RewriteEngine directive.<br>Any defined rewrite rules could remain in the .htaccess and they will not processed,<br>if the mod rewrite module is disabled", "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_example = i18n("Example", "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.<br />Type the path to the subfolder fromm wwwroot, if Contenido is installed in a subfolder within the wwwroot<br />(e. g. http://domain/mycontenido -> path = '/mycontenido/')", '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_checkrootdir = i18n('Check path to .htaccess', 'mod_rewrite');
|
||||
$oView->lng_checkrootdir_info = i18n('The path will be checked, if this option is enabled.<br />But this could result in an error in some cases, even if the specified path is valid and<br />clients DocumentRoot differs from Contenido backend DocumentRoot.', '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.<br>Type the path to the subfolder fromm wwwroot, if CONTENIDO is installed in a subfolder within the wwwroot<br>(e. g. http://domain/mycontenido -> path = '/mycontenido/')", "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_checkrootdir = i18n("Check path to .htaccess", "mod_rewrite");
|
||||
$oView->lng_checkrootdir_info = i18n("The path will be checked, if this option is enabled.<br>But this could result in an error in some cases, even if the specified path is valid and<br>clients DocumentRoot differs from CONTENIDO backend DocumentRoot.", "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_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_language = i18n('Should the language appear in the URL (required for multi language websites)?', 'mod_rewrite');
|
||||
$oView->lng_use_language_lbl = i18n('Prepend language to the URL', 'mod_rewrite');
|
||||
$oView->lng_use_language_name_lbl = i18n('Use language name instead of the id', 'mod_rewrite');
|
||||
$oView->lng_use_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_userdefined_separators_header = i18n('Configure your own separators with following 4 settings<br />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_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_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_userdefined_separators_header = i18n("Configure your own separators with following 4 settings<br>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_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<br />In case of selected "Append article name always to URLs" option and a empty field,<br />the name of the start article will be used', '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_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<br />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,<br />if the option "Append article name always to URLs" was not selected.<br /><br />Otherwise URLs to categories and articles would have the same format<br />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_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<br>In case of selected 'Append article name always to URLs' option and a empty field,<br>the name of the start article will be used", "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_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<br>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,<br>if the option 'Append article name always to URLs' was not selected.<br><br>Otherwise URLs to categories and articles would have the same format<br>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_prevent_duplicated_content = i18n('Duplicated content', 'mod_rewrite');
|
||||
$oView->lng_prevent_duplicated_content_lbl = i18n('Prevent duplicated content', '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_info = i18n('Depending on configuration, pages could be found thru different URLs.<br/>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 = 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.<br>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 = '<li>' . str_replace("\n", '</li><li>', $oView->lng_prevent_duplicated_content_info2) . '</li>';
|
||||
|
||||
$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<br />to prepend e. g. the root category, language and/or client to the URL,<br />the specified percentage will not applied to those parts of the URL.<br />A incoming URL will be cleaned from those values and the remaining path (urlpath of the category)<br />will be checked against similarities.', 'mod_rewrite');
|
||||
$oView->lng_category_resolve_min_percentage_example = i18n("100 = exact match with no tolerance\n85 = paths with little errors will match to similar ones\n0 = matching will work even for total wrong paths", 'mod_rewrite');
|
||||
$oView->lng_category_resolve_min_percentage = i18n("Percentage for similar category paths in URLs", "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<br>to prepend e. g. the root category, language and/or client to the URL,<br>the specified percentage will not applied to those parts of the URL.<br>An incoming URL will be cleaned from those values and the remaining path (urlpath of the category)<br>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_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<br />as usual as in previous Contenido versions using a format like "front_content.php?idcat=1&idart=2".<br />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.<br />Doing it this way reduces the amount of executed database significantly.", '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<br>as usual as in previous CONTENIDO versions using a format like 'front_content.php?idcat=1&idart=2'.<br>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.<br>Doing it this way reduces the amount of executed database significantly.", "mod_rewrite");
|
||||
$oView->lng_rewrite_urls_at_front_content_output_info3 = '<li>' . str_replace("\n", '</li><li>', $oView->rewrite_urls_at_front_content_output_info3) . '</li>';
|
||||
|
||||
$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.<br />This means, all areas in modules/plugins, who generate internal URLs to categories/articles, have to be adapted manually.<br />All Clean-URLs have to be generated by using following function:', 'mod_rewrite');
|
||||
$oView->lng_rewrite_urls_at_congeneratecode_example = i18n("# structure of a normal url\n\$url = 'front_content.php?idart=123&lang=2&client=1';\n\n# creation of a url by using the Contenidos Url-Builder (since 4.8.9),\n# wich expects the parameter as a assoziative array\n\$params = array('idart'=>123, 'lang'=>2, 'client'=>1);\n\$newUrl = Contenido_Url::getInstance()->build(\$params);", 'mod_rewrite');
|
||||
$oView->lng_rewrite_urls_at_congeneratecode_info2 = i18n('Differences to variant a.)', 'mod_rewrite');
|
||||
$oView->lng_rewrite_urls_at_congeneratecode_info3 = i18n("The default way to generate URLs to fronend pages\nEach URL in modules/plugins has to be generated by UrlBuilder\nEach generated Clean-Url requires a database query", 'mod_rewrite');
|
||||
$oView->lng_rewrite_urls_at_congeneratecode_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.<br>This means, all areas in modules/plugins, who generate internal URLs to categories/articles, have to be adapted manually.<br>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 = '<li>' . str_replace("\n", '</li><li>', $oView->lng_rewrite_urls_at_congeneratecode_info3) . '</li>';
|
||||
|
||||
$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<br />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<br />to valid Contenido articles/categories\nDestination URLs should point to real URLs to categories/articles,<br />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<br />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<br />e. g. front_content.php?idcat=23&client=2\nThe destination URL should not start with '/' or './' (wrong: /front_content.php, correct: front_content.php)", 'mod_rewrite');
|
||||
$oView->lng_rewrite_routing = i18n("Routing", "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<br>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<br>to valid CONTENIDO articles/categories\nDestination URLs should point to real URLs to categories/articles,<br>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<br>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<br>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 = '<li>' . str_replace("\n", '</li><li>', $oView->lng_rewrite_routing_info3) . '</li>';
|
||||
|
||||
$oView->lng_discard_changes = i18n('Discard changes', 'mod_rewrite');
|
||||
$oView->lng_save_changes = i18n('Save changes', 'mod_rewrite');
|
||||
$oView->lng_discard_changes = i18n("Discard changes", "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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
/**
|
||||
* Plugin mod_rewrite backend include file (in content-top frame)
|
||||
*
|
||||
* @date 22.04.2008
|
||||
* @author Murat Purc
|
||||
* @copyright © Murat Purc 2008
|
||||
* @package Contenido
|
||||
* @subpackage ModRewrite
|
||||
*/
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
|
||||
$tpl = new Template();
|
||||
$tpl->generate(
|
||||
$cfg['path']['contenido'] . $cfg['path']['plugins'] . 'mod_rewrite/templates/content_top.html', 0, 0
|
||||
);
|
|
@ -1,53 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin mod_rewrite backend include file to administer expert (in content frame)
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
* modified 2011-05-17 Murat Purc, added check for available client id
|
||||
*
|
||||
* $Id: include.mod_rewrite_contentexpert.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
|
||||
global $client, $cfg;
|
||||
|
||||
################################################################################
|
||||
##### Initialization
|
||||
|
||||
if ((int) $client <= 0) {
|
||||
// if there is no client selected, display empty page
|
||||
$oPage = new cPage();
|
||||
$sMsg = $notification->returnNotification(
|
||||
Contenido_Notification::LEVEL_ERROR, i18n("No Client selected")
|
||||
);
|
||||
$oPage->setContent($sMsg);
|
||||
$oPage = new cPage;
|
||||
$oPage->render();
|
||||
return;
|
||||
}
|
||||
|
||||
plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contentexpert_controller.php');
|
||||
|
||||
$action = (isset($_REQUEST['mr_action'])) ? $_REQUEST['mr_action'] : 'index';
|
||||
$debug = false;
|
||||
|
||||
|
@ -77,86 +58,55 @@ $oView->content_after = '';
|
|||
$oMrController->setProperty('htaccessInfo', $aHtaccessInfo);
|
||||
|
||||
// view language variables
|
||||
$oView->lng_plugin_functions = i18n('Plugin functions', 'mod_rewrite');
|
||||
$oView->lng_plugin_functions = i18n("Plugin functions", "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.<br />
|
||||
All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, mov, <br />
|
||||
mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom rewriting.<br />
|
||||
Remaining requests will be rewritten to front_content.php,<br />
|
||||
except requests to \'contenido/\', \'setup/\', \'cms/upload\', \'cms/front_content.php\', etc.<br />
|
||||
Each resource, which has to be excluded from rewriting must be specified explicitly.', 'mod_rewrite');
|
||||
$oView->lng_copy_htaccess_type = i18n("Copy/Download .htaccess template", "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.<br>All requests pointing to extension avi, css, doc, flv, gif, gzip, ico, jpeg, jpg, js, mov, <br>mp3, pdf, png, ppt, rar, txt, wav, wmv, xml, zip, will be excluded vom rewriting.<br>Remaining requests will be rewritten to front_content.php,<br>except requests to 'contenido/', 'setup/', 'cms/upload', 'cms/front_content.php', etc.<br>Each resource, which has to be excluded from rewriting must be specified explicitly.", "mod_rewrite");
|
||||
|
||||
$oView->lng_copy_htaccess_type_info2 = i18n('Contains a sipmle collection of rules. Each requests pointing to valid symlinks, folders or<br />
|
||||
files, will be excluded from rewriting. Remaining requests will be rewritten to front_content.php', 'mod_rewrite');
|
||||
$oView->lng_copy_htaccess_type_info2 = i18n("Contains a simple collection of rules. Each requests pointing to valid symlinks, folders or<br>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<br />
|
||||
<br />
|
||||
{CONTENIDO_FULL_PATH}.<br />
|
||||
<br />
|
||||
This is the recommended option for a Contenido installation with one or more clients<br />
|
||||
who are running on the same domain.', '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<br><br> {CONTENIDO_FULL_PATH}.<br><br>This is the recommended option for a CONTENIDO installation with one or more clients<br>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<br />
|
||||
<br />
|
||||
{CLIENT_FULL_PATH}.<br />
|
||||
<br />
|
||||
This is the recommended option for a multiple client system<br />
|
||||
where each client has it\'s own domain/subdomain', 'mod_rewrite');
|
||||
$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<br><br> {CLIENT_FULL_PATH}.<br><br>This is the recommended option for a multiple client system<br>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<br />
|
||||
or to take over the settings manually.', 'mod_rewrite');
|
||||
$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<br>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.<br />
|
||||
The aliases will not contain the configured plugin separators, but the Contenido default separators \'/\' und \'-\', e. g. \'/category-word/article-word\'.<br />
|
||||
Execution of this function ma be helpful to prepare all or empty aliases for the usage by the plugin.', 'mod_rewrite');
|
||||
$oView->lng_resetaliases = i18n("Reset category-/ and article aliases", "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.<br>The aliases will not contain the configured plugin separators, but the CONTENIDO default separators '/' und '-', e. g. '/category-word/article-word'.<br>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');
|
||||
$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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,42 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Testscript for Advanced Mod Rewrite Plugin.
|
||||
*
|
||||
* The goal of this testscript is to provide an easy way for a variance comparison
|
||||
* of created SEO URLs against their resolved parts.
|
||||
*
|
||||
* This testscript fetches the full category and article structure of actual
|
||||
* Contenido installation, creates the SEO URLs for each existing category/article
|
||||
* CONTENIDO installation, creates the SEO URLs for each existing category/article
|
||||
* and resolves the generated URLs.
|
||||
*
|
||||
* Requirements:
|
||||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @version 0.1
|
||||
* @package plugin
|
||||
* @subpackage Mod Rewrite
|
||||
* @version SVN Revision $Rev:$
|
||||
* @id $Id$:
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
* modified 2011-05-17 Murat Purc, added check for available client id
|
||||
*
|
||||
* $Id: include.mod_rewrite_contenttest.php 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
||||
if (!defined('CON_FRAMEWORK')) {
|
||||
die('Illegal call');
|
||||
}
|
||||
|
||||
defined('CON_FRAMEWORK') or die('Illegal call');
|
||||
global $client, $cfg;
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -44,17 +32,11 @@ defined('CON_FRAMEWORK') or die('Illegal call');
|
|||
|
||||
if ((int) $client <= 0) {
|
||||
// if there is no client selected, display empty page
|
||||
$oPage = new cPage();
|
||||
$sMsg = $notification->returnNotification(
|
||||
Contenido_Notification::LEVEL_ERROR, i18n("No Client selected")
|
||||
);
|
||||
$oPage->setContent($sMsg);
|
||||
$oPage = new cPage;
|
||||
$oPage->render();
|
||||
return;
|
||||
}
|
||||
|
||||
plugin_include('mod_rewrite', 'classes/controller/class.modrewrite_contenttest_controller.php');
|
||||
|
||||
|
||||
################################################################################
|
||||
##### Processing
|
||||
|
@ -70,21 +52,14 @@ $oMrTestController = new ModRewrite_ContentTestController();
|
|||
|
||||
// view language variables
|
||||
$oView = $oMrTestController->getView();
|
||||
$oView->lng_form_info = i18n('Define options to genereate the URLs by using the form below and run the test.', 'mod_rewrite');
|
||||
$oView->lng_form_label = i18n('Parameter to use', 'mod_rewrite');
|
||||
$oView->lng_maxitems_lbl = i18n('Number of URLs to generate', 'mod_rewrite');
|
||||
$oView->lng_run_test = i18n('Run test', 'mod_rewrite');
|
||||
$oView->lng_form_info = i18n("Define options to genereate the URLs by using the form below and run the test.", "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}<strong>{name}</strong>
|
||||
{pref}Builder in: {url_in}
|
||||
{pref}Builder out: {url_out}
|
||||
{pref}<span style="color:{color}">Resolved URL: {url_res}</span>
|
||||
{pref}Resolved data: {data}', 'mod_rewrite');
|
||||
$oView->lng_result_item_tpl = i18n("{pref}<strong>{name}</strong><br>{pref}Builder in: {url_in}<br>{pref}Builder out: {url_out}<br>{pref}<span style='color:{color}'>Resolved URL: {url_res}</span><br>{pref}Resolver err: {err}<br>{pref}Resolved data: {data}", "mod_rewrite");
|
||||
|
||||
$oView->lng_result_message_tpl = i18n('Duration of test run: {time} seconds.<br />
|
||||
Number of processed URLs: {num_urls}<br />
|
||||
<span style="color:green">Successful resolved: {num_success}</span><br />
|
||||
<span style="color:red">Errors during resolving: {num_fail}</span></strong>', 'mod_rewrite');
|
||||
$oView->lng_result_message_tpl = i18n("Duration of test run: {time} seconds.<br>Number of processed URLs: {num_urls}<br><span style='color:green'>Successful resolved: {num_success}</span><br><span style='color:red'>Errors during resolving: {num_fail}</span></strong>", "mod_rewrite");
|
||||
|
||||
|
||||
################################################################################
|
||||
|
|
Binäre Datei nicht angezeigt.
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
Datei-Diff unterdrückt, da er zu groß ist
Diff laden
|
@ -1,22 +1,24 @@
|
|||
./classes/class.modrewriteurlutil.php
|
||||
./classes/class.modrewriteurlstack.php
|
||||
./classes/class.modrewritecontroller.php
|
||||
./classes/class.modrewritedebugger.php
|
||||
./classes/class.modrewrite.php
|
||||
./includes/include.mod_rewrite_content.php
|
||||
./includes/include.mod_rewrite_contenttest.php
|
||||
./includes/functions.mod_rewrite.php
|
||||
./includes/include.mod_rewrite_contentexpert.php
|
||||
./includes/front_content_controller.php
|
||||
./includes/config.mod_rewrite_default.php
|
||||
./includes/include.mod_rewrite_content_top.php
|
||||
./includes/config.plugin.php
|
||||
./external/aToolTip/demos.html
|
||||
./templates/content.html
|
||||
./templates/contenttest.html
|
||||
./templates/content_top.html
|
||||
./templates/contentexpert.html
|
||||
./classes/controller/class.modrewrite_contenttest_controller.php
|
||||
./classes/controller/class.modrewrite_contentexpert_controller.php
|
||||
./classes/controller/class.modrewrite_controller_abstract.php
|
||||
./classes/controller/class.modrewrite_content_controller.php
|
||||
./classes/controller/class.modrewrite_contentexpert_controller.php
|
||||
./classes/controller/class.modrewrite_contenttest_controller.php
|
||||
./classes/class.modrewritebase.php
|
||||
./classes/class.modrewritedebugger.php
|
||||
./classes/class.modrewritetest.php
|
||||
./external/aToolTip/demos.html
|
||||
./templates/contenttest.html
|
||||
./templates/contentexpert.html
|
||||
./templates/content.html
|
||||
./includes/functions.mod_rewrite.php
|
||||
./includes/include.mod_rewrite_content.php
|
||||
./includes/config.mod_rewrite_default.php
|
||||
./includes/include.mod_rewrite_contenttest.php
|
||||
./includes/config.plugin.php
|
||||
./includes/front_content_controller.php
|
||||
./includes/include.mod_rewrite_contentexpert.php
|
||||
./classes/class.modrewrite.php
|
||||
./classes/class.modrewriteurlstack.php
|
||||
./classes/class.modrewritebase.php
|
||||
./classes/class.modrewritecontroller.php
|
||||
./classes/class.modrewriteurlutil.php
|
||||
|
|
|
@ -1,294 +0,0 @@
|
|||
Advanced Mod Rewrite Plugin für Contenido >= 4.8.15
|
||||
|
||||
################################################################################
|
||||
TOC (Table of contents)
|
||||
|
||||
- BESCHREIBUNG
|
||||
- CHANGELOG
|
||||
- BEKANNTE BUGS
|
||||
- FEATURES
|
||||
- VORAUSSETZUNGEN
|
||||
- INSTALLATION
|
||||
- FAQ
|
||||
- ADVANCED MOD REWRITE THEMEN IM CONTENIDO FORUM
|
||||
- SCHLUSSBEMERKUNG
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
BESCHREIBUNG
|
||||
|
||||
Das Plugin Advanced Mod Rewrite ist eine Erweiterung für das Contenido-CMS zur Generierung von
|
||||
alternativen URLs.
|
||||
|
||||
Normalerweise werden die URLs zu Seiten einer auf ein CMS (z. B. Contenido) basierenden
|
||||
Webpräsenz nach dem Muster "/index.php?page=12&language=de" generiert, also in Form von
|
||||
dynamischen URLs. Eine Möglichkeit solche dynamische URLs zu Webseiten, deren Inhalt in der Regel
|
||||
aus Datenbanken kommen, gegen statische URLs wie z. B. "/de/page-name.html" umzustellen, gibt es in
|
||||
Kombination mit dem Apache mod_rewrite-Modul. Dabei werden die URLs zu den Seiten als sogenannte
|
||||
"Clean URLs" ausgegeben, Requests zur der gewünschten Ressource werden vom Webserver nach
|
||||
definierten Regeln verarbeitet und intern an die Webanwendung weitergeleitet.
|
||||
|
||||
Solche statische URLs können aufgrund der Keyworddichte (die Ressource beschreibende Wörter in der
|
||||
URL) vorteilhaft für Suchmaschinen sein und User können sich die URLs einfacher merken.
|
||||
|
||||
Bei einer Contenido-Installation lassen sich solche URLs mit dem Advanced Mod Rewrite Plugin
|
||||
generieren, URLs zu Frontendseiten, wie z. B. "/cms/front_content.php?idart=12&lang=1" werden
|
||||
vom Plugin als statische URLs wie "/de/page-name.html" ausgegeben. Diverse Einstellungen zum
|
||||
Ausgabeformat der URLs lassen sich im Contenido-Backend konfigurieren.
|
||||
|
||||
Das Plugin Advanced Mod Rewrite basiert auf die geniale Erweiterung Advanced Mod Rewrite für
|
||||
Contenido, welches als Bundle von stese bis zur Contenido Version 4.6.15 entwickelt und betreut
|
||||
wurde.
|
||||
|
||||
Wichtiger Aspekt bei der Umsetzung war die Implementierung als Plugin mit so wenig wie möglichen
|
||||
Eingriffen in den Contenido Core (trotzdem ging es nicht ohne einige Anpassungen an bestimmten
|
||||
Sourcen).
|
||||
|
||||
Daher enthält das Archiv einige überarbeitete Contenido Sourcen, die eventuell nicht auf dem
|
||||
neuesten Stand sein können.
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
CHANGELOG
|
||||
|
||||
2011-04-11 Advanced Mod Rewrite Plugin integration into the Contenido core
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
BEKANNTE BUGS
|
||||
|
||||
Urls sollten unbedingt eine Endung wie z. B. '.html' bekommen, da ansonsten die Erkennungsroutine den
|
||||
Artikel aus der ankommenden URL nicht ermitteln kann.
|
||||
|
||||
Wenn der Clean-URL die Sprache oder der Mandant vorangestellt wird, funktioniert die Fehlererkennung
|
||||
unter Unständen nicht richtig, d. h. es gibt keine Weiterleitung zur Fehlerseite, sofern dies im
|
||||
Plugin eingestellt wurde.
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
FEATURES
|
||||
|
||||
- Erstellung Suchmaschinenoptimierter URLs, Contenido interne URLs wie
|
||||
/front_content.php?idcat=12&idart=34 werden z. B. als /kategoriename/artikelname.html umschrieben
|
||||
- Unterstützung mehrerer Sprachen
|
||||
- Unterstützung mehrerer Mandanten im gleichen Verzeichnis
|
||||
- Umschreiben der URLs entweder bei der Ausgabe des HTML Codes oder beim Generieren des Codes der
|
||||
Seiten
|
||||
- Routing von URLs (Umleiten eingehender URLs auf andere Ziel-URLs)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
VORAUSSETZUNGEN
|
||||
|
||||
- Alle Voraussetzungen von Contenido 4.8.x gelten auch für das Plugin
|
||||
- PHP ab Version 5.1 (Das Plugin war bis Version 0.3.3 PHP 4.4.x kompatibel)
|
||||
- Apache HTTP Server 2 mit Mod Rewrite
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
INSTALLATION
|
||||
|
||||
Das Plugin kann im Contenido Setupprocess installiert werden.
|
||||
|
||||
################################################################################
|
||||
WICHTIGES ZUM INHALT
|
||||
|
||||
ALLGEMEIN
|
||||
=========
|
||||
|
||||
.htaccess:
|
||||
----------
|
||||
Die Konfiguration des Apache, in der das mod_rewrite-Modul aktiviert und mit diversen Anweisungen
|
||||
konfiguriert wird. Die Einstellungen bewirken, dass ankommende Anfragen wie z. B.
|
||||
/kategorie/artikel.html an die front_content.php im Mandantenverzeichnis weitergeleitet werden.
|
||||
|
||||
Die .htaccess liegt nicht im Contenido Installationsverzeichnis vor, es muss entweder dorthin
|
||||
kopiert oder eine vorhanene .htaccess Datei angepasst werden.
|
||||
|
||||
Als Vorlage existieren folgende 2 Versionen der .htaccess:
|
||||
|
||||
htaccess_restrictive.txt:
|
||||
Enthält Regeln mit restriktiveren Einstellungen.
|
||||
Alle Anfragen, die auf die Dateienendung js, ico, gif, jpg, jpeg, png, css, pdf gehen, werden vom
|
||||
Umschreiben ausgeschlossen. Alle anderen Anfragen, werden an front_content.php umschrieben.
|
||||
Ausgeschlossen davon sind 'contenido/', 'setup/', 'cms/upload', 'cms/front_content.php', usw.
|
||||
Jede neue Ressource, die vom Umschreiben ausgeschlossen werden soll, muss explizit definiert werden.
|
||||
|
||||
htaccess_simple.txt:
|
||||
Enthält eine einfachere Sammlung an Regeln. Alle Anfragen, die auf gültige symlinks, Verzeichnisse oder
|
||||
Dateien gehen, werden vom Umschreiben ausgeschlossen. Restliche Anfragen werden an front_content.php
|
||||
umschrieben.
|
||||
|
||||
|
||||
contenido/plugins/mod_rewrite/*:
|
||||
--------------------------------
|
||||
Die Sourcen des Plugins.
|
||||
|
||||
contenido/classes/UrlBuilder/Contenido_UrlBuilder_MR.class.php:
|
||||
---------------------------------------------------------------
|
||||
UrlBuilder Klasse des Plugins (seit Version 0.4.0), zum Generieren der URLs anhand der Pluginkonfiguration.
|
||||
Verwendet die in den Contenido Core implementierte UrlBuilder-Funktionalität und erweitert diesen um die
|
||||
pluginspezifischen Features.
|
||||
|
||||
|
||||
################################################################################
|
||||
FAQ
|
||||
|
||||
Der Plugininstaller lässt sich nicht aufrufen, wie kann ich dennoch das Plugin installieren?
|
||||
--------------------------------------------------------------------------------------------
|
||||
Normalerweise wird der Plugininstaller mit folgender URL aufgerufen:
|
||||
http://localhost/contenido/plugins/mod_rewrite/install.php
|
||||
("http://localhost/" ist eventuell gegen anderen virtual Host oder Domainnamen ersetzen)
|
||||
|
||||
Es erscheint das Anmeldeformular zum Backend, über den man sich am System anmelden kann. Nach
|
||||
erfolgreicher Anmeldung wird man normalerweise zum Plugininstaller weitergeleitet.
|
||||
|
||||
Manchmal kann es vorkommen, dass die Weiterleitung nach der Anmeldung nicht klappt und man nicht den
|
||||
Plugininstaller aufrufen kann.
|
||||
Um dennoch den Installer aufzurufen, reicht es aus, der URL die aktuell gültige Contenido Session ID
|
||||
anzuhängen, z. B. /contenido/plugins/mod_rewrite/install.php?contenido={my_session_id}.
|
||||
|
||||
|
||||
Wie teste ich, ob mod_rewrite am Server richtig konfiguriert ist?
|
||||
-----------------------------------------------------------------
|
||||
Obwohl mod_rewrite am Server installiert ist, kommt es manchmal vor, dass es nicht funktioniert.
|
||||
|
||||
Das kann einfach getestet werden, erstelle eine .htaccess im Rootverzeichnis und schreibe folgendes
|
||||
rein:
|
||||
[code]
|
||||
RewriteEngine on
|
||||
RewriteRule ^ http://www.contenido.org [R,L]
|
||||
[/code]
|
||||
|
||||
Nach Eingabe der URL in die Adresszeile des Browsers, sollte auf www.contenido.org weitergeleitet
|
||||
werden.
|
||||
Wenn nicht, dann kann eines der folgenden Punkte der Grund dafür sein:
|
||||
Das mod_rewrite Modul ist nicht geladen, das ist in der httpd.conf zu setzen
|
||||
[code]
|
||||
LoadModule rewrite_module modules/mod_rewrite.so
|
||||
[/code]
|
||||
|
||||
Die Direktive "AllowOverride" ist nicht korrekt gesetzt. Damit die Angaben in der .htaccess auch
|
||||
benützt werden können, muss für das betreffende Verzeichnis die Direktive "AllowOverride" in der
|
||||
httpd.conf angegeben werden:
|
||||
[code]
|
||||
# Beispielkonfiguration
|
||||
<Directory "/var/www/mywebproject">
|
||||
AllowOverride FileInfo
|
||||
</Directory>
|
||||
[/code]
|
||||
|
||||
|
||||
Wie richte ich Advanced Mod Rewrite für eine Contenidoinstallation in einem Unterverzeichnis ein?
|
||||
-------------------------------------------------------------------------------------------------
|
||||
|
||||
Als Beispiel gehen wir davon aus, dass Contenido im Verzeichnis /mypage/ unterhalb vom Webroot
|
||||
installiert wurde und das Mandantenverzeichnis per default /mypage/cms/ ist.
|
||||
|
||||
In der Pluginkonfiguration (Backend) den Pfad zur .htaccess Datei (aus Sicht des Web-Browsers)
|
||||
folgendermaßen anpassen:
|
||||
[code]
|
||||
/mypage/
|
||||
[/code]
|
||||
|
||||
Die /mypage/.htaccess öffnen und die RewriteBase folgendermaßen anpassen:
|
||||
[code]
|
||||
RewriteBase /mypage/cms/
|
||||
[/code]
|
||||
|
||||
|
||||
Welche Einstellungen sind nötig, wenn das Mandantenverzeichnis das wwwroot ist?
|
||||
-------------------------------------------------------------------------------
|
||||
Normalerweise liegt das Mandantenverzeichnis innerhalb des wwwroot und ist über
|
||||
http://domain.tld/cms/front_content.php erreichbar.
|
||||
Manchmal ist es erwünscht, dass der Ordner /cms/ in der URL nicht sichbar sein soll, also
|
||||
erreichbar über http://domain.tld/front_content.php.
|
||||
|
||||
In diesem Fall sind zwei Anpassungen nötig, damit Mod Rewrite korrekt funktioniert:
|
||||
1. Die .htaccess Datei in das Verzeichnis /cms/ kopieren, da die Datei im wwwroot sein muss.
|
||||
2. In der .htaccess die RewriteBase Option anpassen
|
||||
|
||||
# von
|
||||
RewriteBase /cms
|
||||
|
||||
# auf
|
||||
RewriteBase /
|
||||
|
||||
|
||||
Wie kann ich das Verarbeiten bestimmter Seiten vom Plugin unterbinden?
|
||||
----------------------------------------------------------------------
|
||||
Wenn das Plugin so konfiguriert wurde, dass die URLs bei der Ausgabe des HTML Codes der Seite
|
||||
angepasst werden, kann dieses Verhalten bei manchen Seiten unerwünscht sein. Das kann bei einer
|
||||
Ausgabe der Fall sein, dessen Inhalt kein HTML ist (z. B. Dateidownload), dann macht es keinen Sinn,
|
||||
die Ausgabe anzupassen.
|
||||
|
||||
Ab Contenido 4.8.8 gibt es eine neue Einstellung, mit der man unterbinden kann, dass die Ausgabe im
|
||||
Frontend nicht in den Ausgabepuffer geschrieben wird. Ist dies für eine Seite definiert worden, wird
|
||||
auch die Funktion vom Plugin, die die URLs anpasst, nicht ausgeführt.
|
||||
|
||||
Einstellen lässt sich das über Mandanteneinstellungen wie folgt:
|
||||
[code]
|
||||
Typ Name Wert
|
||||
frontend.no_outputbuffer idart 12,14,40
|
||||
[/code]
|
||||
Inhalte der Artikel mit der id 12, 14 und 40 werden dann von der Ausgabepufferung ausgeschlossen.
|
||||
|
||||
|
||||
Warum werden URLs trotz richtiger Vorraussetzungen nicht umschrieben?
|
||||
---------------------------------------------------------------------
|
||||
Ist die .htaccess und die Konfiguration des Plugins als Fehlerquelle auszuschließen und das Plugin
|
||||
soll die URLs bei der Ausgabe der Seite umschreiben (Standardeinstellung), könnte ein vorzeitig
|
||||
geleerter Ausgabepuffer der Grund sein.
|
||||
|
||||
In der front_content.php wird der HTML-Code in den Ausgabepuffer geschrieben, damit der Code vor der
|
||||
endgültigen Ausgabe bearbeitet werden kann. Das Plugin fügt der Chain
|
||||
"Contenido.Frontend.HTMLCodeOutput" eine eigene Funktion, die den Code aus dem Ausgabepuffer erhält,
|
||||
um die darin URLs zu umschreiben.
|
||||
|
||||
Wird aber der Ausgabepuffer vorher geleert, z. B. durch Verwendung von ob_flush() in einem Modul,
|
||||
wird der Code direkt an den Client rausgeschickt. Das hat den Effekt, dass in der front_content.php
|
||||
kein Code mehr aus dem Ausgabepuffer zur Verfügung steht, der nicht weiterverarbeitet werden kann,
|
||||
auch das Plugin kann dann keine URLs umschreiben.
|
||||
|
||||
|
||||
Alle URLs zu Kategorien werden mit / oder /index.html umschrieben:
|
||||
------------------------------------------------------------------
|
||||
Ist Contenido mit der Konfiguration $cfg["is_start_compatible"] = true;
|
||||
(siehe contenidoincludes/config.php) eingestellt, um die Startartikeldefinition in Kategorien
|
||||
kompatibel zu älteren Contenido-Versionen halten, kann das Plugin die URLs zu Kategorien nicht
|
||||
generieren, weil es diese Konfiguration nicht unterstützt.
|
||||
|
||||
Die einfachste Lösung ist, die Konfiguration $cfg["is_start_compatible"] auf false zu setzen und im
|
||||
Backend in den vorhandenen Kategorien erneut die Startartikel zu setzen.
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
ADVANCED MOD REWRITE THEMEN IM CONTENIDO FORUM
|
||||
|
||||
Plugin Advanced Mod Rewrite für Contenido 4.8.x:
|
||||
http://www.contenido.de/forum/viewtopic.php?t=21578
|
||||
|
||||
Original Advanced Mod Rewrite 4.6.23:
|
||||
http://www.contenido.de/forum/viewtopic.php?t=18454
|
||||
|
||||
Original Advanced Mod Rewrite 4.6.15:
|
||||
http://www.contenido.de/forum/viewtopic.php?t=11162
|
||||
|
||||
Advanced Mod Rewriting Contenido 4.4.4:
|
||||
http://www.contenido.de/forum/viewtopic.php?t=6713
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
SCHLUSSBEMERKUNG
|
||||
|
||||
Benutzung des Plugins auf eigene Gefahr!
|
||||
|
||||
Murat Purc, murat@purc.de
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* CONTENIDO Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin Advanced Mod Rewrite JavaScript functions.
|
||||
|
@ -9,19 +9,19 @@
|
|||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @package CONTENIDO Plugins
|
||||
* @version 0.1
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
* @since file available since CONTENIDO release 4.9.0
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: mod_rewrite.js 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* $Id$:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
@ -42,20 +42,29 @@ var mrPlugin = {
|
|||
|
||||
initializeSettingsPage: function() {
|
||||
$(document).ready(function() {
|
||||
$("#mr_use_language").click(function() {
|
||||
$("#mr_use_language_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled"));
|
||||
});
|
||||
|
||||
$("#mr_use_client").click(function() {
|
||||
$("#mr_use_client_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled"));
|
||||
});
|
||||
|
||||
$("#mr_add_startart_name_to_url").click(function() {
|
||||
$("#mr_default_startart_name").attr("disabled", ($(this).attr("checked") ? "" : "disabled"));
|
||||
if ($(this).attr("checked")) {
|
||||
$("#mr_default_startart_name").removeClass("disabled");
|
||||
$("#mr_use_language").change(function() {
|
||||
if (true == $(this).attr("checked")) {
|
||||
$("#mr_use_language_name").removeAttr("disabled");
|
||||
} else {
|
||||
$("#mr_default_startart_name").addClass("disabled");
|
||||
$("#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");
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
* Project:
|
||||
* Contenido Content Management System
|
||||
* CONTENIDO Content Management System
|
||||
*
|
||||
* Description:
|
||||
* Plugin Advanced Mod Rewrite JavaScript functions.
|
||||
|
@ -9,19 +9,19 @@
|
|||
* @con_php_req 5.0
|
||||
*
|
||||
*
|
||||
* @package Contenido Backend plugins
|
||||
* @package CONTENIDO Plugins
|
||||
* @version 0.1
|
||||
* @author Murat Purc <murat@purc.de>
|
||||
* @copyright four for business AG <www.4fb.de>
|
||||
* @license http://www.contenido.org/license/LIZENZ.txt
|
||||
* @link http://www.4fb.de
|
||||
* @link http://www.contenido.org
|
||||
* @since file available since Contenido release 4.8.15
|
||||
* @since file available since CONTENIDO release 4.9.0
|
||||
*
|
||||
* {@internal
|
||||
* created 2011-04-11
|
||||
*
|
||||
* $Id: styles.css 2 2011-07-20 12:00:48Z oldperl $:
|
||||
* $Id$:
|
||||
* }}
|
||||
*
|
||||
*/
|
||||
|
@ -50,6 +50,7 @@ body.mrPlugin {margin:10px;}
|
|||
.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 */
|
||||
|
|
|
@ -1,17 +1,16 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>mod_rewrite_content</title>
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js"></script>
|
||||
<script type="text/javascript" src="plugins/mod_rewrite/scripts/mod_rewrite.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css" />
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/external/aToolTip/css/atooltip.css" />
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css" />
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/external/aToolTip/css/atooltip.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css">
|
||||
<script type="text/javascript"><!--
|
||||
// session-id
|
||||
var sid = "{SESSID}";
|
||||
|
@ -44,28 +43,31 @@
|
|||
|
||||
<form name="mr_configuration" id="mr_configuration" method="post" action="main.php">
|
||||
|
||||
<input type="hidden" name="contenido" value="{SESSID}" />
|
||||
<input type="hidden" name="area" value="{AREA}" />
|
||||
<input type="hidden" name="mr_action" value="save" />
|
||||
<input type="hidden" name="frame" value="4" />
|
||||
<input type="hidden" name="idclient" value="{IDCLIENT}" />
|
||||
<input type="hidden" name="contenido" value="{SESSID}">
|
||||
<input type="hidden" name="area" value="{AREA}">
|
||||
<input type="hidden" name="mr_action" value="save">
|
||||
<input type="hidden" name="frame" value="4">
|
||||
<input type="hidden" name="idclient" value="{IDCLIENT}">
|
||||
|
||||
<table id="contenttable" cellspacing="0" cellpadding="3" border="0">
|
||||
<colgroup>
|
||||
<col width="30%" />
|
||||
<col width="70%" />
|
||||
<col width="30%">
|
||||
<col width="70%">
|
||||
</colgroup>
|
||||
<tr style="background-color:#e2e2e2;">
|
||||
<th colspan="2" class="text_medium col-I" style="border-top:1px;">{LNG_PLUGIN_SETTINGS}</th>
|
||||
</tr>
|
||||
|
||||
<!-- htaccess info -->
|
||||
<tr style="{HTACCESS_INFO_CSS}" class="marked">
|
||||
<td colspan="2" class="text_medium col-I">
|
||||
<br />
|
||||
<strong>{LNG_NOTE}</strong><br />
|
||||
{LNG_MSG_NO_HTACCESS_FOUND}<br />
|
||||
<br />
|
||||
<!-- htaccess info / empty aliases -->
|
||||
<tr style="{HEADER_NOTES_CSS}" class="marked">
|
||||
<td colspan="2" class="text_medium col-I" style="padding:13px 3px;">
|
||||
<strong>{LNG_NOTE}</strong><br>
|
||||
<p style="{HTACCESS_INFO_CSS}">
|
||||
{LNG_MSG_NO_HTACCESS_FOUND}<br>
|
||||
</p>
|
||||
<p style="{EMPTYALIASES_INFO_CSS}">
|
||||
{LNG_MSG_NO_EMPTYALIASES_FOUND}<br>
|
||||
</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -73,14 +75,14 @@
|
|||
<tr>
|
||||
<td colspan="2" class="text_medium col-I">
|
||||
<div class="blockLeft">
|
||||
<input type="checkbox" id="mr_use" name="use" value="1"{USE_CHK} />
|
||||
<input type="checkbox" id="mr_use" name="use" value="1"{USE_CHK}>
|
||||
<label for="mr_use">{LNG_ENABLE_AMR}</label>
|
||||
</div>
|
||||
<a href="#" id="enableInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="enableInfo1" style="display:none">
|
||||
<strong>{LNG_NOTE}</strong><br />
|
||||
{LNG_MSG_ENABLE_AMR_INFO}<br />
|
||||
<br />
|
||||
<div id="enableInfo1" style="display:none;">
|
||||
<strong>{LNG_NOTE}</strong><br>
|
||||
{LNG_MSG_ENABLE_AMR_INFO}<br>
|
||||
<br>
|
||||
<strong>{LNG_EXAMPLE}:</strong>
|
||||
<pre class="example">{LNG_MSG_ENABLE_AMR_INFO_EXAMPLE}</pre>
|
||||
</div>
|
||||
|
@ -92,16 +94,40 @@
|
|||
<td class="text_medium col-I">{LNG_ROOTDIR}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{ROOTDIR_ERROR}
|
||||
<input class="text_medium blockLeft" type="text" name="rootdir" size="50" maxlength="64" value="{ROOTDIR}" />
|
||||
<input class="text_medium blockLeft" type="text" name="rootdir" size="50" maxlength="64" value="{ROOTDIR}">
|
||||
<a href="#" id="rootdirInfo1-link" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="rootdirInfo1" style="display:none">{LNG_ROOTDIR_INFO}</div>
|
||||
<br />
|
||||
<div id="rootdirInfo1" style="display:none;">{LNG_ROOTDIR_INFO}</div>
|
||||
<br>
|
||||
<div class="blockLeft">
|
||||
<input type="checkbox" id="mr_checkrootdir" name="checkrootdir" value="1"{CHECKROOTDIR_CHK} />
|
||||
<input type="checkbox" id="mr_checkrootdir" name="checkrootdir" value="1"{CHECKROOTDIR_CHK}>
|
||||
<label for="mr_checkrootdir">{LNG_CHECKROOTDIR}</label>
|
||||
</div>
|
||||
<a href="#" id="rootdirInfo2-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="rootdirInfo2" style="display:none">{LNG_CHECKROOTDIR_INFO}</div>
|
||||
<div id="rootdirInfo2" style="display:none;">{LNG_CHECKROOTDIR_INFO}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- use client/use client name -->
|
||||
<tr>
|
||||
<td class="text_medium col-I">{LNG_USE_CLIENT}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<input type="checkbox" id="mr_use_client" name="use_client" value="1"{USE_CLIENT_CHK}>
|
||||
<label for="mr_use_client">{LNG_USE_CLIENT_LBL}</label><br>
|
||||
<br>
|
||||
<input type="checkbox" id="mr_use_client_name" name="use_client_name" value="1"{USE_CLIENT_NAME_CHK}{USE_CLIENT_NAME_DISABLED}>
|
||||
<label for="mr_use_client_name">{LNG_USE_CLIENT_NAME_LBL}</label><br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- use language/use language name -->
|
||||
<tr>
|
||||
<td class="text_medium col-I">{LNG_USE_LANGUAGE}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<input type="checkbox" id="mr_use_language" name="use_language" value="1"{USE_LANGUAGE_CHK}>
|
||||
<label for="mr_use_language">{LNG_USE_LANGUAGE_LBL}</label><br>
|
||||
<br>
|
||||
<input type="checkbox" id="mr_use_language_name" name="use_language_name" value="1"{USE_LANGUAGE_NAME_CHK}{USE_LANGUAGE_NAME_DISABLED}>
|
||||
<label for="mr_use_language_name">{LNG_USE_LANGUAGE_NAME_LBL}</label><br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -110,35 +136,11 @@
|
|||
<td class="text_medium col-I">{LNG_STARTFROMROOT}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<div class="blockLeft">
|
||||
<input type="checkbox" id="mr_startfromroot" name="startfromroot" value="1"{STARTFROMROOT_CHK} />
|
||||
<input type="checkbox" id="mr_startfromroot" name="startfromroot" value="1"{STARTFROMROOT_CHK}>
|
||||
<label for="mr_startfromroot">{LNG_STARTFROMROOT_LBL}</label>
|
||||
</div>
|
||||
<a href="#" id="startFromRootInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="startFromRootInfo1" style="display:none">{LNG_STARTFROMROOT_INFO}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- use client/use client name -->
|
||||
<tr>
|
||||
<td class="text_medium col-I">{LNG_USE_CLIENT}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<input type="checkbox" id="mr_use_client" name="use_client" value="1"{USE_CLIENT_CHK} />
|
||||
<label for="mr_use_client">{LNG_USE_CLIENT_LBL}</label><br />
|
||||
<br />
|
||||
<input type="checkbox" id="mr_use_client_name" name="use_client_name" value="1"{USE_CLIENT_NAME_CHK}{USE_CLIENT_NAME_DISABLED} />
|
||||
<label for="mr_use_client_name">{LNG_USE_CLIENT_NAME_LBL}</label><br />
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- use language/use language name -->
|
||||
<tr>
|
||||
<td class="text_medium col-I">{LNG_USE_LANGUAGE}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<input type="checkbox" id="mr_use_language" name="use_language" value="1"{USE_LANGUAGE_CHK} />
|
||||
<label for="mr_use_language">{LNG_USE_LANGUAGE_LBL}</label><br />
|
||||
<br />
|
||||
<input type="checkbox" id="mr_use_language_name" name="use_language_name" value="1"{USE_LANGUAGE_NAME_CHK}{USE_LANGUAGE_NAME_DISABLED} />
|
||||
<label for="mr_use_language_name">{LNG_USE_LANGUAGE_NAME_LBL}</label><br />
|
||||
<div id="startFromRootInfo1" style="display:none;">{LNG_STARTFROMROOT_INFO}</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
@ -147,7 +149,7 @@
|
|||
<td colspan="2" class="text_medium col-I altBg">
|
||||
<strong class="blockLeft">{LNG_USERDEFINED_SEPARATORS_HEADER}</strong>
|
||||
<a href="#" id="userdefSeparatorInfo1-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="userdefSeparatorInfo1" style="display:none">
|
||||
<div id="userdefSeparatorInfo1" style="display:none;">
|
||||
<strong>{LNG_EXAMPLE}:</strong>
|
||||
<pre class="example">{LNG_USERDEFINED_SEPARATORS_EXAMPLE}</pre>
|
||||
|
||||
|
@ -171,7 +173,7 @@
|
|||
<td class="text_medium col-I altBg">{LNG_CATEGORY_SEPARATOR}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{CATEGORY_SEPARATOR_ERROR}
|
||||
<input class="text_medium" type="text" id="mr_category_seperator" name="category_seperator" size="5" maxlength="1" value="{CATEGORY_SEPARATOR}"{CATEGORY_SEPARATOR_ATTRIB} />
|
||||
<input class="text_medium" type="text" id="mr_category_seperator" name="category_seperator" size="5" maxlength="1" value="{CATEGORY_SEPARATOR}"{CATEGORY_SEPARATOR_ATTRIB}>
|
||||
<small>{LNG_CATART_SEPARATOR_INFO}</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -180,7 +182,7 @@
|
|||
<td class="text_medium col-I altBg">{LNG_CATEGORY_WORD_SEPARATOR}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{CATEGORY_WORD_SEPARATOR_ERROR}
|
||||
<input class="text_medium" type="text" id="mr_category_word_seperator" name="category_word_seperator" size="5" maxlength="1" value="{CATEGORY_WORD_SEPARATOR}"{CATEGORY_WORD_SEPARATOR_ATTRIB} />
|
||||
<input class="text_medium" type="text" id="mr_category_word_seperator" name="category_word_seperator" size="5" maxlength="1" value="{CATEGORY_WORD_SEPARATOR}"{CATEGORY_WORD_SEPARATOR_ATTRIB}>
|
||||
<small>{LNG_WORD_SEPARATOR_INFO}</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -189,7 +191,7 @@
|
|||
<td class="text_medium col-I altBg">{LNG_ARTICLE_SEPARATOR}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{ARTICLE_SEPARATOR_ERROR}
|
||||
<input class="text_medium" type="text" id="mr_article_seperator" name="article_seperator" size="5" maxlength="1" value="{ARTICLE_SEPARATOR}"{ARTICLE_SEPARATOR_ATTRIB} />
|
||||
<input class="text_medium" type="text" id="mr_article_seperator" name="article_seperator" size="5" maxlength="1" value="{ARTICLE_SEPARATOR}"{ARTICLE_SEPARATOR_ATTRIB}>
|
||||
<small>{LNG_CATART_SEPARATOR_INFO}</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -197,7 +199,7 @@
|
|||
<td class="text_medium col-I altBg">{LNG_ARTICLE_WORD_SEPARATOR}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{ARTICLE_WORD_SEPARATOR_ERROR}
|
||||
<input class="text_medium" type="text" id="mr_article_word_seperator" name="article_word_seperator" size="5" maxlength="1" value="{ARTICLE_WORD_SEPARATOR}"{ARTICLE_WORD_SEPARATOR_ATTRIB} />
|
||||
<input class="text_medium" type="text" id="mr_article_word_seperator" name="article_word_seperator" size="5" maxlength="1" value="{ARTICLE_WORD_SEPARATOR}"{ARTICLE_WORD_SEPARATOR_ATTRIB}>
|
||||
<small>{LNG_WORD_SEPARATOR_INFO}</small>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -207,12 +209,12 @@
|
|||
<td class="text_medium col-I">{LNG_ADD_STARTART_NAME_TO_URL}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
{ADD_STARTART_NAME_TO_URL_ERROR}
|
||||
<input type="checkbox" id="mr_add_startart_name_to_url" name="add_startart_name_to_url" value="1"{ADD_STARTART_NAME_TO_URL_CHK} />
|
||||
<label for="mr_add_startart_name_to_url">{LNG_ADD_STARTART_NAME_TO_URL_LBL}</label><br />
|
||||
<br />
|
||||
<input type="checkbox" id="mr_add_startart_name_to_url" name="add_startart_name_to_url" value="1"{ADD_STARTART_NAME_TO_URL_CHK}>
|
||||
<label for="mr_add_startart_name_to_url">{LNG_ADD_STARTART_NAME_TO_URL_LBL}</label><br>
|
||||
<br>
|
||||
<div class="blockLeft">
|
||||
<label for="mr_default_startart_name">{LNG_DEFAULT_STARTART_NAME}</label><br />
|
||||
<input class="text_medium" type="text" id="mr_default_startart_name" name="default_startart_name" size="50" maxlength="64" value="{DEFAULT_STARTART_NAME}" />
|
||||
<label for="mr_default_startart_name">{LNG_DEFAULT_STARTART_NAME}</label><br>
|
||||
<input class="text_medium" type="text" id="mr_default_startart_name" name="default_startart_name" size="50" maxlength="64" value="{DEFAULT_STARTART_NAME}">
|
||||
</div>
|
||||
<a href="#" id="defaultStartArtNameInfo1-link" title="" class="main i-link infoButton v2" style="margin-top:1.2em;"></a><div class="clear"></div>
|
||||
<div id="defaultStartArtNameInfo1" style="display:none">{LNG_DEFAULT_STARTART_NAME_INFO}</div>
|
||||
|
@ -225,12 +227,12 @@
|
|||
<td class="text_medium col-II" align="left">
|
||||
{FILE_EXTENSION_ERROR}
|
||||
<div class="blockLeft">
|
||||
<input class="text_medium" type="text" name="file_extension" size="10" maxlength="10" value="{FILE_EXTENSION}" /><br />
|
||||
<input class="text_medium" type="text" name="file_extension" size="10" maxlength="10" value="{FILE_EXTENSION}"><br>
|
||||
</div>
|
||||
<a href="#" id="fileExtensionInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="fileExtensionInfo1" style="display:none">
|
||||
{LNG_FILE_EXTENSION_INFO}<br /><br />
|
||||
<strong>{LNG_NOTE}:</strong><br />
|
||||
<div id="fileExtensionInfo1" style="display:none;">
|
||||
{LNG_FILE_EXTENSION_INFO}<br><br>
|
||||
<strong>{LNG_NOTE}:</strong><br>
|
||||
{LNG_FILE_EXTENSION_INFO2}
|
||||
</div>
|
||||
<p style="color:red">{LNG_FILE_EXTENSION_INFO3}</p>
|
||||
|
@ -241,7 +243,7 @@
|
|||
<tr>
|
||||
<td class="text_medium col-I">{LNG_USE_LOWERCASE_URI}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<input type="checkbox" id="mr_use_lowercase_uri" name="use_lowercase_uri" value="1"{USE_LOWERCASE_URI_CHK} />
|
||||
<input type="checkbox" id="mr_use_lowercase_uri" name="use_lowercase_uri" value="1"{USE_LOWERCASE_URI_CHK}>
|
||||
<label for="mr_use_lowercase_uri">{LNG_USE_LOWERCASE_URI_LBL}</label>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -251,11 +253,11 @@
|
|||
<td class="text_medium col-I">{LNG_PREVENT_DUPLICATED_CONTENT}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<div class="blockLeft">
|
||||
<input type="checkbox" id="mr_prevent_duplicated_content" name="prevent_duplicated_content" value="1"{PREVENT_DUPLICATED_CONTENT_CHK} /> <label for="mr_prevent_duplicated_content">{LNG_PREVENT_DUPLICATED_CONTENT_LBL}</label><br />
|
||||
<input type="checkbox" id="mr_prevent_duplicated_content" name="prevent_duplicated_content" value="1"{PREVENT_DUPLICATED_CONTENT_CHK}> <label for="mr_prevent_duplicated_content">{LNG_PREVENT_DUPLICATED_CONTENT_LBL}</label><br>
|
||||
</div>
|
||||
<a href="#" id="preventDuplicatedContentInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="preventDuplicatedContentInfo1" style="display:none">
|
||||
{LNG_PREVENT_DUPLICATED_CONTENT_INFO}:<br />
|
||||
<div id="preventDuplicatedContentInfo1" style="display:none;">
|
||||
{LNG_PREVENT_DUPLICATED_CONTENT_INFO}:<br>
|
||||
<ul>
|
||||
{LNG_PREVENT_DUPLICATED_CONTENT_INFO2}
|
||||
</ul>
|
||||
|
@ -269,10 +271,10 @@
|
|||
<td class="text_medium col-II" align="left">
|
||||
{CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR}
|
||||
<div class="blockLeft">
|
||||
<input class="text_medium" type="text" name="category_resolve_min_percentage" size="5" maxlength="3" value="{CATEGORY_RESOLVE_MIN_PERCENTAGE}" /> (0 - 100)
|
||||
<input class="text_medium" type="text" name="category_resolve_min_percentage" size="5" maxlength="3" value="{CATEGORY_RESOLVE_MIN_PERCENTAGE}"> (0 - 100)
|
||||
</div>
|
||||
<a href="#" id="categoryResolveMinPercentageInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="categoryResolveMinPercentageInfo1" style="display:none">
|
||||
<div id="categoryResolveMinPercentageInfo1" style="display:none;">
|
||||
<p>{LNG_CATEGORY_RESOLVE_MIN_PERCENTAGE_INFO}</p>
|
||||
<strong>{LNG_EXAMPLE}:</strong>
|
||||
<pre class="example">{LNG_CATEGORY_RESOLVE_MIN_PERCENTAGE_EXAMPLE}</pre>
|
||||
|
@ -285,11 +287,11 @@
|
|||
<td class="text_medium col-I">{LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<div class="blockLeft">
|
||||
<input type="checkbox" id="mr_redirect_invalid_article_to_errorsite" name="redirect_invalid_article_to_errorsite" value="1"{REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK} />
|
||||
<label for="mr_redirect_invalid_article_to_errorsite">{LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_LBL}</label><br />
|
||||
<input type="checkbox" id="mr_redirect_invalid_article_to_errorsite" name="redirect_invalid_article_to_errorsite" value="1"{REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK}>
|
||||
<label for="mr_redirect_invalid_article_to_errorsite">{LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_LBL}</label><br>
|
||||
</div>
|
||||
<a href="#" id="redirectInvalidArticleToErrorsiteInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="redirectInvalidArticleToErrorsiteInfo1" style="display:none">
|
||||
<div id="redirectInvalidArticleToErrorsiteInfo1" style="display:none;">
|
||||
{LNG_REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_INFO}
|
||||
</div>
|
||||
</td>
|
||||
|
@ -300,27 +302,27 @@
|
|||
<td class="text_medium col-I">{LNG_REWRITE_URLS_AT}</td>
|
||||
<td class="text_medium col-II" align="left">
|
||||
<div class="blockLeft">
|
||||
<input type="radio" id="rewrite_urls_at_front_content_output" name="rewrite_urls_at" value="front_content_output"{REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK} />
|
||||
<input type="radio" id="rewrite_urls_at_front_content_output" name="rewrite_urls_at" value="front_content_output"{REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK}>
|
||||
<label for="rewrite_urls_at_front_content_output">{LNG_REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_LBL}</label>
|
||||
</div>
|
||||
<a href="#" id="rewriteUrlsAtInfo1-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="rewriteUrlsAtInfo1" style="display:none;">
|
||||
{LNG_REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_INFO}<br />
|
||||
<br />
|
||||
{LNG_REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_INFO}<br>
|
||||
<br>
|
||||
<strong>{LNG_REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_INFO2}:</strong>
|
||||
<ul>
|
||||
{LNG_REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_INFO3}
|
||||
</ul>
|
||||
</div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
<div class="blockLeft">
|
||||
<input type="radio" id="rewrite_urls_at_congeneratecode" name="rewrite_urls_at" value="congeneratecode"{REWRITE_URLS_AT_CONGENERATECODE_CHK} />
|
||||
<label for="rewrite_urls_at_congeneratecode">{LNG_REWRITE_URLS_AT_CONGENERATECODE_LBL}</label><br />
|
||||
<input type="radio" id="rewrite_urls_at_congeneratecode" name="rewrite_urls_at" value="congeneratecode"{REWRITE_URLS_AT_CONGENERATECODE_CHK}>
|
||||
<label for="rewrite_urls_at_congeneratecode">{LNG_REWRITE_URLS_AT_CONGENERATECODE_LBL}</label><br>
|
||||
</div>
|
||||
<a href="#" id="rewriteUrlsAtInfo2-link" title="" class="main i-link infoButton v2"></a><div class="clear"></div>
|
||||
<div id="rewriteUrlsAtInfo2" style="display:none;">
|
||||
{LNG_REWRITE_URLS_AT_CONGENERATECODE_INFO}<br />
|
||||
{LNG_REWRITE_URLS_AT_CONGENERATECODE_INFO}<br>
|
||||
<pre class="example">{LNG_REWRITE_URLS_AT_CONGENERATECODE_EXAMPLE}</pre>
|
||||
|
||||
<strong>{LNG_REWRITE_URLS_AT_CONGENERATECODE_INFO2}:</strong>
|
||||
|
@ -337,10 +339,10 @@
|
|||
<td class="text_medium col-II" align="left">
|
||||
<div class="blockLeft">{LNG_REWRITE_ROUTING_INFO}</div>
|
||||
<a href="#" id="routingInfo1-link" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="routingInfo1" style="display:none">
|
||||
<div id="routingInfo1" style="display:none;">
|
||||
{LNG_REWRITE_ROUTING_INFO2}
|
||||
<pre class="example">{LNG_REWRITE_ROUTING_EXAMPLE}</pre>
|
||||
<br />
|
||||
<br>
|
||||
<ul>
|
||||
{LNG_REWRITE_ROUTING_INFO3}
|
||||
</ul>
|
||||
|
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>mod_rewrite_content_menu_top</title>
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css" />
|
||||
<script type="text/javascript"><!--
|
||||
// session-id
|
||||
var sid = "{SESSID}";
|
||||
// --></script>
|
||||
<style type="text/css"><!--
|
||||
img {border:none;}
|
||||
// --></style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<div id="navcontainer">
|
||||
<div style="float:left;">
|
||||
<img src="images/frame_handle_re.gif" style="border:0px;float:left;" alt="" />
|
||||
<img style="margin:7px 0 0 7px;" id="toggleimage" onclick="parent.parent.frameResize.toggle()" src="images/spacer.gif" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript"><!--
|
||||
if (parent.parent.frames[0].name != "header") {
|
||||
parent.parent.frameResize.init();
|
||||
parent.parent.frameResize.toggle();
|
||||
}
|
||||
// --></script>
|
||||
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +1,16 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>mod_rewrite_content_expert</title>
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="plugins/mod_rewrite/scripts/mod_rewrite.js"></script>
|
||||
<script type="text/javascript" src="plugins/mod_rewrite/external/aToolTip/js/atooltip.jquery.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css" />
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/external/aToolTip/css/atooltip.css" />
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css" />
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/external/aToolTip/css/atooltip.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css">
|
||||
<script type="text/javascript"><!--
|
||||
// session-id
|
||||
var sid = "{SESSID}";
|
||||
|
@ -22,8 +21,7 @@
|
|||
// initialize page
|
||||
mrPlugin.initializeSettingsPage();
|
||||
|
||||
function mrPlugin_sendForm(action, params)
|
||||
{
|
||||
function mrPlugin_sendForm(action, params) {
|
||||
$('#mr_expert_action').val(action);
|
||||
var frm = $('#mr_expert');
|
||||
frm.attr('action', frm.attr('action') + '?' + params).submit();
|
||||
|
@ -41,16 +39,16 @@
|
|||
|
||||
<form name="mr_expert" id="mr_expert" method="post" action="main.php">
|
||||
|
||||
<input type="hidden" name="contenido" value="{SESSID}" />
|
||||
<input type="hidden" name="area" value="{AREA}" />
|
||||
<input type="hidden" name="mr_action" id="mr_expert_action" value="" />
|
||||
<input type="hidden" name="frame" value="4" />
|
||||
<input type="hidden" name="idclient" value="{IDCLIENT}" />
|
||||
<input type="hidden" name="contenido" value="{SESSID}">
|
||||
<input type="hidden" name="area" value="{AREA}">
|
||||
<input type="hidden" name="mr_action" id="mr_expert_action" value="">
|
||||
<input type="hidden" name="frame" value="4">
|
||||
<input type="hidden" name="idclient" value="{IDCLIENT}">
|
||||
|
||||
<table id="contenttable" cellspacing="0" cellpadding="3" border="0">
|
||||
<colgroup>
|
||||
<col width="30%" />
|
||||
<col width="70%" />
|
||||
<col width="30%">
|
||||
<col width="70%">
|
||||
</colgroup>
|
||||
|
||||
|
||||
|
@ -60,50 +58,50 @@
|
|||
<td class="text_medium col-II" align="left">
|
||||
{COPY_HTACCESS_ERROR}
|
||||
|
||||
<label for="mr_copy_htaccess_type">{LNG_COPY_HTACCESS_TYPE_LBL}</label><br />
|
||||
<label for="mr_copy_htaccess_type">{LNG_COPY_HTACCESS_TYPE_LBL}</label><br>
|
||||
<select class="blockLeft" name="htaccesstype" id="mr_copy_htaccess_type">
|
||||
<option value="restrictive">{LNG_COPY_HTACCESS_TYPE1}</option>
|
||||
<option value="simple">{LNG_COPY_HTACCESS_TYPE2}</option>
|
||||
</select>
|
||||
<a href="#" id="copyHtaccessInfo1-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="copyHtaccessInfo1" style="display:none">
|
||||
<strong>{LNG_COPY_HTACCESS_TYPE1}:</strong><br />
|
||||
{LNG_COPY_HTACCESS_TYPE_INFO1}<br />
|
||||
<br />
|
||||
<strong>{LNG_COPY_HTACCESS_TYPE2}:</strong><br />
|
||||
{LNG_COPY_HTACCESS_TYPE_INFO2}<br />
|
||||
<div id="copyHtaccessInfo1" style="display:none;">
|
||||
<strong>{LNG_COPY_HTACCESS_TYPE1}:</strong><br>
|
||||
{LNG_COPY_HTACCESS_TYPE_INFO1}<br>
|
||||
<br>
|
||||
<strong>{LNG_COPY_HTACCESS_TYPE2}:</strong><br>
|
||||
{LNG_COPY_HTACCESS_TYPE_INFO2}<br>
|
||||
</div>
|
||||
|
||||
<div class="clear"></div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
{LNG_COPY_HTACCESS_TO}<br />
|
||||
<br />
|
||||
{LNG_COPY_HTACCESS_TO}<br>
|
||||
<br>
|
||||
<a class="blockLeft" style="margin-right:15px;" href="javascript:mrPlugin_sendForm('copyhtaccess', 'copy=contenido');">
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt="" /> {LNG_COPY_HTACCESS_TO_CONTENIDO}</a>
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt=""> {LNG_COPY_HTACCESS_TO_CONTENIDO}</a>
|
||||
<a href="#" id="copyHtaccessInfo2-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="copyHtaccessInfo2" style="display:none">
|
||||
<div id="copyHtaccessInfo2" style="display:none;">
|
||||
{LNG_COPY_HTACCESS_TO_CONTENIDO_INFO}
|
||||
</div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
<a class="blockLeft" style="margin-right:15px;" href="javascript:mrPlugin_sendForm('copyhtaccess', 'copy=cms');">
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt="" /> {LNG_COPY_HTACCESS_TO_CLIENT}</a>
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt=""> {LNG_COPY_HTACCESS_TO_CLIENT}</a>
|
||||
<a href="#" id="copyHtaccessInfo3-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="copyHtaccessInfo3" style="display:none">
|
||||
<div id="copyHtaccessInfo3" style="display:none;">
|
||||
{LNG_COPY_HTACCESS_TO_CLIENT_INFO}
|
||||
</div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
{LNG_OR}<br />
|
||||
<br />
|
||||
{LNG_OR}<br>
|
||||
<br>
|
||||
<a class="blockLeft" style="margin-right:15px;" href="javascript:mrPlugin_sendForm('downloadhtaccess', '');">
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt="" /> {LNG_DOWNLOAD}</a>
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt=""> {LNG_DOWNLOAD}</a>
|
||||
<a href="#" id="showHtaccessInfo-link1" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="showHtaccessInfo" style="display:none">
|
||||
<div id="showHtaccessInfo" style="display:none;">
|
||||
{LNG_DOWNLOAD_INFO}
|
||||
</div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
<div class="clear"></div>
|
||||
</td>
|
||||
|
@ -116,21 +114,21 @@
|
|||
</td>
|
||||
<td class="text_medium col-II">
|
||||
<a class="blockLeft" style="margin-right:15px;" href="javascript:mrPlugin_sendForm('resetempty', '');">
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt="" /> {LNG_RESETEMPTY_LINK}</a>
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt=""> {LNG_RESETEMPTY_LINK}</a>
|
||||
<a href="#" id="resetAliasesInfo1-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="resetAliasesInfo1" style="display:none">
|
||||
<div id="resetAliasesInfo1" style="display:none;">
|
||||
{LNG_RESETEMPTY_INFO}
|
||||
</div>
|
||||
<br />
|
||||
<br>
|
||||
|
||||
<a class="blockLeft" style="margin-right:15px;" href="javascript:mrPlugin_sendForm('reset', '');">
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt="" /> {LNG_RESETALL_LINK}</a>
|
||||
<img src="images/collapsed.gif" width="10" height="9" alt=""> {LNG_RESETALL_LINK}</a>
|
||||
<a href="#" id="resetAliasesInfo2-link2" title="" class="main i-link infoButton"></a><div class="clear"></div>
|
||||
<div id="resetAliasesInfo2" style="display:none">
|
||||
<div id="resetAliasesInfo2" style="display:none;">
|
||||
{LNG_RESETALL_INFO}
|
||||
</div>
|
||||
<br />
|
||||
<strong>{LNG_NOTE}:</strong><br />
|
||||
<br>
|
||||
<strong>{LNG_NOTE}:</strong><br>
|
||||
{LNG_RESETALIASES_NOTE}
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -139,8 +137,8 @@
|
|||
<tr>
|
||||
<td colspan="2" class="text_medium col-I" style="text-align:right">
|
||||
<a accesskey="c" href="main.php?area={AREA}&frame=4&idclient={IDCLIENT}&contenido={SESSID}">
|
||||
<img src="images/but_cancel.gif" alt="" title="{LNG_DISCARD_CHANGES}" /></a>
|
||||
<input style="margin-left:20px;" accesskey="s" type="image" src="images/but_ok.gif" alt="" title="{LNG_SAVE_CHANGES}" />
|
||||
<img src="images/but_cancel.gif" alt="" title="{LNG_DISCARD_CHANGES}"></a>
|
||||
<input style="margin-left:20px;" accesskey="s" type="image" src="images/but_ok.gif" alt="" title="{LNG_SAVE_CHANGES}">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
|
@ -1,15 +1,14 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>mod_rewrite_content_test</title>
|
||||
<meta http-equiv="expires" content="0" />
|
||||
<meta http-equiv="cache-control" content="no-cache" />
|
||||
<meta http-equiv="pragma" content="no-cache" />
|
||||
<meta http-equiv="expires" content="0">
|
||||
<meta http-equiv="cache-control" content="no-cache">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<script type="text/javascript" src="scripts/jquery/jquery.js"></script>
|
||||
<script type="text/javascript" src="plugins/mod_rewrite/scripts/mod_rewrite.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css" />
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css" />
|
||||
<link rel="stylesheet" type="text/css" href="styles/contenido.css">
|
||||
<link rel="stylesheet" type="text/css" href="plugins/mod_rewrite/styles/styles.css">
|
||||
<script type="text/javascript"><!--
|
||||
// session-id
|
||||
var sid = "{SESSID}";
|
||||
|
@ -25,37 +24,37 @@
|
|||
<div class="headerBox">
|
||||
<p>{LNG_FORM_INFO}<p>
|
||||
<form name="mr_test" id="mr_test" action="main.php">
|
||||
<input type="hidden" name="area" value="{AREA}" />
|
||||
<input type="hidden" name="frame" value="{FRAME}" />
|
||||
<input type="hidden" name="contenido" value="{CONTENIDO}" />
|
||||
<input type="hidden" name="area" value="{AREA}">
|
||||
<input type="hidden" name="frame" value="{FRAME}">
|
||||
<input type="hidden" name="contenido" value="{CONTENIDO}">
|
||||
<fieldset>
|
||||
<legend>{LNG_FORM_LABEL}</legend>
|
||||
<p></p>
|
||||
<div class="chk">
|
||||
<input type="checkbox" id="idart" name="idart" value="1"{FORM_IDART_CHK} /><label for="idart">idart</label>
|
||||
<input type="checkbox" id="idart" name="idart" value="1"{FORM_IDART_CHK}><label for="idart">idart</label>
|
||||
</div>
|
||||
<div class="chk">
|
||||
<input type="checkbox" id="idcat" name="idcat" value="1"{FORM_IDCAT_CHK} /><label for="idcat">idcat</label>
|
||||
<input type="checkbox" id="idcat" name="idcat" value="1"{FORM_IDCAT_CHK}><label for="idcat">idcat</label>
|
||||
</div>
|
||||
<div class="chk">
|
||||
<input type="checkbox" id="idcatart" name="idcatart" value="1"{FORM_IDCATART_CHK} /><label for="idcatart">idcatart</label>
|
||||
<input type="checkbox" id="idcatart" name="idcatart" value="1"{FORM_IDCATART_CHK}><label for="idcatart">idcatart</label>
|
||||
</div>
|
||||
<div class="chk">
|
||||
<input type="checkbox" id="idartlang" name="idartlang" value="1"{FORM_IDARTLANG_CHK} /><label for="idartlang">idartlang</label>
|
||||
<input type="checkbox" id="idartlang" name="idartlang" value="1"{FORM_IDARTLANG_CHK}><label for="idartlang">idartlang</label>
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<br class="clear">
|
||||
</fieldset>
|
||||
<div style="margin:0.3em 0;">
|
||||
<div class="contenttest">
|
||||
<div class="blockLeft">
|
||||
<label for="maxitems">{LNG_MAXITEMS_LBL}: </label><input type="text" id="maxitems" maxlength="4" name="maxitems" value="{FORM_MAXITEMS}" />
|
||||
<label for="maxitems">{LNG_MAXITEMS_LBL}: </label><input type="text" id="maxitems" maxlength="4" name="maxitems" value="{FORM_MAXITEMS}">
|
||||
</div>
|
||||
<div class="blockRight" style="padding-right:5px;">
|
||||
<input type="submit" name="test" value="{LNG_RUN_TEST}" />
|
||||
<div class="blockRight pdr5">
|
||||
<input type="submit" name="test" value="{LNG_RUN_TEST}">
|
||||
</div>
|
||||
<br class="clear" />
|
||||
<br class="clear">
|
||||
</div>
|
||||
</form>
|
||||
<br class="clear" />
|
||||
<br class="clear">
|
||||
</div>
|
||||
|
||||
{CONTENT}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- Contenido XML language file -->
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- CONTENIDO XML language file -->
|
||||
<language>
|
||||
<navigation>
|
||||
<content>
|
||||
<extras>
|
||||
<mod_rewrite>
|
||||
<main>AMR</main>
|
||||
<settings>Einstellungen</settings>
|
||||
<expert>Funktionen</expert>
|
||||
<test>Test</test>
|
||||
</mod_rewrite>
|
||||
</content>
|
||||
</extras>
|
||||
</navigation>
|
||||
</language>
|
|
@ -1,14 +1,14 @@
|
|||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!-- Contenido XML language file -->
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- CONTENIDO XML language file -->
|
||||
<language>
|
||||
<navigation>
|
||||
<content>
|
||||
<extras>
|
||||
<mod_rewrite>
|
||||
<main>AMR</main>
|
||||
<settings>Settings</settings>
|
||||
<expert>Functions</expert>
|
||||
<test>Test</test>
|
||||
</mod_rewrite>
|
||||
</content>
|
||||
</extras>
|
||||
</navigation>
|
||||
</language>
|
Laden…
In neuem Issue referenzieren