Exemplo n.º 1
0
 public function output()
 {
     if ($this->_outputOnlyHeaders) {
         $this->sendHttpHeaders();
         return true;
     }
     foreach ($this->plugins as $name => $plugin) {
         $plugin->afterAction();
     }
     $this->doAfterActions();
     $this->setContentType();
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
         $content = $this->body->fetch($this->bodyTpl, 'html', true, false);
     } else {
         $content = '';
     }
     jLog::outputLog($this);
     foreach ($this->plugins as $name => $plugin) {
         $plugin->beforeOutput();
     }
     $this->sendHttpHeaders();
     $this->outputDoctype();
     $this->outputHtmlHeader();
     echo '<body ';
     foreach ($this->bodyTagAttributes as $attr => $value) {
         echo $attr, '="', htmlspecialchars($value), '" ';
     }
     echo ">\n";
     echo implode("\n", $this->_bodyTop);
     echo $content;
     echo implode("\n", $this->_bodyBottom);
     foreach ($this->plugins as $name => $plugin) {
         $plugin->atBottom();
     }
     echo '</body></html>';
     return true;
 }
Exemplo n.º 2
0
 public function output()
 {
     if ($this->_outputOnlyHeaders) {
         $this->sendHttpHeaders();
         return true;
     }
     $this->doAfterActions();
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
         $content = $this->body->fetch($this->bodyTpl, 'xul', true, false);
     } else {
         $content = '';
     }
     jLog::outputLog($this);
     $this->_httpHeaders['Content-Type'] = 'application/vnd.mozilla.xul+xml;charset=' . jApp::config()->charset;
     $this->sendHttpHeaders();
     $this->outputHeader();
     echo implode('', $this->_bodyTop);
     echo $content;
     echo implode('', $this->_bodyBottom);
     echo '</', $this->_root, '>';
     return true;
 }
Exemplo n.º 3
0
 /**
  * output errors
  */
 public function outputErrors()
 {
     if (file_exists(jApp::appPath('app/responses/error.en_US.php'))) {
         $file = jApp::appPath('app/responses/error.en_US.php');
     } else {
         $file = JELIX_LIB_CORE_PATH . 'response/error.en_US.php';
     }
     // we erase already generated content
     $this->_headTop = array();
     $this->_headBottom = array();
     $this->_bodyBottom = array();
     $this->_bodyTop = array();
     jLog::outputLog($this);
     foreach ($this->plugins as $name => $plugin) {
         $plugin->beforeOutputError();
     }
     $HEADTOP = implode("\n", $this->_headTop);
     $HEADBOTTOM = implode("\n", $this->_headBottom);
     $BODYTOP = implode("\n", $this->_bodyTop);
     $BODYBOTTOM = implode("\n", $this->_bodyBottom);
     $BASEPATH = jApp::urlBasePath();
     header("HTTP/{$this->httpVersion} 500 Internal jelix error");
     header('Content-Type: text/html;charset=' . $this->_charset);
     include $file;
 }
Exemplo n.º 4
0
 /**
  * output the html content
  *
  * @return boolean    true if the generated content is ok
  */
 public function output()
 {
     foreach ($this->plugins as $name => $plugin) {
         $plugin->afterAction();
     }
     $this->doAfterActions();
     $this->setContentType();
     // let's get the main content for the body
     // we don't output yet <head> and other things, to have the
     // opportunity for any components called during the output,
     // to add things in the <head>
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
         $content = $this->body->fetch($this->bodyTpl, 'html');
     } else {
         $content = '';
     }
     // retrieve errors messages and log messages
     jLog::outputLog($this);
     foreach ($this->plugins as $name => $plugin) {
         $plugin->beforeOutput();
     }
     // now let's output the html content
     $this->sendHttpHeaders();
     $this->outputDoctype();
     $this->outputHtmlHeader();
     echo '<body ';
     foreach ($this->bodyTagAttributes as $attr => $value) {
         echo $attr, '="', htmlspecialchars($value), '" ';
     }
     echo ">\n";
     echo implode("\n", $this->_bodyTop);
     echo $content;
     echo implode("\n", $this->_bodyBottom);
     foreach ($this->plugins as $name => $plugin) {
         $plugin->atBottom();
     }
     echo '</body></html>';
     return true;
 }
Exemplo n.º 5
0
 /**
  * generate the xul content.
  * @return boolean    true if it's ok
  */
 public function output()
 {
     $this->doAfterActions();
     if ($this->bodyTpl != '') {
         $this->body->meta($this->bodyTpl);
         $content = $this->body->fetch($this->bodyTpl);
     } else {
         $content = '';
     }
     // retrieve errors messages and log messages
     jLog::outputLog($this);
     $this->_httpHeaders['Content-Type'] = 'application/vnd.mozilla.xul+xml;charset=' . $GLOBALS['gJConfig']->charset;
     $this->sendHttpHeaders();
     $this->outputHeader();
     echo implode('', $this->_bodyTop);
     echo $content;
     echo implode('', $this->_bodyBottom);
     echo '</', $this->_root, '>';
     return true;
 }