diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js index d8cce607a..bf0a5d673 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/data_access.js +++ b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -1371,6 +1371,8 @@ Scholar.Collection.prototype._getDescendents = function(){ } + + /* * Primary interface for accessing Scholar collection */ @@ -1497,6 +1499,8 @@ Scholar.Collections = new function(){ } + + Scholar.Creators = new function(){ var _creators = new Array; // indexed by first%%%last hash var _creatorsByID = new Array; // indexed by creatorID @@ -1623,6 +1627,45 @@ Scholar.Creators = new function(){ +Scholar.CreatorTypes = new function(){ + var _creatorTypes = new Array(); + var _creatorTypesLoaded; + var self = this; + + this.getTypes = getTypes; + this.getTypeName = getTypeName; + + function getTypes(){ + return Scholar.DB.query('SELECT creatorTypeID AS id, ' + + 'creatorType AS name FROM creatorTypes order BY creatorType'); + } + + function getTypeName(creatorTypeID){ + if (!_creatorTypesLoaded){ + _load(); + } + + if (!_creatorTypes[creatorTypeID]){ + Scholar.debug('Invalid creator type ' + creatorTypeID, 1); + } + + return _creatorTypes[creatorTypeID]; + } + + function _load(){ + var types = self.getTypes(); + + for (i in types){ + _creatorTypes[types[i]['id']] = types[i]['name']; + } + + _creatorTypesLoaded = true; + } +} + + + + Scholar.ItemTypes = new function(){ var _itemTypes = new Array(); var _itemTypesLoaded; @@ -1815,45 +1858,6 @@ Scholar.ItemFields = new function(){ -Scholar.CreatorTypes = new function(){ - var _creatorTypes = new Array(); - var _creatorTypesLoaded; - var self = this; - - this.getTypes = getTypes; - this.getTypeName = getTypeName; - - function getTypes(){ - return Scholar.DB.query('SELECT creatorTypeID AS id, ' - + 'creatorType AS name FROM creatorTypes order BY creatorType'); - } - - function getTypeName(creatorTypeID){ - if (!_creatorTypesLoaded){ - _load(); - } - - if (!_creatorTypes[creatorTypeID]){ - Scholar.debug('Invalid creator type ' + creatorTypeID, 1); - } - - return _creatorTypes[creatorTypeID]; - } - - function _load(){ - var types = self.getTypes(); - - for (i in types){ - _creatorTypes[types[i]['id']] = types[i]['name']; - } - - _creatorTypesLoaded = true; - } -} - - - - /*