From: rajbot Date: Wed, 20 Oct 2010 23:06:45 +0000 (+0000) Subject: deal with olauth case when browserlending is not the first collection X-Git-Url: http://git.rot13.org/?p=bookreader.git;a=commitdiff_plain;h=4ad8d461360fe29c2f1a8d29450df8b70dacb87e deal with olauth case when browserlending is not the first collection --- diff --git a/BookReaderIA/datanode/BookReaderJSIA.php b/BookReaderIA/datanode/BookReaderJSIA.php index 5fb5234..4d914e2 100644 --- a/BookReaderIA/datanode/BookReaderJSIA.php +++ b/BookReaderIA/datanode/BookReaderJSIA.php @@ -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