Esempio n. 1
0
 public function display($viewfile = "")
 {
     $this->endtime = microtime(true);
     $time = round(($this->endtime - $this->begintime) * 1000.0);
     $this->_view->assign("pagetime", $time);
     if ($time > 300) {
         $logModel = new LogModel();
         $logModel->slowRequest($time);
     }
     if (!empty($viewfile)) {
         $this->_mainContent->assign("retUrl", $_SERVER['REQUEST_URI']);
         $this->_view->assign("retUrl", $_SERVER['REQUEST_URI']);
         $mainContent = $this->_mainContent->fetch($viewfile);
         $this->_view->assign('mainContent', $mainContent);
     } else {
         if ($this->viewFile != "") {
             $this->_mainContent->assign("retUrl", $_SERVER['REQUEST_URI']);
             $this->_view->assign("retUrl", $_SERVER['REQUEST_URI']);
             $mainContent = $this->_mainContent->fetch($this->viewFile);
             $this->_view->assign('mainContent', $mainContent);
         }
     }
     if (isset($_SESSION['id'])) {
         $notify = new NotificationModel();
         $notifyCount = $notify->unreadCount($_SESSION['id']);
         $this->_view->assign("notifyCount", $notifyCount);
     }
     parent::display();
 }