rules as for ``.txt`` files.
You can use this to show the current time within the directory listing.
+``nocache``
+ Disables menu caching.
File extensions get removed for display purposes.
(given that ``01_temp.auto.sh`` outputs the temperature string)
+Caching
+=======
+When going back in the menu strucutre with the left arrow button,
+Noxon iRadios display a cached version of the menu.
+
+If you do not want this - because a script modified values that are
+displayed in the parent menu, or because the script that displays
+the time should always be run - you may disable caching.
+
+Caching is disabled when a file named ``nocache`` is found in the directory.
+
+
=====
Setup
=====
$entries = glob(str_replace('//', '/', $varDir . rtrim($path, '/') . '/*'));
$count = 0;
+ $noCache = false;
foreach ($entries as $entry) {
$urlPath = pathEncode(substr($entry, strlen($varDir)));
$ext = pathinfo($entry, PATHINFO_EXTENSION);
//plain text file
++$count;
$listItems[] = getDirItem(basename($titleBase, '.' . $ext), $urlPath);
+ } else if (basename($entry) == 'nocache') {
+ $noCache = true;
}
}
if (!$count) {
$listItems[] = getMessageItem('No files or folders');
}
- sendListItems($listItems, buildPreviousItem($path), $enablePaging);
+ sendListItems(
+ $listItems, buildPreviousItem($path),
+ $enablePaging, $noCache
+ );
}
function sendScript($path)
sendListItems(array(getMessageItem($msg)));
}
-function sendListItems($listItems, $previous = null, $enablePaging = true)
-{
+function sendListItems(
+ $listItems, $previous = null, $enablePaging = true, $noCache = false
+) {
$startitems = 1;
$enditems = 100000;
if (isset($_GET['startitems'])) {
$xml = '<?xml version="1.0" encoding="iso-8859-1"?>' . "\n";
$xml .= '<?xml-stylesheet type="text/xsl" href="/html.xsl"?>' . "\n";
$xml .= '<ListOfItems>' . "\n";
+ if ($noCache) {
+ $xml .= "<NoCache>1</NoCache>\n";
+ }
$xml .= '<ItemCount>' . $itemCount . '</ItemCount>' . "\n";
$xml .= $previous;