public function execute()
 {
     Hooks::run("PreSetupPage");
     // set up the page
     $this->setupPage();
     try {
         if (!Hooks::run("PreRunPage", array(false, $this))) {
             // "run" the page - allow the user to make any customisations to the
             // current state
             $this->runPage();
             Hooks::run("PostRunPage", array("", $this->mSmarty));
         }
     } catch (AccessDeniedException $ex) {
         $this->handleAccessDeniedException($ex);
     }
     // perform any final setup for the page, overwriting any user
     // customisations which aren't allowed, and anything that potentially
     // needs to be rebuilt/updated.
     $this->finalSetup();
     Hooks::run("PostFinalSetup");
     try {
         // get the page content
         $content = $this->mSmarty->fetch($this->mBasePage);
     } catch (SmartyException $ex) {
         if (strpos($ex->getMessage(), "Unable to load template file") !== false) {
             // throw our own exception so the stack trace comes back here.
             throw new SmartyTemplateNotFoundException($ex->getMessage(), $ex->getCode());
         }
     }
     // set any HTTP headers
     foreach ($this->mHeaders as $h) {
         header($h);
     }
     // send the cookies to make the client smile and go mmmmm nom nom
     WebRequest::sendCookies();
     // send the output
     WebRequest::output($content);
 }