whereAmI()==='admin') { $layout = array( 'controller'=>null, 'view'=>null, 'template'=>'index.php' ); $layout['controller'] = $layout['view'] = $Url->slug(); if($Url->notFound() || !$Login->isLogged() || ($Url->slug()==='login') ) { $layout['controller'] = 'login'; $layout['view'] = 'login'; $layout['template'] = 'login.php'; } // Admin theme init.php if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().'/init.php') ) include(PATH_ADMIN_THEMES.$Site->adminTheme().'/init.php'); // Load controller if( Sanitize::pathFile(PATH_ADMIN_CONTROLLERS, $layout['controller'].'.php') ) include(PATH_ADMIN_CONTROLLERS.$layout['controller'].'.php'); // Load view and theme if( Sanitize::pathFile(PATH_ADMIN_THEMES, $Site->adminTheme().'/'.$layout['template']) ) include(PATH_ADMIN_THEMES.$Site->adminTheme().'/'.$layout['template']); } // Site else { if($Url->notFound()) { $Url->setWhereAmI('page'); $Page = new Page('error'); } // Theme init.php if( Sanitize::pathFile(PATH_THEMES, $Site->theme().'/init.php') ) include(PATH_THEMES.$Site->theme().'/init.php'); // Theme HTML if( Sanitize::pathFile(PATH_THEMES, $Site->theme().'/index.php') ) include(PATH_THEMES.$Site->theme().'/index.php'); } // DEBUG: echo "Load time: ".(microtime(true) - $loadTime);