Example #1
0
 public function __toString()
 {
     $header = $this->header;
     $rows = $this->rows;
     if (sizeof($this->adminButtons)) {
         $header[] = '';
         foreach ($rows as &$row) {
             $buttons = '';
             foreach ($this->adminButtons as $ab) {
                 switch ($ab['type']) {
                     case 'a':
                         $buttons .= '<a href="' . str_replace($ab['key'], $row['id'], $ab['href']) . '">' . $ab['text'] . '</a>';
                         break;
                 }
             }
             $row[] = $buttons;
         }
     }
     $view = new View($this->viewSrc);
     $view->name = $this->name;
     $view->description = $this->description;
     $view->header = $header;
     $view->rows = $rows;
     $view->options = $this->getOptions();
     return $view->renderToString();
 }
Example #2
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;
 }
Example #3
0
 private function generateLeftMenu($menuitems)
 {
     $view = new View('display/layouts/index/mainmenu.php');
     $view->items = $menuitems;
     return $view->renderToString();
 }
Example #4
0
 /**
  * Renders fieldset into string
  * @return string
  */
 public function __toString()
 {
     $view = new View(strlen($this->getViewSrc()) ? $this->getViewSrc() : Fieldset::DEFAULT_VIEW);
     $view->fields = $this;
     return $view->__toString();
 }