deal with olauth case when browserlending is not the first collection
authorrajbot <raj@archive.org>
Wed, 20 Oct 2010 23:06:45 +0000 (23:06 +0000)
committerrajbot <raj@archive.org>
Wed, 20 Oct 2010 23:06:45 +0000 (23:06 +0000)
BookReaderIA/datanode/BookReaderJSIA.php

index 5fb5234..4d914e2 100644 (file)
@@ -438,10 +438,17 @@ if ('' != $metaData->{'page-progression'}) {
   echo "br.pageProgression = 'lr';\n";
 }
 
-if ('browserlending' == $metaData->{'collection'}) {
+$useOLAuth = false;
+foreach ($metaData->xpath('//collection') as $collection) {
+    if('browserlending' == $collection) {
+        $useOLAuth = true;
+    }
+}
+
+if ($useOLAuth) {
     echo "br.olAuth = true;\n";
 } else {
-    echo "br.olAuth = false; //" . $metaData->{'collection'} ."\n";
+    echo "br.olAuth = false;\n";
 }
 
 # Special cases