Source for file front_content_controller.php

Documentation is available at front_content_controller.php

  1. <?php
  2.  
  3. /**
  4.  * Mod Rewrite front_content.php controller. Does some preprocessing jobs, tries
  5.  * to set following variables, depending on mod rewrite configuration and if
  6.  * request part exists:
  7.  * - $client
  8.  * - $changeclient
  9.  * - $lang
  10.  * - $changelang
  11.  * - $idart
  12.  * - $idcat
  13.  *
  14.  * @author      Murat Purc <muratpurc.de>
  15.  * @copyright   © Murat Purc 2008
  16.  * @package     Contenido
  17.  * @subpackage  ModRewrite
  18.  */
  19.  
  20.  
  21. defined('CON_FRAMEWORK') or die('Illegal call');
  22.  
  23. global $client, $changeclient, $cfgClient, $lang, $changelang, $idart, $idcat, $path;
  24.  
  25. #$aMrCfg = ModRewrite::getConfig();
  26.  
  27.  
  28. $oDebug->addDebug(ModRewrite::getConfig(), 'front_content_controller.php mod rewrite config');
  29.  
  30.  
  31. // create an mod rewrite controller instance and execute processing
  32. $oMRController = new ModRewriteController($_SERVER['REQUEST_URI']);
  33. $oMRController->execute();
  34.  
  35. if ($oMRController->errorOccured()) {
  36.  
  37.     // an error occured (idcat and or idart couldn't catched by controller)
  38.  
  39.     $iRedirToErrPage = ModRewrite::getConfig('redirect_invalid_article_to_errorsite', 0);
  40.     // try to redirect to errorpage if desired
  41.     if ($iRedirToErrPage == 1 && (int) $client > 0 && (int) $lang > 0) {
  42.         global $errsite_idcat, $errsite_idart;
  43.  
  44.         if ($cfgClient['set'] != 'set')    {
  45.             rereadClients();
  46.         }
  47.  
  48.         // errorpage
  49.         $errurl  = "front_content.php?client=$client&idcat=".$errsite_idcat[$client]."&idart=".$errsite_idart[$client]."&lang=$lang&error=1";
  50.         $errsite = 'Location: ' . CEC_Hook::execute('Contenido.Frontend.CreateURL', $errurl);
  51.         mr_header($errsite);
  52.         exit();
  53.     }
  54.  
  55. } else {
  56.  
  57.     // set some global variables
  58.  
  59.     if ($oMRController->getClient()) {
  60.         $client = $oMRController->getClient();
  61.     }
  62.  
  63.     if ($oMRController->getChangeClient()) {
  64.         $changeclient = $oMRController->getChangeClient();
  65.     }
  66.  
  67.     if ($oMRController->getLang()) {
  68.         $lang = $oMRController->getLang();
  69.     }
  70.  
  71.     if ($oMRController->getChangeLang()) {
  72.         $changelang = $oMRController->getChangeLang();
  73.     }
  74.  
  75.     if ($oMRController->getIdArt()) {
  76.         $idart = $oMRController->getIdArt();
  77.     }
  78.  
  79.     if ($oMRController->getIdCat()) {
  80.         $idcat = $oMRController->getIdCat();
  81.     }
  82.  
  83.     if ($oMRController->getPath()) {
  84.         $path = $oMRController->getPath();
  85.     }
  86.  
  87. }
  88.  
  89. // some debugs
  90. $oDebug->addDebug($mr_preprocessedPageError, 'mr $mr_preprocessedPageError', __FILE__);
  91. $oDebug->addDebug($idart, 'mr $idart', __FILE__);
  92. $oDebug->addDebug($idcat, 'mr $idcat', __FILE__);
  93. $oDebug->addDebug($lang, 'mr $lang', __FILE__);
  94. $oDebug->addDebug($client, 'mr $client', __FILE__);

Documentation generated on Sun, 21 Dec 2008 21:42:53 +0100 by phpDocumentor 1.4.1