Exemple #1
0
 /**
  * Returns an htmlpage displaying all displayable attributes.
  *
  * @param array $record The record to display.
  * @param Node $node The node for which a viewPage is displayed.
  * @param bool $renderbox Render this action in a renderbox or just output the HTML
  *
  * @return string The html page with a reaonly view of relevant fields.
  */
 public function viewPage($record, $node, $renderbox = true)
 {
     $ui = $this->getUi();
     if (is_object($ui)) {
         $params = $node->getDefaultActionParams();
         $tab = $node->getActiveTab();
         $innerform = $this->viewForm($record, 'view');
         $params['activeTab'] = $tab;
         $params['header'] = $this->invoke('viewHeader', $record);
         $params['title'] = $node->actionTitle($this->m_action, $record);
         $params['content'] = $node->tabulate('view', $innerform);
         $params['formstart'] = $this->getFormStart($record);
         $params['buttons'] = $this->getFormButtons($record);
         $params['formend'] = '</form>';
         $output = $ui->renderAction('view', $params);
         if (!$renderbox) {
             return $output;
         }
         $this->getPage()->setTitle(Tools::atktext('app_shorttitle') . ' - ' . $node->actionTitle($this->m_action, $record));
         $vars = array('title' => $node->actionTitle($this->m_action, $record), 'content' => $output);
         $total = $ui->renderBox($vars, $this->m_boxTemplate);
         return $total;
     } else {
         Tools::atkerror('ui object error');
     }
 }