Mercurial > SimpleWebPresenter
comparison Sitemap.inc @ 124:6766250a0baa
Support for parameters as directory structure.
| author | Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no> |
|---|---|
| date | Fri, 29 Dec 2017 19:59:22 +0100 |
| parents | 74c22a8dd38f |
| children | 6b882fb6ea46 |
comparison
equal
deleted
inserted
replaced
| 123:8678ce12d533 | 124:6766250a0baa |
|---|---|
| 70 } | 70 } |
| 71 | 71 |
| 72 private function processDir($dir, $lang, $acceptedLanguages, $base) { | 72 private function processDir($dir, $lang, $acceptedLanguages, $base) { |
| 73 $urls = array(); | 73 $urls = array(); |
| 74 | 74 |
| 75 if ($handle = opendir(basePath() . "/${dir}")) { | 75 $base=basePath(); |
| 76 $base=$_SERVER['DOCUMENT_ROOT']; | |
| 77 $baseurl = $_SERVER["REQUEST_SCHEME"] ."://". $_SERVER["SERVER_NAME"]; | |
| 78 | |
| 79 | |
| 80 if ($handle = opendir($base . "/${dir}")) { | |
| 76 while (false !== ($entry = readdir($handle))) { | 81 while (false !== ($entry = readdir($handle))) { |
| 77 if (endsWith($entry, '.xml')) { | 82 if (endsWith($entry, '.xml')) { |
| 78 $fentry = basepath() . "/${dir}/${entry}"; | 83 $fentry = $base . "/${dir}/${entry}"; |
| 79 | |
| 80 $doc = new DOMDocument(); | 84 $doc = new DOMDocument(); |
| 81 | 85 |
| 82 if (file_exists($fentry)) { | 86 if (file_exists($fentry)) { |
| 83 $doc->load($fentry); | 87 $doc->load($fentry); |
| 84 | 88 |
| 95 if ($name != $this->options->getInputDefault('name')) { | 99 if ($name != $this->options->getInputDefault('name')) { |
| 96 $opts['name'] = $name; | 100 $opts['name'] = $name; |
| 97 } | 101 } |
| 98 | 102 |
| 99 $optstring = genUrl($opts, array(), array('lang', 'name')); | 103 $optstring = genUrl($opts, array(), array('lang', 'name')); |
| 100 | 104 $location = "${baseurl}${optstring}/"; |
| 101 $location = "${base}${optstring}/"; | |
| 102 | |
| 103 array_push($urls, $location); | 105 array_push($urls, $location); |
| 104 } | 106 } |
| 105 } | 107 } |
| 106 } | 108 } |
| 107 } | 109 } |
