Mercurial > SimpleWebPresenter
comparison Sitemap.inc @ 78:7c68015b211a
Common source for all page generators.
Support for compressed output.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Fri, 12 Oct 2012 16:43:26 +0200 |
| parents | 1d5166aba2c5 |
| children | b9654b9c4a66 |
comparison
equal
deleted
inserted
replaced
| 76:fae4322d6c29 | 78:7c68015b211a |
|---|---|
| 3 | 3 |
| 4 /// @cond | 4 /// @cond |
| 5 $baseDir = dirname(__FILE__); | 5 $baseDir = dirname(__FILE__); |
| 6 $cache = ScriptIncludeCache::instance(__FILE__); | 6 $cache = ScriptIncludeCache::instance(__FILE__); |
| 7 $cache->includeOnce('common-functions.inc', $baseDir); | 7 $cache->includeOnce('common-functions.inc', $baseDir); |
| 8 $cache->includeOnce('Options.inc', dirname(__FILE__)); | 8 $cache->includeOnce('Page.inc', dirname(__FILE__)); |
| 9 /// @endcond | 9 /// @endcond |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * Functionality for generating a sitemap | 12 * Functionality for generating a sitemap |
| 13 */ | 13 */ |
| 14 class Sitemap | 14 class Sitemap extends Page |
| 15 { | 15 { |
| 16 private $master; | 16 private $master; |
| 17 private $options; | 17 private $options; |
| 18 | 18 |
| 19 /** | 19 /** |
| 26 $this->master->load($path); | 26 $this->master->load($path); |
| 27 | 27 |
| 28 $this->options = new Options($this->master); | 28 $this->options = new Options($this->master); |
| 29 } | 29 } |
| 30 | 30 |
| 31 function genPage() { | 31 function cacheCheck() |
| 32 { | |
| 33 return false; | |
| 34 } | |
| 35 | |
| 36 function generateContent() { | |
| 32 /// The final output variable | 37 /// The final output variable |
| 33 $out = '<?xml version="1.0" encoding="UTF-8"?>'; | 38 $out = '<?xml version="1.0" encoding="UTF-8"?>'; |
| 34 $out .= "\n"; | 39 $out .= "\n"; |
| 35 $out .= '<urlset | 40 $out .= '<urlset |
| 36 xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | 41 xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" |
| 97 } | 102 } |
| 98 | 103 |
| 99 $out .= '</urlset>'; | 104 $out .= '</urlset>'; |
| 100 | 105 |
| 101 header('Content-type: application/xml'); | 106 header('Content-type: application/xml'); |
| 102 print $out; | 107 return $out; |
| 103 } | 108 } |
| 104 } | 109 } |
| 105 ?> | 110 ?> |
