Ejemplo n.º 1
0
 /**
  * Constructor
  * @return
  * @param object $Registry
  * @param object $Request
  */
 public function __construct(Registry $Registry, Request $Request = null)
 {
     parent::__construct($Registry);
     $this->Request = null !== $Request ? $Request : $Registry->Request;
     $this->action = $this->Request['a'];
     $this->initParams()->setTemplateDir()->setLocale()->loginByFacebookCookie()->loginByGfcCookie()->loginBySid()->initPageVars()->addJoinForm()->addLangForm();
     Cookie::sendFirstVisitCookie();
     d('cp');
     try {
         $this->checkLoginStatus()->checkAccessPermission()->main();
     } catch (Exception $e) {
         $this->handleException($e);
     }
     d('cp');
     /**
      * Observer will be able to
      * record access of current Viewer to
      * the current page for the purpose of
      * recording of who's online and at what url
      */
     $this->Registry->Dispatcher->post($this, 'onPageView', $this->aPageVars);
     //\Lampcms\Log::dump();
 }
Ejemplo n.º 2
0
 /**
  * Constructor
  *
  * @return \Lampcms\WebPage
  *
  * @param \Lampcms\Registry|object     $Registry
  * @param \Lampcms\Request|null|object $Request
  */
 public function __construct(Registry $Registry, Request $Request = null)
 {
     parent::__construct($Registry);
     $this->Request = null !== $Request ? $Request : $Registry->Request;
     $this->Router = $this->Registry->Router;
     $this->action = $this->Request['a'];
     $this->initParams()->setTemplateDir()->setLocale()->loginByFacebookCookie()->loginBySid()->setTimeZone()->initPageVars()->addJoinForm()->addLangForm()->addJsTranslations();
     Cookie::sendFirstVisitCookie();
     //d('cp');
     try {
         $this->checkLoginStatus()->checkAccessPermission()->main();
     } catch (Exception $e) {
         /**
          * Only Exceptions in the Lampcms Namespace
          * (the ones that extend Lampcms\Exception)
          * will be handled here, others bubble up to
          * index.php
          */
         $this->handleException($e);
     }
     //d('cp');
     /**
      * Observer will be able to
      * record access of current Viewer to
      * the current page for the purpose of
      * recording of who's online and at what url
      */
     $this->Registry->Dispatcher->post($this, 'onPageView', $this->aPageVars);
 }