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. $notify new Contenido_Notification();
  29. $tpl    new Template();
  30.  
  31. // some settings
  32. $aBgColor array(
  33.     'enabled'  => '#ffffff',
  34.     'disabled' => '#dadada'
  35. );
  36. $aCatArtSeparator array(
  37.     'pattern' => '/^[\-_\.\|\$\%]{1}$/',
  38.     'info'    => '<span style="font-family:courier">"-|._$%"</span>'
  39. );
  40. $routingSeparator '>>>';
  41.  
  42. // define basic data contents (used for template)
  43. $aData array();
  44. $aData['CONTENT.BEFORE']   '';
  45. $aData['SESSID']           $sess->id;
  46. $aData['AREA']             $area;
  47. $aData['ACTION']           $action;
  48. $aData['IDCLIENT']         $client;
  49. $aData['USE_CHK']          ($cfg['mod_rewrite']['use'== 1' checked="checked"' '';
  50. $aData['BGCOLOR_ENABLED']  $aBgColor['enabled'];
  51. $aData['BGCOLOR_DISABLED'$aBgColor['disabled'];
  52.  
  53. // mr root dir
  54. $aData['ROOTDIR']       $cfg['mod_rewrite']['rootdir'];
  55. $aData['ROOTDIR_ERROR''';
  56.  
  57. // mr check root dir
  58. $aData['CHECKROOTDIR_CHK'($cfg['mod_rewrite']['checkrootdir'== 1' checked="checked"' '';
  59.  
  60. // mr start from root
  61. $aData['STARTFROMROOT_CHK'($cfg['mod_rewrite']['startfromroot'== 1' checked="checked"' '';
  62.  
  63. // mr language usage
  64. $aData['USE_LANGUAGE_CHK']           ($cfg['mod_rewrite']['use_language'== 1' checked="checked"' '';
  65. $aData['USE_LANGUAGE_NAME_CHK']      ($cfg['mod_rewrite']['use_language_name'== 1' checked="checked"' '';
  66. $aData['USE_LANGUAGE_NAME_DISABLED'($cfg['mod_rewrite']['use_language'== 1'' ' disabled="disabled"';
  67.  
  68. // mr client usage
  69. $aData['USE_CLIENT_CHK']           ($cfg['mod_rewrite']['use_client'== 1' checked="checked"' '';
  70. $aData['USE_CLIENT_NAME_CHK']      ($cfg['mod_rewrite']['use_client_name'== 1' checked="checked"' '';
  71. $aData['USE_CLIENT_NAME_DISABLED'($cfg['mod_rewrite']['use_client'== 1'' ' disabled="disabled"';
  72.  
  73. // mr lowecase uri
  74. $aData['USE_LOWERCASE_URI_CHK']           ($cfg['mod_rewrite']['use_lowercase_uri'== 1' checked="checked"' '';
  75. $aData['USE_CATEGORIES_AS_HTML_FILE_CHK'($cfg['mod_rewrite']['use_categories_as_html_file'== 1' checked="checked"' '';
  76.  
  77. // mr category/category word separator
  78. $aData['CATEGORY_SEPERATOR']            $cfg['mod_rewrite']['category_seperator'];
  79. $aData['CATEGORY_SEPERATOR_ATTRIB']      '';
  80. $aData['CATEGORY_WORD_SEPERATOR']        $cfg['mod_rewrite']['category_word_seperator'];
  81. $aData['CATEGORY_WORD_SEPERATOR_ATTRIB''';
  82. if ($cfg['mod_rewrite']['use_categories_as_html_file'!== 1{
  83.     $aData['CATEGORY_SEPERATOR_ATTRIB']      ' style="background-color:' $aBgColor['disabled''"';
  84.     $aData['CATEGORY_WORD_SEPERATOR_ATTRIB'' style="background-color:' $aBgColor['disabled''"';
  85. }
  86. $aData['CATEGORY_SEPERATOR_ERROR']      '';
  87. $aData['CATEGORY_WORD_SEPERATOR_ERROR''';
  88.  
  89. // mr article/article word separator
  90. $aData['ARTICLE_SEPERATOR']             $cfg['mod_rewrite']['article_seperator'];
  91. $aData['ARTICLE_SEPERATOR_ATTRIB']      '';
  92. $aData['ARTICLE_WORD_SEPERATOR']        $cfg['mod_rewrite']['article_word_seperator'];
  93. $aData['ARTICLE_WORD_SEPERATOR_ATTRIB''';
  94. if ($cfg['mod_rewrite']['use_categories_as_html_file'!== 1{
  95.     $aData['ARTICLE_SEPERATOR_ATTRIB']      ' style="background-color:' $aBgColor['disabled''"';
  96.     $aData['ARTICLE_WORD_SEPERATOR_ATTRIB'' style="background-color:' $aBgColor['disabled''"';
  97. }
  98. $aData['ARTICLE_SEPERATOR_ERROR']      '';
  99. $aData['ARTICLE_WORD_SEPERATOR_ERROR''';
  100.  
  101. $aData['CAT_ART_SEP_MSG''(Mögliche Werte: ' $aCatArtSeparator['info'')';
  102.  
  103. // mr file extension
  104. $aData['FILE_EXTENSION']       $cfg['mod_rewrite']['file_extension'];
  105. $aData['FILE_EXTENSION_ERROR''';
  106.  
  107. // mr category name resolve percentage
  108. $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE']       $cfg['mod_rewrite']['category_resolve_min_percentage'];
  109. $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR''';
  110.  
  111. // mr add start article name to url
  112. $aData['ADD_STARTART_NAME_TO_URL_CHK']   ($cfg['mod_rewrite']['add_startart_name_to_url'== 1' checked="checked"' '';
  113. $aData['ADD_STARTART_NAME_TO_URL_ERROR''';
  114. $aData['DEFAULT_STARTART_NAME']          $cfg['mod_rewrite']['default_startart_name'];
  115.  
  116. // mr rewrite urls at
  117. $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']      ($cfg['mod_rewrite']['rewrite_urls_at_congeneratecode'== 1' checked="checked"' '';
  118. $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK'($cfg['mod_rewrite']['rewrite_urls_at_front_content_output'== 1' checked="checked"' '';
  119. $aData['CONTENT.AFTER''';
  120.  
  121. // mr rewrite routing
  122. $data '';
  123. if (is_array($cfg['mod_rewrite']['routing'])) {
  124.     foreach ($cfg['mod_rewrite']['routing'as $uri => $route){
  125.         $data .= $uri $routingSeparator $route "\n";
  126.     }
  127. }
  128. $aData['REWRITE_ROUTING'$data;
  129.  
  130. // mr redirect invalid article
  131. $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK'($cfg['mod_rewrite']['redirect_invalid_article_to_errorsite'== 1' checked="checked"' '';
  132.  
  133.  
  134. ####################################################################################################
  135. ##### Action processing
  136.  
  137. if ($action == 'index'{
  138.  
  139.     _actionIndex();
  140.  
  141. elseif ($action == 'save'{
  142.  
  143.     _actionSave();
  144.  
  145. elseif ($action == 'reset'{
  146.  
  147.     _actionReset();
  148.  
  149. }
  150.  
  151.  
  152. // Loop data array, fill'n output template
  153. foreach ($aData as $p => $v{
  154.     $tpl->set('s'$p$v);
  155. }
  156. $tpl->generate(
  157.     $cfg['path']['contenido'$cfg['path']['plugins''mod_rewrite/templates/content.html'00
  158. );
  159.  
  160.  
  161. ####################################################################################################
  162. ##### Functions
  163.  
  164. function _actionIndex(){
  165.     global $aData;
  166. }
  167.  
  168.  
  169. function _actionSave(){
  170.     global $cfg$client$aData;
  171.  
  172.     $bError false;
  173.  
  174.     $request (count($_POST0$_POST $_GET;
  175.     mr_requestCleanup($request);
  176.  
  177.     // use mod_rewrite
  178.     if (mr_arrayValue($request'use'== 1{
  179.         $aData['USE_CHK'' checked="checked"';
  180.         $aMR['mod_rewrite']['use'1;
  181.     else {
  182.         $aData['USE_CHK''';
  183.         $aMR['mod_rewrite']['use'0;
  184.     }
  185.  
  186.     // root dir
  187.     if (mr_arrayValue($request'rootdir'''!== ''{
  188.         if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/'$request['rootdir'])) {
  189.             $aData['ROOTDIR_ERROR'_notifyBox('error''Das Rootverzeichnis hat ein ungültiges Format, erlaubt sind die Zeichen [a-zA-Z0-9\-_\/\.]');
  190.             $bError true;
  191.         elseif (!is_dir($_SERVER['DOCUMENT_ROOT'$request['rootdir'])) {
  192.  
  193.             if (mr_arrayValue($request'checkrootdir'== 1{
  194.                 // root dir check is enabled, this results in error
  195.                 $aData['ROOTDIR_ERROR'_notifyBox('error''Das angegebene Verzeichnis "' $_SERVER['DOCUMENT_ROOT'$request['rootdir''" existiert nicht');
  196.                 $bError true;
  197.             else {
  198.                 // root dir check ist disabled, take over the setting and output a warning.
  199.                 $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');
  200.             }
  201.         }
  202.         $aData['ROOTDIR']              htmlentities($request['rootdir']);
  203.         $aMR['mod_rewrite']['rootdir'$request['rootdir'];
  204.     }
  205.  
  206.     // root dir check
  207.     if (mr_arrayValue($request'checkrootdir'== 1{
  208.         $aData['CHECKROOTDIR_CHK'' checked="checked"';
  209.         $aMR['mod_rewrite']['checkrootdir'1;
  210.     else {
  211.         $aData['CHECKROOTDIR_CHK''';
  212.         $aMR['mod_rewrite']['checkrootdir'0;
  213.     }
  214.  
  215.  
  216.     // start from root
  217.     if (mr_arrayValue($request'rootdir'== 1{
  218.         $aData['STARTFROMROOT_CHK']          ' checked="checked"';
  219.         $aMR['mod_rewrite']['startfromroot'1;
  220.     else {
  221.         $aData['STARTFROMROOT_CHK''';
  222.         $aMR['mod_rewrite']['startfromroot'0;
  223.     }
  224.  
  225.     // language settings
  226.     if (mr_arrayValue($request'use_language'== 1{
  227.         $aData['USE_LANGUAGE_CHK']           ' checked="checked"';
  228.         $aData['USE_LANGUAGE_NAME_DISABLED''';
  229.         $aMR['mod_rewrite']['use_language']  1;
  230.         if (mr_arrayValue($request'use_language_name'== 1{
  231.             $aData['USE_LANGUAGE_NAME_CHK']          ' checked="checked"';
  232.             $aMR['mod_rewrite']['use_language_name'1;
  233.         else {
  234.             $aData['USE_LANGUAGE_NAME_CHK']          '';
  235.             $aMR['mod_rewrite']['use_language_name'0;
  236.         }
  237.     else {
  238.         $aData['USE_LANGUAGE_CHK']               '';
  239.         $aData['USE_LANGUAGE_NAME_DISABLED']     ' disabled="disabled"';
  240.         $aMR['mod_rewrite']['use_language']      0;
  241.         $aData['USE_LANGUAGE_NAME_CHK']          '';
  242.         $aMR['mod_rewrite']['use_language_name'0;
  243.     }
  244.  
  245.     // client settings
  246.     if (mr_arrayValue($request'use_client'== 1{
  247.         $aData['USE_CLIENT_CHK']           ' checked="checked"';
  248.         $aData['USE_CLIENT_NAME_DISABLED''';
  249.         $aMR['mod_rewrite']['use_client']  1;
  250.         if (mr_arrayValue($request'use_client_name'== 1{
  251.             $aData['USE_CLIENT_NAME_CHK']          ' checked="checked"';
  252.             $aMR['mod_rewrite']['use_client_name'1;
  253.         else {
  254.             $aData['USE_CLIENT_NAME_CHK']          '';
  255.             $aMR['mod_rewrite']['use_client_name'0;
  256.         }
  257.     else {
  258.         $aData['USE_CLIENT_CHK']               '';
  259.         $aData['USE_CLIENT_NAME_DISABLED']     ' disabled="disabled"';
  260.         $aMR['mod_rewrite']['use_client']      0;
  261.         $aData['USE_CLIENT_NAME_CHK']          '';
  262.         $aMR['mod_rewrite']['use_client_name'0;
  263.     }
  264.  
  265.     // use lowercase uri
  266.     if (mr_arrayValue($request'use_lowercase_uri'== 1{
  267.         $aData['USE_LOWERCASE_URI_CHK']          ' checked="checked"';
  268.         $aMR['mod_rewrite']['use_lowercase_uri'1;
  269.     else {
  270.         $aData['USE_LOWERCASE_URI_CHK']          '';
  271.         $aMR['mod_rewrite']['use_lowercase_uri'0;
  272.     }
  273.  
  274.     // use categories as html file
  275.     if (mr_arrayValue($request'use_categories_as_html_file'== 1{
  276.  
  277.         $aData['USE_CATEGORIES_AS_HTML_FILE_CHK']          ' checked="checked"';
  278.         $aMR['mod_rewrite']['use_categories_as_html_file'1;
  279.         $aData['CATEGORY_SEPERATOR_ATTRIB']                '';
  280.         $aData['CATEGORY_WORD_SEPERATOR_ATTRIB']           '';
  281.         $aData['ARTICLE_SEPERATOR_ATTRIB']                 '';
  282.         $aData['ARTICLE_WORD_SEPERATOR_ATTRIB']            '';
  283.  
  284.         $pattern $GLOBALS['aCatArtSeparator']['pattern'];
  285.         $info    $GLOBALS['aCatArtSeparator']['info'];
  286.  
  287.         // category seperator
  288.         if (mr_arrayValue($request'category_seperator'''== ''{
  289.             $aData['CATEGORY_SEPERATOR_ERROR'_notifyBox('error''Bitte Trenner (' $info ') für Kategorie angeben');
  290.             $bError true;
  291.         elseif (!preg_match($pattern$request['category_seperator'])) {
  292.             $aData['CATEGORY_SEPERATOR_ERROR'_notifyBox('error''Trenner für Kategorie ist ungültig, erlaubt ist eines der Zeichen [\-_\.\|]');
  293.             $bError true;
  294.  
  295.         // category word seperator
  296.         elseif (mr_arrayValue($request'category_word_seperator'''== ''{
  297.             $aData['CATEGORY_WORD_SEPERATOR_ERROR'_notifyBox('error''Bitte Trenner (' $info ') für Kategoriewörter angeben');
  298.             $bError true;
  299.         elseif (!preg_match($pattern$request['category_word_seperator'])) {
  300.             $aData['CATEGORY_WORD_SEPERATOR_ERROR'_notifyBox('error''Trenner für Kategoriewörter ist ungültig, erlaubt ist eines der Zeichen [\-_\.\|]');
  301.             $bError true;
  302.  
  303.         // article seperator
  304.         elseif (mr_arrayValue($request'article_seperator'''== ''{
  305.             $aData['ARTICLE_SEPERATOR_ERROR'_notifyBox('error''Bitte Trenner (' $info ') für Artikel angeben''<br>';
  306.             $bError true;
  307.         elseif (!preg_match($pattern$request['article_seperator'])) {
  308.             $aData['ARTICLE_SEPERATOR_ERROR'_notifyBox('error''Trenner für Artikel ist ungültig, erlaubt ist eines der Zeichen [\-_\.\|]');
  309.             $bError true;
  310.  
  311.         // article word seperator
  312.         elseif (mr_arrayValue($request'article_word_seperator'''== ''{
  313.             $aData['ARTICLE_WORD_SEPERATOR_ERROR'_notifyBox('error''Bitte Trenner (' $info ') für Artikelwörter angeben');
  314.             $bError true;
  315.         elseif (!preg_match($pattern$request['article_word_seperator'])) {
  316.             $aData['ARTICLE_WORD_SEPERATOR_ERROR'_notifyBox('error''Trenner für Artikelwörter ist ungültig, erlaubt ist eines der Zeichen [\-_\.\|]');
  317.             $bError true;
  318.  
  319.         // category seperator & article seperator
  320.         elseif ($request['category_seperator'== $request['article_seperator']{
  321.             $aData['ARTICLE_SEPERATOR_ERROR'_notifyBox('error''Trenner für Kategorie und Artikel sollten nicht identisch sein');
  322.             $bError true;
  323.         }
  324.  
  325.         $aData['CATEGORY_SEPERATOR']                   htmlentities($request['category_seperator']);
  326.         $aMR['mod_rewrite']['category_seperator']      $request['category_seperator'];
  327.         $aData['CATEGORY_WORD_SEPERATOR']              htmlentities($request['category_word_seperator']);
  328.         $aMR['mod_rewrite']['category_word_seperator'$request['category_word_seperator'];
  329.         $aData['ARTICLE_SEPERATOR']                    htmlentities($request['article_seperator']);
  330.         $aMR['mod_rewrite']['article_seperator']       $request['article_seperator'];
  331.         $aData['ARTICLE_WORD_SEPERATOR']               htmlentities($request['article_word_seperator']);
  332.         $aMR['mod_rewrite']['article_word_seperator']  $request['article_word_seperator'];
  333.  
  334.     else {
  335.  
  336.         $aData['USE_CATEGORIES_AS_HTML_FILE_CHK''';
  337.         $aMR['mod_rewrite']['use_categories_as_html_file'0;
  338.         $aData['CATEGORY_SEPERATOR_ATTRIB']                ' style="background-color:' $GLOBALS['aBgColor']['disabled''"';
  339.         $aData['CATEGORY_WORD_SEPERATOR_ATTRIB']           ' style="background-color:' $GLOBALS['aBgColor']['disabled''"';
  340.         $aData['ARTICLE_SEPERATOR_ATTRIB']                 ' style="background-color:' $GLOBALS['aBgColor']['disabled''"';
  341.         $aData['ARTICLE_WORD_SEPERATOR_ATTRIB']            ' style="background-color:' $GLOBALS['aBgColor']['disabled''"';
  342.  
  343.         // set the setting from configuration to not loose old values, bcause
  344.         // deactivated form elements will result in non existing request values
  345.         $aMR['mod_rewrite']['category_seperator']      $GLOBALS['cfg']['mod_rewrite']['category_seperator'];
  346.         $aMR['mod_rewrite']['category_word_seperator'$GLOBALS['cfg']['mod_rewrite']['category_word_seperator'];
  347.         $aMR['mod_rewrite']['article_seperator']       $GLOBALS['cfg']['mod_rewrite']['article_seperator'];
  348.         $aMR['mod_rewrite']['article_word_seperator']  $GLOBALS['cfg']['mod_rewrite']['article_word_seperator'];
  349.         $aData['CATEGORY_SEPERATOR']      $aMR['mod_rewrite']['category_seperator'];
  350.         $aData['CATEGORY_WORD_SEPERATOR'$aMR['mod_rewrite']['category_word_seperator'];
  351.         $aData['ARTICLE_SEPERATOR']       $aMR['mod_rewrite']['article_seperator'];
  352.         $aData['ARTICLE_WORD_SEPERATOR']  $aMR['mod_rewrite']['article_word_seperator'];
  353.  
  354.     }
  355.  
  356.     // file extension
  357.     if (mr_arrayValue($request'file_extension'''!== ''{
  358.         if (!preg_match('/^\.([a-zA-Z0-9\-_\/])*$/'$request['file_extension'])) {
  359.             $aData['FILE_EXTENSION_ERROR'_notifyBox('error''Die Dateiendung hat ein ungültiges Format, erlaubt sind die Zeichen \.([a-zA-Z0-9\-_\/])');
  360.             $bError true;
  361.         }
  362.         $aData['FILE_EXTENSION'htmlentities($request['file_extension']);
  363.         $aMR['mod_rewrite']['file_extension'$request['file_extension'];
  364.     else {
  365.         $aData['FILE_EXTENSION''.html';
  366.         $aMR['mod_rewrite']['file_extension''.html';
  367.     }
  368.  
  369.     // category resolve min percentage
  370.     if (isset($request['category_resolve_min_percentage'])) {
  371.         if (!is_numeric($request['category_resolve_min_percentage'])) {
  372.             $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR'_notifyBox('error''Wert muss numerisch sein.');
  373.             $bError true;
  374.         elseif ($request['category_resolve_min_percentage'|| $request['category_resolve_min_percentage'100{
  375.             $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE_ERROR'_notifyBox('error''Wert muss zwischen 0 und 100 sein.');
  376.             $bError true;
  377.         }
  378.         $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE'$request['category_resolve_min_percentage'];
  379.         $aMR['mod_rewrite']['category_resolve_min_percentage'$request['category_resolve_min_percentage'];
  380.     else {
  381.         $aData['CATEGORY_RESOLVE_MIN_PERCENTAGE''75';
  382.         $aMR['mod_rewrite']['category_resolve_min_percentage''75';
  383.     }
  384.  
  385.     // add start article name to url
  386.     if (mr_arrayValue($request'add_startart_name_to_url'== 1{
  387.         $aData['ADD_STARTART_NAME_TO_URL_CHK']          ' checked="checked"';
  388.         $aMR['mod_rewrite']['add_startart_name_to_url'1;
  389.         if (mr_arrayValue($request'add_startart_name_to_url'''!== ''{
  390.             if (!preg_match('/^[a-zA-Z0-9\-_\/\.]*$/'$request['default_startart_name'])) {
  391.                 $aData['ADD_STARTART_NAME_TO_URL_ERROR'_notifyBox('error''Der Artikelname hat ein ungültiges Format, erlaubt sind die Zeichen /^[a-zA-Z0-9\-_\/\.]*$/');
  392.                 $bError true;
  393.             }
  394.             $aData['DEFAULT_STARTART_NAME']              htmlentities($request['default_startart_name']);
  395.             $aMR['mod_rewrite']['default_startart_name'$request['default_startart_name'];
  396.         else {
  397.             $aData['DEFAULT_STARTART_NAME']              '';
  398.             $aMR['mod_rewrite']['default_startart_name''';
  399.         }
  400.     else {
  401.         $aData['ADD_STARTART_NAME_TO_URL_CHK']          '';
  402.         $aMR['mod_rewrite']['add_startart_name_to_url'0;
  403.         $aData['DEFAULT_STARTART_NAME']                 '';
  404.         $aMR['mod_rewrite']['default_startart_name']    '';
  405.     }
  406.  
  407.     // rewrite urls at
  408.     if (mr_arrayValue($request'rewrite_urls_at'== 'congeneratecode'{
  409.         $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']               ' checked="checked"';
  410.         $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK']          '';
  411.         $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode']      1;
  412.         $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'0;
  413.     else {
  414.         $aData['REWRITE_URLS_AT_CONGENERATECODE_CHK']               '';
  415.         $aData['REWRITE_URLS_AT_FRONT_CONTENT_OUTPUT_CHK']          ' checked="checked"';
  416.         $aMR['mod_rewrite']['rewrite_urls_at_congeneratecode']      0;
  417.         $aMR['mod_rewrite']['rewrite_urls_at_front_content_output'1;
  418.     }
  419.  
  420.     // routing
  421.     if (isset($request['rewrite_routing'])) {
  422.         $aRouting array();
  423.         $items explode("\n"$request['rewrite_routing']);
  424.         foreach ($items as $p => $v{
  425.             $routingDef explode($GLOBALS['routingSeparator']$v);
  426.             if (count($routingDef!== 2{
  427.                 continue;
  428.             }
  429.             $routingDef[0trim($routingDef[0]);
  430.             $routingDef[1trim($routingDef[1]);
  431.             if ($routingDef[0== ''{
  432.                 continue;
  433.             }
  434.             $aRouting[$routingDef[0]] $routingDef[1];
  435.         }
  436.         $aData['REWRITE_ROUTING']      htmlentities($request['rewrite_routing']);
  437.         $aMR['mod_rewrite']['routing'$aRouting;
  438.     else {
  439.         $aData['REWRITE_ROUTING']      '';
  440.         $aMR['mod_rewrite']['routing'array();
  441.     }
  442.  
  443.     // redirect invalid article to errorsite
  444.     if (isset($request['redirect_invalid_article_to_errorsite'])) {
  445.         $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK']          ' checked="checked"';
  446.         $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'1;
  447.     else {
  448.         $aData['REDIRECT_INVALID_ARTICLE_TO_ERRORSITE_CHK']          '';
  449.         $aMR['mod_rewrite']['redirect_invalid_article_to_errorsite'0;
  450.     }
  451.  
  452.  
  453.     if ($bError{
  454.         $aData['CONTENT.BEFORE'_notifyBox('error''Bitte überprüfen Sie ihre Eingaben');
  455.         return;
  456.     }
  457.  
  458.  
  459.     if (isset($GLOBALS['debug']&& $GLOBALS['debug'== true{
  460.         echo _notifyBox('info''Debug');
  461.         echo '<pre class="example">';print_r($aMR['mod_rewrite']);echo '</pre>';
  462.         echo _notifyBox('info''Konfiguration wurde <b>nicht</b> geschpeichert');
  463.         return;
  464.     }
  465.  
  466.     $options['key'$cfg['path']['contenido'$cfg['path']['plugins''mod_rewrite/includes/config.mod_rewrite_' $client '.php';
  467.  
  468.     $config ConfigFactory::get('serializer'$options);
  469.  
  470.     if ($config->set($aMR)) {
  471.         $aData['CONTENT.BEFORE'_notifyBox('info''Konfiguration wurde geschpeichert');
  472.     else {
  473.         $aData['CONTENT.BEFORE'_notifyBox('error''Konfiguration konnte nicht geschpeichert werden. Überprüfen Sie bitte die Schreibrechte für ' $options['key']);
  474.     }
  475. }
  476.  
  477.  
  478. function _actionReset(){
  479.     global $aData;
  480.     $aData['CONTENT.BEFORE'_notifyBox('info''Aliase wurden zurückgesetzt');
  481. }
  482.  
  483.  
  484. function _notifyBox($type$msg{
  485.     return $GLOBALS['notification']->returnNotification($type$msg'<br>';
  486. }

Documentation generated on Sun, 03 Aug 2008 22:22:08 +0200 by phpDocumentor 1.4.0