Exemplo n.º 1
0
 /**
  * Resolves page from a source string
  * @return SwatPage A subclass of SwatPage is returned.
  */
 protected function resolvePage($source)
 {
     $path = $this->explodeSource($source);
     if (count($path) == 0) {
         // TODO: relocate since there is no separate front page right now
         $this->relocate('tag');
     } else {
         $tag = $path[0];
     }
     switch ($tag) {
         case 'httperror':
             require_once 'Site/pages/SiteHttpErrorPage.php';
             $layout = new PinholeLayout($this, 'Pinhole/layouts/xhtml/default.php');
             $page = new SiteHttpErrorPage($this, $layout);
             break;
         case 'exception':
             require_once 'Pinhole/pages/PinholeExceptionPage.php';
             $layout = new PinholeLayout($this, 'Pinhole/layouts/xhtml/default.php');
             $page = new PinholeExceptionPage($this, $layout);
             break;
         default:
             require_once '../include/PageFactory.php';
             $factory = PageFactory::instance();
             $page = $factory->resolvePage($this, $source);
             break;
     }
     $page->setSource($source);
     return $page;
 }