Пример #1
0
 /**
  * Start DotKernel
  * Pass controll to the Front Controller if it exists,
  * otherwise throw a 404 error
  */
 public static function gallop()
 {
     $registry = Zend_Registry::getInstance();
     $frontControllerPath = CONTROLLERS_PATH . '/' . $registry->requestModule . '/' . 'IndexController.php';
     if (file_exists($frontControllerPath)) {
         require $frontControllerPath;
     } else {
         Dot_Route::pageNotFound();
     }
 }
 * ''   - user have an empty token
 * Any other (string) value - the token
 *
 * See Dot_Auth::checkUserToken()
 */
$userToken = isset($_POST['userToken']) ? $_POST['userToken'] : null;
/**
 * From this point , the control is taken by the Action specific controller
 * call the Action specific file, but check first if exists 
 */
$actionControllerPath = CONTROLLERS_PATH . '/' . $registry->requestModule . '/' . $registry->requestControllerProcessed . 'Controller.php';
if (file_exists($actionControllerPath)) {
    $dotAuth = Dot_Auth::getInstance();
    $dotAuth->checkIdentity('user');
    require $actionControllerPath;
} else {
    Dot_Route::pageNotFound();
}
// set menus
$tpl->setMenu();
// set SEO html tags from dots/seo.xml file
$tpl->setSeoValues($pageTitle);
// display message (error, warning, info)
$tpl->displayMessage();
// parse the main content block
$tpl->parse('MAIN_CONTENT', 'tpl_main');
// show debugbar
$debug = new Dot_Debug($tpl);
$debug->show();
// parse and print the output
$tpl->pparse('OUTPUT', 'tpl_index');
// assign Index Template file
$tpl->setViewFile();
// set paths in templates
$tpl->setViewPaths();
/** 
 * each Controller  must load its own specific models and views
 */
Dot_Settings::loadControllerFiles($registry->requestModule);
/**
 * Load option(specific configuration file for current dot file
 */
$option = Dot_Settings::getOptionVariables($registry->requestModule, $registry->requestControllerProcessed);
$registry->option = $option;
/**
 * Start the variable for Page Title, this will be used as H1 tag too 
 */
$pageTitle = 'Overwrite Me Please !';
/**
 * From this point , the control is taken by the Action specific controller
 * call the Action specific file, but check first if exists 
 */
$actionControllerPath = CONTROLLERS_PATH . '/' . $registry->requestModule . '/' . $registry->requestControllerProcessed . 'Controller.php';
!file_exists($actionControllerPath) ? Dot_Route::pageNotFound() : (require $actionControllerPath);
// set SEO html tags from dots/seo.xml file
$tpl->setSeoValues($pageTitle);
// dispaly message (error, warning, info)
$tpl->displayMessage();
// parse the main content block
$tpl->parse('MAIN_CONTENT', 'tpl_main');
// parse and print the output
$tpl->pparse('OUTPUT', 'tpl_index');
 * Any other (string) value - the token
 *
 * See Dot_Auth::checkUserToken()
 */
$userToken = isset($_POST['userToken']) ? $_POST['userToken'] : null;
/**
 * From this point , the control is taken by the Action specific controller
 * call the Action specific file, but check first if exists 
 */
$actionControllerPath = CONTROLLERS_PATH . '/' . $registry->requestModule . '/' . $registry->requestControllerProcessed . 'Controller.php';
if (file_exists($actionControllerPath)) {
    $dotAuth = Dot_Auth::getInstance();
    $dotAuth->checkIdentity('admin');
    require $actionControllerPath;
} else {
    Dot_Route::pageNotFound('admin');
}
// set menus
$tpl->setViewMenu();
// set info bar
$tpl->setInfoBar();
// set SEO html tags from dots/seo.xml file
$tpl->setSeoValues($pageTitle);
// dispaly message (error, warning, info)
$tpl->displayMessage();
// display widgets
$tpl->displayWidgets($option->widgets->content);
// parse the main content block
$tpl->parse('MAIN_CONTENT', 'tpl_main');
// show debugbar, only for logged in admins
if (isset($_SESSION['admin']['admin'])) {