Exemple #1
0
 /**
  * Return the content of the RSS feed.
  * 
  * Also temporarily disabled source file comments, and restores
  * to previous state once content has been rendered.
  * 
  * @return string
  */
 function feedContent()
 {
     $prevState = SSViewer::get_source_file_comments();
     SSViewer::set_source_file_comments(false);
     $content = str_replace(' ', ' ', $this->renderWith($this->getTemplate()));
     SSViewer::set_source_file_comments($prevState);
     return $content;
 }
 /**
  *@return String (HTML Snippet)
  **/
 function EcommerceMenuTitle()
 {
     $count = 0;
     $order = ShoppingCart::current_order();
     if ($order) {
         $count = $order->TotalItems();
         $oldSSViewer = SSViewer::get_source_file_comments();
         SSViewer::set_source_file_comments(false);
         $this->customise(array("Count" => $count, "OriginalMenuTitle" => $this->MenuTitle));
         $s = $this->renderWith("AjaxNumItemsInCart");
         SSViewer::set_source_file_comments($oldSSViewer);
         return $s;
     }
     return $this->OriginalMenuTitle();
 }
Exemple #3
0
 /**
  * Output the feed to the browser
  */
 public function outputToBrowser()
 {
     $prevState = SSViewer::get_source_file_comments();
     SSViewer::set_source_file_comments(false);
     if (is_int($this->lastModified)) {
         HTTP::register_modification_timestamp($this->lastModified);
         header('Last-Modified: ' . gmdate("D, d M Y H:i:s", $this->lastModified) . ' GMT');
     }
     if (!empty($this->etag)) {
         HTTP::register_etag($this->etag);
     }
     if (!headers_sent()) {
         HTTP::add_cache_headers();
         header("Content-type: text/xml");
     }
     SSViewer::set_source_file_comments($prevState);
     return $this->renderWith($this->getTemplate());
 }