41 lines
879 B
PHP
41 lines
879 B
PHP
|
<?php
|
||
|
|
||
|
namespace Sandpiper\Actions;
|
||
|
|
||
|
use \Yosymfony\Toml\Toml;
|
||
|
|
||
|
use \SBRL\Utilities\SimpleXmlWriter;
|
||
|
|
||
|
class index extends \Sandpiper\AbstractAction
|
||
|
{
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
public function handle() {
|
||
|
global $settings;
|
||
|
|
||
|
$writer = new SimpleXmlWriter();
|
||
|
$writer->add_xslt("/theme/project-list.xslt");
|
||
|
$writer->open("index");
|
||
|
$writer->addtag("data_dir", [], $settings->get("data_dir"));
|
||
|
$writer->open("places");
|
||
|
|
||
|
foreach($settings->get("places") as $next_place) {
|
||
|
$writer->open("place");
|
||
|
$writer->addtag("name", [], $next_place["name"]);
|
||
|
$writer->addtag("dirname", [], slugify($next_place["name"]));
|
||
|
$writer->close();
|
||
|
}
|
||
|
|
||
|
$writer->closeall();
|
||
|
|
||
|
header("content-type: application/xml");
|
||
|
header("content-length: " . strlen($writer->render()));
|
||
|
header("etag: " . sha1($writer->render()));
|
||
|
|
||
|
exit($writer->render());
|
||
|
}
|
||
|
}
|