diff index.php @ 62:b7efe2ecbc11

Wrapped everything in inputParser in a class.
author Tom Fredrik "BFG" Klaussen <bfg@blenning.no>
date Thu, 11 Oct 2012 18:21:59 +0200
parents 0e157721bbad
children 92c3e52c12d4
line wrap: on
line diff
--- a/index.php	Thu Oct 11 17:19:13 2012 +0200
+++ b/index.php	Thu Oct 11 18:21:59 2012 +0200
@@ -23,48 +23,9 @@
   var_dump($_SERVER);
 }
 
-$master = new DOMDocument();
 $masterName = basePath() . "/master.xml";
-$cache->cache_time($masterName);
-$master->load($masterName);
-
-$options = new Options($master);
-$options->setCache($cache);
-$options->setBasePath(basePath());
-
-$options->setUrlParams(array('name', 'lang'));
-
-if(array_key_exists('lang', $_GET) && $_GET['lang']) {
-  $options->setLang($_GET['lang']);
-}
-else {
-  $options->setLang($options->getDefaultLang());
-}
-
-if(array_key_exists('name', $_GET) && $_GET['name']) {
-  $options->setName($_GET['name']);
-}
 
-$params = $master->getElementsByTagName("param");
-
-foreach ($params as $param) {
-  if ($param->getAttribute("type") == "input") {
-    $doc = getInput($master, $param, $options);
+$input = new InputParser($masterName, $cache);
 
-    $parent = $param->parentNode;
-    foreach ($doc->firstChild->childNodes as $child) {
-      $clonedChild = $master->importNode($child, true);
-      $parent->insertBefore($clonedChild, $param);
-    }
-    $parent->removeChild($param);
-  }
-}
-$master = getFiles($master, $options);
-
-if (CACHING && $cacheable)
-  $options->getCache()->CheckHttpModified();
-
-print $master->saveXml($master);
-//print_r($cache->cacheSet(1));
-
+$input->genPage();
 ?>
\ No newline at end of file