Example #1
0
 public final function __toString()
 {
     $Class = get_called_class();
     $view = new View($this->getSRC());
     $view->setAutoEscape(false);
     $view->setAutoStripTags(false);
     if ($Class::useNotifications && $this->notificationContainer instanceof NotificationContainer) {
         $list = $this->notificationContainer->getNotifications();
         if (sizeof($list)) {
             $partialView = new View('display/system/notifications.php', null);
             $partialView->list = $list;
             $partialViewStr = $partialView->renderToString();
             $this->notificationContainer->flushNotifications();
         } else {
             $partialViewStr = '';
         }
         $view->notifications = $partialViewStr;
     }
     $partials = $this->getPartials();
     if (sizeof($partials)) {
         foreach ($partials as $k => $v) {
             $view->{$k} = $v;
         }
     }
     $scripts = '';
     foreach ($this->metaScripts as $script) {
         $scripts .= "<script type=\"{$script['type']}\" src=\"{$script['src']}\"></script>\n";
     }
     $view->metaScripts = $scripts;
     $styles = '';
     foreach ($this->metaStylesheets as $style) {
         $styles .= "<link type=\"{$style['type']}\"  href=\"{$style['href']}\" rel=\"{$style['rel']}\">\n";
     }
     $view->metaStylesheets = $styles;
     if ($Class::useConsole) {
         if ((true || Application::getParameter('debugMode')) && Authorization::getCurrentUser()->getId()) {
             $console = new View('display/system/console.php', null);
             $console->messages = Application::getInstance()->getConsole()->getMessageList();
             $view->terminal = $console->renderToString();
         }
     }
     $content = $view->renderToString();
     return $content;
 }