Mercurial > SimpleWebPresenter
diff inputParser.inc @ 26:d8c7b328899e
Removed globals, and introduced Options object for passing values
around.
Introduced <accepted_values> tag into master.xml
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Sun, 30 Sep 2012 00:16:58 +0200 |
| parents | 814296ea84a9 |
| children | 394b5df43d1a |
line wrap: on
line diff
--- a/inputParser.inc Wed Sep 19 21:50:20 2012 +0200 +++ b/inputParser.inc Sun Sep 30 00:16:58 2012 +0200 @@ -29,16 +29,15 @@ return $param_value; } -function getInput($master, $param) +function getInput($master, $param, $options) { $out=''; - $lang=$GLOBALS['lang']; + $lang = $options->getLang(); $name=$param->getAttribute("id"); - $conf=$_GET[$name]; - $GLOBALS[$name]=$conf; + $conf = $options->getName(); if (!$conf) - $conf=$param->getAttribute("default"); + $conf = $param->getAttribute("default"); $fname = "${lang}/${conf}.xml"; cache_time($fname); @@ -65,9 +64,9 @@ $parent=$include->parentNode; $xml=getElementByTagName($subdoc,"xml"); foreach($xml->childNodes as $child) { - $text=$subdoc->saveXml($child); - $clonedChild=$doc->importNode($child,true); - $parent->insertBefore($clonedChild,$include); + $text=$subdoc->saveXml($child); + $clonedChild=$doc->importNode($child,true); + $parent->insertBefore($clonedChild,$include); } $parent->removeChild($include); }
