Source for file include.mod_rewrite_content.php

Documentation is available at include.mod_rewrite_content.php

  1. <?php
  2. /**
  3.  * Plugin mod_rewrite backend include file to administer settings (in content frame)
  4.  *
  5.  * @date        22.04.2008
  6.  * @author      Murat Purc
  7.  * @copyright   © Murat Purc 2008
  8.  * @package     Contenido
  9.  * @subpackage  ModRewrite
  10.  */
  11.  
  12. if(!defined('CON_FRAMEWORK')) {
  13.     die('Illegal call');
  14. }
  15.  
  16. if (isset($_REQUEST['cfg']|| !isset($contenido)) exit()}
  17.  
  18. $action (isset($_REQUEST['mr_action'])) $_REQUEST['mr_action''index';
  19.  
  20. $debug  false;
  21.  
  22. //var_dump($cfg['templates']['mod_rewrite_content']);
  23.  
  24.  
  25. ####################################################################################################
  26. ##### Some variables
  27.  
  28.  
  29. $oGlob  mpGlobals::getInstance();
  30. $oTpl   new Template();
  31. $aMrCfg ModRewrite::getConfig();
  32.  
  33. // downwards compatibility to previous plugin versions
  34. if (mr_arrayValue($aMrCfg'category_seperator'''== ''{
  35.     $aMrCfg['category_seperator''/';
  36. }
  37. if (mr_arrayValue($aMrCfg'category_word_seperator'''== ''{
  38.     $aMrCfg['category_word_seperator''-';
  39. }
  40. if (mr_arrayValue($aMrCfg'article_seperator'''== ''{
  41.     $aMrCfg['article_seperator''/';
  42. }
  43. if (mr_arrayValue($aMrCfg'article_word_seperator'''== ''{
  44.     $aMrCfg['article_word_seperator''-';
  45. }
  46.  
  47. // some settings
  48. $aBgColor array(
  49.     'enabled'  => '#ffffff',
  50.     'disabled' => '#dadada'
  51. );
  52. $aSeparator array(
  53.     'pattern'         => '/^[\/\-_\.\$~]{1}$/',
  54.     'info'            => '<span style="font-family:courier;font-weight:bold;">/ - . _ ~</span>'
  55. );
  56. $aWordSeparator array(
  57.     'pattern'         => '/^[\-_\.\$~]{1}$/',
  58.     'info'            => '<span style="font-family:courier;font-weight:bold;">- . _ ~</span>'
  59. );
  60.  
  61. $routingSeparator '>>>';
  62.  
  63. // define basic data contents (used for template)
  64. $aData array();
  65. $aData['PLUGIN_PATH']      mpGlobals::getInstance()->get('cfg/path/plugins''mod_rewrite/';
  66. $aData['CONTENT.BEFORE']   '';
  67. $aData['SESSID']           $sess->id;
  68. $aData['AREA']             $area;
  69. $aData['ACTION']           $action;
  70. $aData['IDCLIENT']         $client;
  71. $aData['USE_CHK']          (ModRewrite::isEnabled()) ' checked="checked"' '';
  72. $aData['BGCOLOR_ENABLED']  $aBgColor['enabled'];
  73. $aData['BGCOLOR_DISABLED'$aBgColor['disabled'];
  74.  
  75. // mr root dir
  76. $aData['ROOTDIR']       $aMrCfg['rootdir'];
  77. $aData['ROOTDIR_ERROR''';
  78.  
  79. // mr check root dir
  80. $aData['CHECKROOTDIR_CHK'($aMrCfg['checkrootdir'== 1' checked="checked"' '';
  81.  
  82. // mr start from root
  83. $aData['STARTFROMROOT_CHK'($aMrCfg['startfromroot'== 1' checked="checked"' '';
  84.  
  85. // mr prevent duplicated content
  86. $aData['PREVENT_DUPLICATED_CONTENT_CHK'($aMrCfg['prevent_duplicated_content'== 1' checked="checked"' '';
  87.  
  88. // mr language usage
  89. $aData['USE_LANGUAGE_CHK']           ($aMrCfg['use_language'== 1' checked="checked"' '';
  90. $aData['USE_LANGUAGE_NAME_CHK']      ($aMrCfg['use_language_name'== 1' checked="checked"' '';
  91. $aData['USE_LANGUAGE_NAME_DISABLED'($aMrCfg['use_language'== 1'' ' disabled="disabled"';
  92.  
  93. // mr client usage
  94. $aData['USE_CLIENT_CHK']           ($aMrCfg['use_client'== 1' checked="checked"' '';
  95. $aData['USE_CLIENT_NAME_CHK']      ($aMrCfg['use_client_name'== 1' checked="checked"' '';
  96. $aData['USE_CLIENT_NAME_DISABLED'($aMrCfg['use_client'== 1'' ' disabled="disabled"';
  97.  
  98. // mr lowecase uri
  99. $aData['USE_LOWERCASE_URI_CHK']         ($aMrCfg['use_lowercase_uri'== 1' checked="checked"' '';
  100.  
  101. // mr category/category word separator
  102. $aData['CATEGORY_SEPARATOR']             $aMrCfg['category_seperator'];
  103. $aData['CATEGORY_SEPARATOR_ATTRIB']      '';
  104. $aData['CATEGORY_WORD_SEPARATOR']        $aMrCfg['category_word_seperator'];
  105. $aData['CATEGORY_WORD_SEPARATOR_ATTRIB''';
  106. $aData['CATEGORY_SEPARATOR_ERROR']      '';
  107. $aData['CATEGORY_WORD_SEPARATOR_ERROR''';
  108.  
  109. // mr article/article word separator
  110. $aData['ARTICLE_SEPARATOR']             $aMrCfg['article_seperator'];
  111. $aData['ARTICLE_SEPARATOR_ATTRIB']      '';
  112. $aData['ARTICLE_WORD_SEPARATOR']        $aMrCfg['article_word_seperator'];
  113. $aData['ARTICLE_WORD_SEPARATOR_ATTRIB''';
  114. $aData['ARTICLE_SEPARATOR_ERROR']      '';
  115. $aData['ARTICLE_WORD_SEPARATOR_ERROR''';
  116.  
  117. $aData['CAT_ART_SEP_MSG']    '(Mögliche Werte: ' $aSeparator['info'')';
  118. $aData['WORD_SEPARATOR_MSG''(Mögliche Werte: ' $aWordSeparator['info'')';
  119.  
  120. // mr file extension
  121. $aData['FILE_EXTENSION']       $aMrCfg['file_extension'];
  122. $aData['FILE_EXTENSION_ERROR''';
  123.  
  124. // mr category name resolve percentage
  125. $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE']       $aMrCfg['category_resolve_min_percentage'];
  126. $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR''';
  127.  
  128. // mr add start article name to url
  129. $aData['ADD_STARTART_NAME_TO_URL_CHK']   ($aMrCfg['add_startart_name_to_url'== 1' checked="checked"' '';
  130. $aData['ADD_STARTART_NAME_TO_URL_ERROR''';
  131. $aData['DEFAULT_STARTART_NAME']          $aMrCfg['default_startart_name'];
  132.  
  133. // mr rewrite urls at
  134. $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']      ($aMrCfg['rewrite_urls_at_congeneratecode'== 1' checked="checked"' '';
  135. $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK'($aMrCfg['rewrite_urls_at_front_content_output'== 1' checked="checked"' '';
  136. $aData['CONTENT.AFTER''';
  137.  
  138. // mr rewrite routing
  139. $data '';
  140. if (is_array($aMrCfg['routing'])) {
  141.     foreach ($aMrCfg['routing'as $uri => $route){
  142.         $data .= $uri $routingSeparator $route "\n";
  143.     }
  144. }
  145. $aData['REWRITE_ROUTING'$data;
  146.  
  147. // mr redirect invalid article
  148. $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK'($aMrCfg['redirect_invalid_article_to_errorsite'== 1' checked="checked"' '';
  149.  
  150.  
  151. ####################################################################################################
  152. ##### Action processing
  153.  
  154. if ($action == 'index'{
  155.  
  156.     _actionIndex();
  157.  
  158. elseif ($action == 'save'{
  159.  
  160.     _actionSave();
  161.  
  162. elseif ($action == 'reset'{
  163.  
  164.     _actionReset();
  165.  
  166. }
  167.  
  168.  
  169. // Loop data array, fill'n output template
  170. foreach ($aData as $p => $v{
  171.     $oTpl->set('s'$p$v);
  172. }
  173. $oTpl->generate(
  174.     $oGlob->get('cfg/path/contenido'$oGlob->get('cfg/path/plugins''mod_rewrite/templates/content.html'00
  175. );
  176.  
  177.  
  178. ####################################################################################################
  179. ##### Functions
  180.  
  181. function _actionIndex(){
  182.     // donut
  183. }
  184.  
  185.  
  186. function _actionSave(){
  187.  
  188.     $oGlob  mpGlobals::getInstance();
  189.     $cfg    $oGlob->get('cfg');
  190.     $aData  $oGlob->get('aData');
  191.  
  192.     $bError false;
  193.  
  194.     $request (count($_POST0$_POST $_GET;
  195.     mr_requestCleanup($request);
  196.  
  197.     // use mod_rewrite
  198.     if (mr_arrayValue($request'use'== 1{
  199.         $aData['USE_CHK'' checked="checked"';
  200.         $aMR['mod_rewrite']['use'1;
  201.     else {
  202.         $aData['USE_CHK''';
  203.         $aMR['mod_rewrite']['use'0;
  204.     }
  205.  
  206.     // root dir
  207.     if (mr_arrayValue($request'rootdir'''!== ''{
  208.         if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/'$request['rootdir'])) {
  209.             $aData['ROOTDIR_ERROR'_notifyBox('error''Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen [a-zA-Z0-9\-_\/\.]');
  210.             $bError true;
  211.         elseif (!is_dir($_SERVER['DOCUMENT_ROOT'$request['rootdir'])) {
  212.  
  213.             if (mr_arrayValue($request'checkrootdir'== 1{
  214.                 // root dir check is enabled, this results in error
  215.                 $aData['ROOTDIR_ERROR'_notifyBox('error''Das angegebene Verzeichnis "' $_SERVER['DOCUMENT_ROOT'$request['rootdir''" existiert nicht');
  216.                 $bError true;
  217.             else {
  218.                 // root dir check ist disabled, take over the setting and output a warning.
  219.                 $aData['ROOTDIR_ERROR'_notifyBox('warning''Das angegebene Verzeichnis "' $request['rootdir''" existiert nicht im aktuellen DOCUMENT_ROOT "' $_SERVER['DOCUMENT_ROOT''". Das kann vorkommen, wenn das DOCUMENT_ROOT des Clients vom Contenido Backend DOCUMENT_ROOT abweicht. Die Einstellung wird dennoch &uuml;bernommen, da die &Uuml;berpr&uuml;fung abgeschaltet wurde');
  220.             }
  221.         }
  222.         $aData['ROOTDIR']              htmlentities($request['rootdir']);
  223.         $aMR['mod_rewrite']['rootdir'$request['rootdir'];
  224.     }
  225.  
  226.     // root dir check
  227.     if (mr_arrayValue($request'checkrootdir'== 1{
  228.         $aData['CHECKROOTDIR_CHK'' checked="checked"';
  229.         $aMR['mod_rewrite']['checkrootdir'1;
  230.     else {
  231.         $aData['CHECKROOTDIR_CHK''';
  232.         $aMR['mod_rewrite']['checkrootdir'0;
  233.     }
  234.  
  235.     // start from root
  236.     if (mr_arrayValue($request'startfromroot'== 1{
  237.         $aData['STARTFROMROOT_CHK']          ' checked="checked"';
  238.         $aMR['mod_rewrite']['startfromroot'1;
  239.     else {
  240.         $aData['STARTFROMROOT_CHK''';
  241.         $aMR['mod_rewrite']['startfromroot'0;
  242.     }
  243.  
  244.     // prevent duplicated content
  245.     if (mr_arrayValue($request'prevent_duplicated_content'== 1{
  246.         $aData['PREVENT_DUPLICATED_CONTENT_CHK']          ' checked="checked"';
  247.         $aMR['mod_rewrite']['prevent_duplicated_content'1;
  248.     else {
  249.         $aData['PREVENT_DUPLICATED_CONTENT_CHK']         '';
  250.         $aMR['mod_rewrite']['prevent_duplicated_content'0;
  251.     }
  252.  
  253.     // language settings
  254.     if (mr_arrayValue($request'use_language'== 1{
  255.         $aData['USE_LANGUAGE_CHK']           ' checked="checked"';
  256.         $aData['USE_LANGUAGE_NAME_DISABLED''';
  257.         $aMR['mod_rewrite']['use_language']  1;
  258.         if (mr_arrayValue($request'use_language_name'== 1{
  259.             $aData['USE_LANGUAGE_NAME_CHK']          ' checked="checked"';
  260.             $aMR['mod_rewrite']['use_language_name'1;
  261.         else {
  262.             $aData['USE_LANGUAGE_NAME_CHK']          '';
  263.             $aMR['mod_rewrite']['use_language_name'0;
  264.         }
  265.     else {
  266.         $aData['USE_LANGUAGE_CHK']               '';
  267.         $aData['USE_LANGUAGE_NAME_DISABLED']     ' disabled="disabled"';
  268.         $aMR['mod_rewrite']['use_language']      0;
  269.         $aData['USE_LANGUAGE_NAME_CHK']          '';
  270.         $aMR['mod_rewrite']['use_language_name'0;
  271.     }
  272.  
  273.     // client settings
  274.     if (mr_arrayValue($request'use_client'== 1{
  275.         $aData['USE_CLIENT_CHK']           ' checked="checked"';
  276.         $aData['USE_CLIENT_NAME_DISABLED''';
  277.         $aMR['mod_rewrite']['use_client']  1;
  278.         if (mr_arrayValue($request'use_client_name'== 1{
  279.             $aData['USE_CLIENT_NAME_CHK']          ' checked="checked"';
  280.             $aMR['mod_rewrite']['use_client_name'1;
  281.         else {
  282.             $aData['USE_CLIENT_NAME_CHK']          '';
  283.             $aMR['mod_rewrite']['use_client_name'0;
  284.         }
  285.     else {
  286.         $aData['USE_CLIENT_CHK']               '';
  287.         $aData['USE_CLIENT_NAME_DISABLED']     ' disabled="disabled"';
  288.         $aMR['mod_rewrite']['use_client']      0;
  289.         $aData['USE_CLIENT_NAME_CHK']          '';
  290.         $aMR['mod_rewrite']['use_client_name'0;
  291.     }
  292.  
  293.     // use lowercase uri
  294.     if (mr_arrayValue($request'use_lowercase_uri'== 1{
  295.         $aData['USE_LOWERCASE_URI_CHK']          ' checked="checked"';
  296.         $aMR['mod_rewrite']['use_lowercase_uri'1;
  297.     else {
  298.         $aData['USE_LOWERCASE_URI_CHK']          '';
  299.         $aMR['mod_rewrite']['use_lowercase_uri'0;
  300.     }
  301.  
  302.     $aData['CATEGORY_SEPARATOR_ATTRIB']                '';
  303.     $aData['CATEGORY_WORD_SEPARATOR_ATTRIB']           '';
  304.     $aData['ARTICLE_SEPARATOR_ATTRIB']                 '';
  305.     $aData['ARTICLE_WORD_SEPARATOR_ATTRIB']            '';
  306.  
  307.     $separatorPattern $oGlob->get('aSeparator/pattern');
  308.     $separatorInfo    $oGlob->get('aSeparator/info');
  309.  
  310.     $wordSeparatorPattern $oGlob->get('aWordSeparator/pattern');
  311.     $wordSeparatorInfo    $oGlob->get('aWordSeparator/info');
  312.  
  313.     $categorySeperator mr_arrayValue($request'category_seperator''');
  314.     $categoryWordSeperator mr_arrayValue($request'category_word_seperator''');
  315.     $articleSeperator mr_arrayValue($request'article_seperator''');
  316.     $articleWordSeperator mr_arrayValue($request'article_word_seperator''');
  317.  
  318.     // category seperator
  319.     if ($categorySeperator == ''{
  320.         $aData['CATEGORY_SEPARATOR_ERROR'_notifyBox('error''Bitte Trenner (' $separatorInfo ') für Kategorie angeben');
  321.         $bError true;
  322.     elseif (!preg_match($separatorPattern$categorySeperator)) {
  323.         $aData['CATEGORY_SEPARATOR_ERROR'_notifyBox('error''Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen: ' $separatorInfo);
  324.         $bError true;
  325.  
  326.     // category word seperator
  327.     elseif ($categoryWordSeperator == ''{
  328.         $aData['CATEGORY_WORD_SEPARATOR_ERROR'_notifyBox('error''Bitte Trenner (' $wordSeparatorInfo ') für Kategoriewörter angeben');
  329.         $bError true;
  330.     elseif (!preg_match($wordSeparatorPattern$categoryWordSeperator)) {
  331.         $aData['CATEGORY_WORD_SEPARATOR_ERROR'_notifyBox('error''Trenner für Kategoriewörter ist ungültig, erlaubt ist eines der Zeichen: ' $wordSeparatorInfo);
  332.         $bError true;
  333.  
  334.     // article seperator
  335.     elseif ($articleSeperator == ''{
  336.         $aData['ARTICLE_SEPARATOR_ERROR'_notifyBox('error''Bitte Trenner (' $separatorInfo ') für Artikel angeben''<br>';
  337.         $bError true;
  338.     elseif (!preg_match($separatorPattern$articleSeperator)) {
  339.         $aData['ARTICLE_SEPARATOR_ERROR'_notifyBox('error''Trenner für Artikel ist ungültig, erlaubt ist eines der Zeichen: ' $separatorInfo);
  340.         $bError true;
  341.  
  342.     // article word seperator
  343.     elseif ($articleWordSeperator == ''{
  344.         $aData['ARTICLE_WORD_SEPARATOR_ERROR'_notifyBox('error''Bitte Trenner (' $wordSeparatorInfo ') für Artikelwörter angeben');
  345.         $bError true;
  346.     elseif (!preg_match($wordSeparatorPattern$articleWordSeperator)) {
  347.         $aData['ARTICLE_WORD_SEPARATOR_ERROR'_notifyBox('error''Trenner für Artikelwörter ist ungültig, erlaubt ist eines der Zeichen: ' $wordSeparatorInfo);
  348.         $bError true;
  349.  
  350.     // category_seperator - category_word_seperator
  351.     elseif ($categorySeperator == $categoryWordSeperator{
  352.         $aData['CATEGORY_SEPARATOR_ERROR'_notifyBox('error''Trenner für Kategorie und Kategoriewörter dürfen nicht identisch sein');
  353.         $bError true;
  354.     // category_seperator - article_word_seperator
  355.     elseif ($categorySeperator == $articleWordSeperator{
  356.         $aData['CATEGORY_SEPARATOR_ERROR'_notifyBox('error''Trenner für Kategorie und Artikelwörter dürfen nicht identisch sein');
  357.         $bError true;
  358.     // article_seperator - article_word_seperator
  359.     elseif ($articleSeperator == $articleWordSeperator{
  360.         $aData['ARTICLE_SEPARATOR_ERROR'_notifyBox('error''Trenner für Kategorie-Artikel und Artikelwörter dürfen nicht identisch sein');
  361.         $bError true;
  362.     }
  363.  
  364.     $aData['CATEGORY_SEPARATOR']                   htmlentities($categorySeperator);
  365.     $aMR['mod_rewrite']['category_seperator']      $categorySeperator;
  366.     $aData['CATEGORY_WORD_SEPARATOR']              htmlentities($categoryWordSeperator);
  367.     $aMR['mod_rewrite']['category_word_seperator'$categoryWordSeperator;
  368.     $aData['ARTICLE_SEPARATOR']                    htmlentities($articleSeperator);
  369.     $aMR['mod_rewrite']['article_seperator']       $articleSeperator;
  370.     $aData['ARTICLE_WORD_SEPARATOR']               htmlentities($articleWordSeperator);
  371.     $aMR['mod_rewrite']['article_word_seperator']  $articleWordSeperator;
  372.  
  373.     // file extension
  374.     if (mr_arrayValue($request'file_extension'''!== ''{
  375.         if (!preg_match('/^\.([a-zA-Z0-9\-_\/])*$/'$request['file_extension'])) {
  376.             $aData['FILE_EXTENSION_ERROR'_notifyBox('error''Die Dateiendung hat ein ungültiges Format, erlaubt sind die Zeichen \.([a-zA-Z0-9\-_\/])');
  377.             $bError true;
  378.         }
  379.         $aData['FILE_EXTENSION'htmlentities($request['file_extension']);
  380.         $aMR['mod_rewrite']['file_extension'$request['file_extension'];
  381.     else {
  382.         $aData['FILE_EXTENSION''.html';
  383.         $aMR['mod_rewrite']['file_extension''.html';
  384.     }
  385.  
  386.     // category resolve min percentage
  387.     if (isset($request['category_resolve_min_percentage'])) {
  388.         if (!is_numeric($request['category_resolve_min_percentage'])) {
  389.             $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR'_notifyBox('error''Wert muss numerisch sein.');
  390.             $bError true;
  391.         elseif ($request['category_resolve_min_percentage'|| $request['category_resolve_min_percentage'100{
  392.             $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR'_notifyBox('error''Wert muss zwischen 0 und 100 sein.');
  393.             $bError true;
  394.         }
  395.         $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE'$request['category_resolve_min_percentage'];
  396.         $aMR['mod_rewrite']['category_resolve_min_percentage'$request['category_resolve_min_percentage'];
  397.     else {
  398.         $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE''75';
  399.         $aMR['mod_rewrite']['category_resolve_min_percentage''75';
  400.     }
  401.  
  402.     // add start article name to url
  403.     if (mr_arrayValue($request'add_startart_name_to_url'== 1{
  404.         $aData['ADD_STARTART_NAME_TO_URL_CHK']          ' checked="checked"';
  405.         $aMR['mod_rewrite']['add_startart_name_to_url'1;
  406.         if (mr_arrayValue($request'add_startart_name_to_url'''!== ''{
  407.             if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/'$request['default_startart_name'])) {
  408.                 $aData['ADD_STARTART_NAME_TO_URL_ERROR'_notifyBox('error''Der Artikelname hat ein ungültiges Format, erlaubt sind die Zeichen /^[a-zA-Z0-9\-_\/\.]*$/');
  409.                 $bError true;
  410.             }
  411.             $aData['DEFAULT_STARTART_NAME']              htmlentities($request['default_startart_name']);
  412.             $aMR['mod_rewrite']['default_startart_name'$request['default_startart_name'];
  413.         else {
  414.             $aData['DEFAULT_STARTART_NAME']              '';
  415.             $aMR['mod_rewrite']['default_startart_name''';
  416.         }
  417.     else {
  418.         $aData['ADD_STARTART_NAME_TO_URL_CHK']          '';
  419.         $aMR['mod_rewrite']['add_startart_name_to_url'0;
  420.         $aData['DEFAULT_STARTART_NAME']                 '';
  421.         $aMR['mod_rewrite']['default_startart_name']    '';
  422.     }
  423.  
  424.     // rewrite urls at
  425.     if (mr_arrayValue($request'rewrite_urls_at'== 'congeneratecode'{
  426.         $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']               ' checked="checked"';
  427.         $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK']          '';
  428.         $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode']      1;
  429.         $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'0;
  430.     else {
  431.         $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']               '';
  432.         $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK']          ' checked="checked"';
  433.         $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode']      0;
  434.         $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'1;
  435.     }
  436.  
  437.     // routing
  438.     if (isset($request['rewrite_routing'])) {
  439.         $aRouting array();
  440.         $items explode("\n"$request['rewrite_routing']);
  441.         foreach ($items as $p => $v{
  442.             $routingDef explode($oGlob->get('routingSeparator')$v);
  443.             if (count($routingDef!== 2{
  444.                 continue;
  445.             }
  446.             $routingDef[0trim($routingDef[0]);
  447.             $routingDef[1trim($routingDef[1]);
  448.             if ($routingDef[0== ''{
  449.                 continue;
  450.             }
  451.             $aRouting[$routingDef[0]] $routingDef[1];
  452.         }
  453.         $aData['REWRITE_ROUTING']      htmlentities($request['rewrite_routing']);
  454.         $aMR['mod_rewrite']['routing'$aRouting;
  455.     else {
  456.         $aData['REWRITE_ROUTING']      '';
  457.         $aMR['mod_rewrite']['routing'array();
  458.     }
  459.  
  460.     // redirect invalid article to errorsite
  461.     if (isset($request['redirect_invalid_article_to_errorsite'])) {
  462.         $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK']          ' checked="checked"';
  463.         $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'1;
  464.     else {
  465.         $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK']          '';
  466.         $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'0;
  467.     }
  468.  
  469.     if ($bError{
  470.         $aData['CONTENT.BEFORE'_notifyBox('error''Bitte überprüfen Sie ihre Eingaben');
  471.         $oGlob->set('aData'$aData);
  472.         return;
  473.     }
  474.  
  475.     if ($oGlob->get('debug'== true{
  476.         echo _notifyBox('info''Debug');
  477.         echo '<pre class="example">';print_r($aMR['mod_rewrite']);echo '</pre>';
  478.         echo _notifyBox('info''Konfiguration wurde <b>nicht</b> gespeichert, weil debugging aktiv ist');
  479.         return;
  480.     }
  481.  
  482.     $bSeparatorModified _separatorModified($aMR['mod_rewrite']);
  483.  
  484.     $options['key'$cfg['path']['contenido'$cfg['path']['plugins''mod_rewrite/includes/config.mod_rewrite_' $oGlob->get('client''.php';
  485.  
  486.     $config ConfigFactory::get('filestorage'$options);
  487.  
  488.     if ($config->set($aMR)) {
  489.         $sMsg 'Konfiguration wurde gespeichert';
  490.         if ($bSeparatorModified{
  491.             mr_loadConfiguration($oGlob->get('client')true);
  492. ##++##            ModRewrite::resetAliases();
  493. ##++##            $sMsg .= ' und die Aliase wurden zurückgesetzt';
  494.         }
  495.         $aData['CONTENT.BEFORE'_notifyBox('info'$sMsg);
  496.     else {
  497.         $aData['CONTENT.BEFORE'_notifyBox('error''Konfiguration konnte nicht gespeichert werden. Überprüfen Sie bitte die Schreibrechte für ' $options['key']);
  498.     }
  499.  
  500.     $oGlob->set('aData'$aData);
  501. }
  502.  
  503.  
  504. function _actionReset(){
  505.     $oGlob mpGlobals::getInstance();
  506.     $oGlob->set('aData/CONTENT.BEFORE'_notifyBox('info''Aliase wurden zurückgesetzt'));
  507. }
  508.  
  509.  
  510. function _separatorModified(&$aNewCfg){
  511.     $aCfg ModRewrite::getConfig();
  512.  
  513.     if ($aCfg['category_seperator'!= $aNewCfg['category_seperator']{
  514.         return true;
  515.     elseif ($aCfg['category_word_seperator'!= $aNewCfg['category_word_seperator']{
  516.         return true;
  517.     elseif ($aCfg['article_seperator'!= $aNewCfg['article_seperator']{
  518.         return true;
  519.     elseif ($aCfg['article_word_seperator'!= $aNewCfg['article_word_seperator']{
  520.         return true;
  521.     }
  522.     return false;
  523. }
  524.  
  525.  
  526. function _notifyBox($type$msg{
  527.     $oNotification mpGlobals::getInstance()->get('notification');
  528.     return $oNotification->returnNotification($type$msg'<br>';
  529. }

Documentation generated on Tue, 25 Nov 2008 22:07:44 +0100 by phpDocumentor 1.4.1