diff Options.inc @ 29:394b5df43d1a

Fix some formatting. Add more elements to options. Fix bugs which occured if options where forcibly set.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Sun, 30 Sep 2012 03:38:29 +0200
parents d8c7b328899e
children 7b19be62ea94
line wrap: on
line diff
--- a/Options.inc	Sun Sep 30 03:36:02 2012 +0200
+++ b/Options.inc	Sun Sep 30 03:38:29 2012 +0200
@@ -5,6 +5,7 @@
   private $lang;
   private $name;
   private $acceptedLanguages = array();
+  private $inputDefaults = array();
 
   function getDefaultLang()
   {
@@ -31,6 +32,16 @@
     return $this->name;
   }
 
+  function getAcceptedLanguages()
+  {
+    return $this->acceptedLanguages;
+  }
+
+  function getInputDefault($key)
+  {
+    return $this->inputDefaults[$key];
+  }
+
   function __construct($baseDocument)
   {
     $params = $baseDocument->getElementsByTagName("param");
@@ -52,6 +63,11 @@
 	$parent = $param->parentNode;
 	$parent->removeChild($param);
       }
+      elseif ($param->getAttribute("type") == "input") {
+	$id = $param->getAttribute("id");
+	$default = $param->getAttribute("default");
+	$this->inputDefaults[$id] = $default;
+      }
     }
   }
 }