/**
  * default page run.
  * all is controlled by thisone (well thisone is called from __toString)
  *
  * @access private
  * @return void
  */
 private function run()
 {
     /* onentry modules */
     $this->runModules('onEntry');
     $rq = new RequestHandler($this->defaultPage, $this->basepath);
     /* beforeContent modules */
     $this->runModules('beforeContent');
     $page = null;
     $classname = "Pages_" . ucfirst($rq->getPage());
     if (class_exists($classname) && Acl::acl()->isAllowed($rq->getPage())) {
         $page = new $classname($this->document, $this->toArray());
         if (!$page instanceof IPages) {
             throw new Exception('the page doesnt implement the page interface');
         }
         if ($rq->getParameters() != null) {
             $page->setParameters($rq->getParameters());
         }
         if ($rq->getAction() != null && method_exists($page, $rq->getAction())) {
             $action = $rq->getAction();
             $page->{$action}();
         } else {
             $page->index();
         }
     } else {
         $page = new Pages_404($this->document, $this->toArray());
         $page->index();
     }
     /* afterContent modules */
     $this->runModules('afterContent');
     /* onExit modules */
     $this->runModules('onExit');
 }