Frontend
[ class tree: Frontend ] [ index: Frontend ] [ all elements ]

Source for file IndexController.php

Documentation is available at IndexController.php

  1. <?php
  2. /**
  3. * DotBoost Technologies Inc.
  4. * DotKernel Application Framework
  5. *
  6. @category   DotKernel
  7. @package    Frontend
  8. @copyright  Copyright (c) 2009 DotBoost  Technologies (http://www.dotboost.com)
  9. @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
  10. @version    $Id: IndexController.php 158 2010-06-25 08:59:20Z teo $
  11. */
  12.  
  13. /**
  14.  * Frontend Module - Index Controller
  15.  * Is doing all the job for specific frontend control stuff
  16.  * @author     DotKernel Team <team@dotkernel.com>
  17.  */ 
  18.  
  19. // set Module and Action default values
  20. $defaultController $resource->route->controller->$requestModule;
  21. $requestController = isset($requestController&& $requestController !='Index' $requestController $defaultController;
  22. $defaultAction $resource->route->action->$requestModule->$requestController;
  23. $requestAction     = isset($requestAction&& $requestAction !=''         $requestAction     $defaultAction;
  24.  
  25. // start the template object, empty for the moment 
  26. require(DOTKERNEL_PATH '/' $requestModule '/' 'View.php');    
  27. $tpl View::getInstance(TEMPLATES_PATH '/' $requestModule);
  28. $tpl->init($requestModule$requestController$requestAction);
  29.  
  30. // assign Index Template file
  31. $tpl->setViewFile();
  32.  
  33. // set paths in templates
  34. $tpl->setViewPaths($config);
  35.  
  36. // display login box
  37. $tpl->setLoginBox();
  38.  
  39. /** 
  40.  * each Controller  must load its own specific models and views
  41.  */
  42. Dot_Settings :: loadControllerFiles($requestModule);
  43.  
  44. /**
  45.  * Load option(specific configuration file for current dot) file
  46.  * @todo linking N dots together
  47.  */
  48. $option Dot_Settings::getOptionVariables($requestModule,$requestController);
  49. $registry->option $option;
  50.  
  51. /**
  52.  * Start the variable for Page Title, this will be used as H1 tag too
  53.  */
  54. $pageTitle 'Overwrite Me Please !';
  55.  
  56. /**
  57.  * From this point , the control is taken by the Action specific controller
  58.  * call the Action specific file, but check first if exists
  59.  */
  60. $actionControllerPath CONTROLLERS_PATH '/' $requestModule '/' $requestController 'Controller.php';
  61. !file_exists($actionControllerPath?  $dotKernel->pageNotFound(:  require($actionControllerPath);
  62.     
  63. // set menus
  64. $tpl->setViewMenu($config);
  65.  
  66. // set SEO html tags from dots/seo.xml file
  67. $tpl->setSeoValues($pageTitle);
  68.  
  69. // dispaly message (error, warning, info)    
  70. $tpl->displayMessage();
  71.  
  72. // parse the main content block
  73. $tpl->parse('MAIN_CONTENT''tpl_main');
  74.  
  75. // show debugbar 
  76. if(TRUE == $config->settings->frontend->debugbar)
  77. {
  78.     $debug new Dot_Debug($db$tpl$config);
  79.     $debug->startTimer $startTime;
  80.     $debug->show();
  81. }
  82.  
  83. // parse and print the output
  84. $tpl->pparse('OUTPUT''tpl_index');

Documentation generated on Wed, 21 Jul 2010 07:34:40 +0000 by phpDocumentor 1.4.3