diff Flag.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 fae4322d6c29
children 9b490aa11124
line wrap: on
line diff
--- a/Flag.inc	Fri Oct 12 01:54:51 2012 +0200
+++ b/Flag.inc	Fri Oct 12 16:43:26 2012 +0200
@@ -10,11 +10,12 @@
 $scriptCache = ScriptIncludeCache::instance(__FILE__);
 $scriptCache->includeOnce('Language.inc');
 $scriptCache->includeOnce('common-functions.inc');
+$scriptCache->includeOnce('Page.inc');
 
-class Flag {
+class Flag extends Page
+{
   private $active;
   private $lang;
-  private $cache;
 
   function __construct($masterCache)
   {
@@ -39,14 +40,24 @@
       $this->name .= "-active";
     $this->name .= ".png";
 
-    $this->cache = new CacheTimeCheck($this->name);
-    $this->cache->addParent($masterCache);
-    $this->cache->cache_time($this->name);
+    $cache = new CacheTimeCheck($this->name);
+    $cache->addParent($masterCache);
+    $this->setCache($cache);
   }
 
-  function getPage()
+  function cacheCheck()
   {
-    $this->cache->CheckHttpModified();
+    $this->getCache()->cache_time($this->name);
+    return $true;
+  }
+
+  function mayCompress()
+  {
+    return false;
+  }
+
+  function generateContent()
+  {
 
     $flag = loadFile($this->name);