# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1457379855 -3600 # Node ID d5f3efba33e2e9e57f1485a3d855bbb2e480c1c4 # Parent d0698ec07b0b2194a2fdaf972ed691ff32112019 Support for common files between languages. diff -r d0698ec07b0b -r d5f3efba33e2 InputParser.inc --- a/InputParser.inc Mon Mar 07 17:12:32 2016 +0100 +++ b/InputParser.inc Mon Mar 07 20:44:15 2016 +0100 @@ -223,6 +223,9 @@ else { $src = $file->getAttribute("src"); $fname = $options->getBasePath() . "/${lang}/${src}"; + if (!file_exists($fname) ) { + $fname = $options->getBasePath() . "/common/${src}"; + } $file_content = $options->getCache()->loadFile($fname); } if(floatval($file_content)<0) { @@ -289,6 +292,10 @@ $conf = $param->getAttribute("default"); $confFile = $options->getBasePath() . "/${lang}/${conf}.xml"; + if (! file_exists($confFile) ) { + $confFile = $options->getBasePath() . "/common/${conf}.xml"; + } + $options->getCache()->cache_time($confFile); $doc = new DOMDocument(); $doc->load($confFile); @@ -310,6 +317,9 @@ $src = $include->getAttribute("src"); $subdoc = new DOMDocument(); $subfile = $options->getBasePath() . "/${lang}/${src}"; + if (! file_exists($subfile) ) { + $subfile = $options->getBasePath() . "/common/${src}"; + } $subdoc->load("$subfile"); $options->getCache()->cache_time($subfile); $parent = $include->parentNode;