Allow &subPrefix= in JSLocate, to match param name in Images
authorMichael Ang <mang@archive.org>
Mon, 25 Oct 2010 19:28:42 +0000 (19:28 +0000)
committerMichael Ang <mang@archive.org>
Mon, 25 Oct 2010 19:28:42 +0000 (19:28 +0000)
BookReaderIA/www/BookReaderJSLocate.php

index c71ffeb..f60d221 100644 (file)
@@ -22,6 +22,7 @@ require_once '/petabox/setup.inc';
 
 $id = $_REQUEST['id'];
 $book = $_REQUEST['book']; // support multiple books within an item
+$subPrefix = $_REQUEST['subPrefix']; // same as above but with same naming as BookReaderImages
 
 if ("" == $id) {
     echo "No identifier specified!";
@@ -36,7 +37,9 @@ $server = $results[0][0];
 $serverBaseURL = BookReader::serverBaseURL($server);
 
 $url = "http://{$serverBaseURL}/BookReader/BookReaderJSIA.php?id=" . urlencode($id) . "&itemPath={$results[0][1]}&server={$server}";
-if ($book) {
+if ($subPrefix) {
+    $url .= "&subPrefix=" . urlencode($subPrefix);
+} else if ($book) {
     $url .= "&subPrefix=" . urlencode($book);
 }