summaryrefslogtreecommitdiffstats
path: root/modules-available/roomplanner/api.inc.php
diff options
context:
space:
mode:
authorSimon Rettberg2019-07-23 13:57:20 +0200
committerSimon Rettberg2019-07-23 13:57:20 +0200
commit04828b94e9df8321feae0bfb99daa468c0d3d383 (patch)
treee3b00490dc14a0f5d6ffda5bab1ce7c82bafee52 /modules-available/roomplanner/api.inc.php
parentslx-fixes.js: Make .cachedScript more compatible to .getScript (diff)
downloadslx-admin-04828b94e9df8321feae0bfb99daa468c0d3d383.tar.gz
slx-admin-04828b94e9df8321feae0bfb99daa468c0d3d383.tar.xz
slx-admin-04828b94e9df8321feae0bfb99daa468c0d3d383.zip
[roomplanner] Support creating recursive/composed rooms
Diffstat (limited to 'modules-available/roomplanner/api.inc.php')
-rw-r--r--modules-available/roomplanner/api.inc.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/modules-available/roomplanner/api.inc.php b/modules-available/roomplanner/api.inc.php
index f964bea1..8ddb945c 100644
--- a/modules-available/roomplanner/api.inc.php
+++ b/modules-available/roomplanner/api.inc.php
@@ -1,16 +1,29 @@
<?php
+// SVG
if (Request::any('show') === 'svg') {
$ret = PvsGenerator::generateSvg(Request::any('locationid', false, 'int'),
Request::any('machineuuid', false, 'string'),
Request::any('rotate', 0, 'int'),
Request::any('scale', 1, 'float'));
if ($ret === false) {
- Header('HTTP/1.1 404 Not Found');
- exit;
+ if (Request::any('fallback', 0, 'int') === 0) {
+ Header('HTTP/1.1 404 Not Found');
+ exit;
+ }
+ $ret = <<<EOF
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 64 64" height="64" width="64">
+ <g>
+ <path d="M 0,0 64,64 Z" style="stroke:#ff0000;stroke-width:5" />
+ <path d="M 0,64 64,0 Z" style="stroke:#ff0000;stroke-width:5" />
+ </g>
+</svg>
+EOF;
}
Header('Content-Type: image/svg+xml');
die($ret);
}
+// PVS.ini
die(PvsGenerator::generate());