X-Git-Url: https://git.cweiske.de/noxon-gateway.git/blobdiff_plain/931d5803649e32b043d7af9034dde326ddb1fefa..35e6419688e993a868b6cf7849cd9ff8ec41e75c:/www/index.php
diff --git a/www/index.php b/www/index.php
index cc0be0e..4db5f2e 100644
--- a/www/index.php
+++ b/www/index.php
@@ -1,8 +1,23 @@
'
+ . 'Display'
+ . '' . utf8_decode(htmlspecialchars(trim($line))) . ''
+ . '';
+}
+
+function getDirItem($title, $urlPath)
+{
+ global $host1, $host2;
+ return '- '
+ . 'Dir'
+ . '' . utf8_decode(htmlspecialchars($title)) . ''
+ . '' . $host1 . utf8_decode(htmlspecialchars($urlPath)) . ''
+ . '' . $host2 . utf8_decode(htmlspecialchars($urlPath)) . ''
+ . '
';
+}
+
+function getEpisodeItem($title, $fullUrl, $desc, $type)
+{
+ return '- '
+ . 'ShowEpisode'
+ . '' . utf8_decode(htmlspecialchars($title)) . ''
+ . '' . $fullUrl . ''
+ . '' . utf8_decode(htmlspecialchars($desc)) . ''
+ . '' . $type . ''
+ . '
';
+}
+
+function getPodcastItem($title, $urlPath)
+{
+ global $host1;
+ return '- '
+ . 'ShowOnDemand'
+ . '' . utf8_decode(htmlspecialchars($title)) . ''
+ . '' . $host1 . utf8_decode(htmlspecialchars($urlPath)) . ''
+ . '
';
+}
+
+function getMessageItem($msg)
+{
+ return '- '
+ . 'Message'
+ . '' . utf8_decode(htmlspecialchars($msg)) . ''
+ . '
';
+}
+
+function getPreviousItem($urlPath)
+{
+ global $host1, $host2;
+ return '- '
+ . 'Previous'
+ . '' . $host1 . utf8_decode(htmlspecialchars($urlPath)) . ''
+ . '' . $host1 . utf8_decode(htmlspecialchars($urlPath)) . ''
+ . '
';
+}
+
+function addPreviousItem(&$listItems, $urlPath)
+{
+ $parentDir = dirname($urlPath) . '/';
+ if ($parentDir == '/') {
+ return;
+ }
+ $listItems[] = getPreviousItem($parentDir);
+}
function getFinalUrl($url)
{
@@ -65,8 +214,12 @@ function getFinalUrl($url)
return $url;
}
+function sendMessage($msg)
+{
+ sendListItems(array(getMessageItem($msg)));
+}
-function sendList($path)
+function sendListItems($listItems)
{
$startitems = 1;
$enditems = 10;
@@ -76,54 +229,17 @@ function sendList($path)
if (isset($_GET['enditems'])) {
$enditems = (int) $_GET['enditems'];
}
+ //TODO: limit list
- header('Content-type: text/xml');
- echo <<
-
- -1
- -
- Message
- $path
-
- -
- Dir
- $path
- http://radio567.vtuner.com/$path
- http://radio5672.vtuner.com/$path
-
-
-
-XML;
-}
-
-function sendMessage($msg)
-{
- header('Content-type: text/xml');
- $xMsg = htmlspecialchars($msg);
- echo <<
-
- -
- Message
- $xMsg
-
-
-
-XML;
-}
-
-function sendListItems($listItems)
-{
$xml = '' . "\n";
+ $xml .= '' . "\n";
$xml .= '' . "\n";
foreach ($listItems as $item) {
$xml .= $item . "\n";
}
$xml .= "\n";
-
+
header('Content-type: text/xml');
echo $xml;
}
-
?>