} else if (brConfig['mode'] == 2) {
br.mode = 2;
}
+
+ if (typeof(brConfig["isAdmin"]) != 'undefined') {
+ br.isAdmin = brConfig["isAdmin"];
+ } else {
+ br.isAdmin = false;
+ }
} // brConfig
this.popup.innerHTML = ['<p><strong>', msg, '</strong></p><p>', resolution, '</p>'].join('\n');
}
-OLAuth.prototype.isAdmin = function() {
- var isAdmin = false;
-
- $.ajax({url:'/bookreader/BookReaderAdmin.php?id='+br.bookId,
- success:function(data){isAdmin=data.isAdmin;},
- async:false
- });
- return isAdmin;
-}
-
OLAuth.prototype.showError = function(msg, resolution) {
$(this.popup).css({
backgroundColor: "#fff",
OLAuth.prototype.initCallback = function(obj) {
if (false == obj.success) {
- if (this.isAdmin()) {
+ if (br.isAdmin) {
ret = confirm("We couldn't authenticate your loan with Open Library, but since you are an administrator or uploader of this book, you can access this book for QA purposes. Would you like to QA this book?");
if (!ret) {
this.showError(obj.msg, obj.resolution)
//
// @param subprefix Optional prefix to display a book inside an item (e.g. if does not match identifier)
public static function draw($server, $mainDir, $identifier, $subPrefix, $title,
- $coverLeaf=null, $titleStart='Internet Archive', $uiMode='full', $protected = false)
+ $coverLeaf=null, $titleStart='Internet Archive', $uiMode='full', $protected = false, $isAdmin=false)
{
// Set title to default if not set
if (!$title) {
<? } else { ?>
brConfig["mode"] = 2;
<? } ?>
+<? if ($isAdmin == true) {
+ echo ' brConfig["isAdmin"] = true;';
+ } ?>
</script>
<script type="text/javascript">
// The URL in the script tag below is dynamically generated JavaScript that includes the book metadata and page image access functions.