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. if (!defined('CON_FRAMEWORK')) {
  22.     die('Illegal call');
  23. }
  24.  
  25. global $client$changeclient$cfgClient$lang$changelang$idart$idcat$path;
  26.  
  27. #$aMrCfg = ModRewrite::getConfig();
  28.  
  29. $oDebug Contenido_mpDebug::getInstance();
  30.  
  31. $oDebug->addDebug(ModRewrite::getConfig()'front_content_controller.php mod rewrite config');
  32.  
  33.  
  34. // create an mod rewrite controller instance and execute processing
  35. $oMRController new ModRewriteController($_SERVER['REQUEST_URI']);
  36. $oMRController->execute();
  37.  
  38. if ($oMRController->errorOccured()) {
  39.  
  40.     // an error occured (idcat and or idart couldn't catched by controller)
  41.  
  42.     $iRedirToErrPage ModRewrite::getConfig('redirect_invalid_article_to_errorsite'0);
  43.     // try to redirect to errorpage if desired
  44.     if ($iRedirToErrPage == && (int) $client && (int) $lang 0{
  45.         global $errsite_idcat$errsite_idart;
  46.  
  47.         if ($cfgClient['set'!= 'set')    {
  48.             rereadClients();
  49.         }
  50.  
  51.         // errorpage
  52.         $errurl  "front_content.php?client=$client&idcat=".$errsite_idcat[$client]."&idart=".$errsite_idart[$client]."&lang=$lang&error=1";
  53.         $errsite 'Location: ' CEC_Hook::execute('Contenido.Frontend.CreateURL'$errurl);
  54.         mr_header($errsite);
  55.         exit();
  56.     }
  57.  
  58. else {
  59.  
  60.     // set some global variables
  61.  
  62.     if ($oMRController->getClient()) {
  63.         $client $oMRController->getClient();
  64.     }
  65.  
  66.     if ($oMRController->getChangeClient()) {
  67.         $changeclient $oMRController->getChangeClient();
  68.     }
  69.  
  70.     if ($oMRController->getLang()) {
  71.         $lang $oMRController->getLang();
  72.     }
  73.  
  74.     if ($oMRController->getChangeLang()) {
  75.         $changelang $oMRController->getChangeLang();
  76.     }
  77.  
  78.     if ($oMRController->getIdArt()) {
  79.         $idart $oMRController->getIdArt();
  80.     }
  81.  
  82.     if ($oMRController->getIdCat()) {
  83.         $idcat $oMRController->getIdCat();
  84.     }
  85.  
  86.     if ($oMRController->getPath()) {
  87.         $path $oMRController->getPath();
  88.     }
  89.  
  90. }
  91.  
  92. // some debugs
  93. $oDebug->addDebug($mr_preprocessedPageError'mr $mr_preprocessedPageError'__FILE__);
  94. $oDebug->addDebug($idart'mr $idart'__FILE__);
  95. $oDebug->addDebug($idcat'mr $idcat'__FILE__);
  96. $oDebug->addDebug($lang'mr $lang'__FILE__);
  97. $oDebug->addDebug($client'mr $client'__FILE__);

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