Example #1
0
 public function deleted()
 {
     if ($this->apiVersion < 2) {
         $this->e404();
     }
     $this->allowMethods(array('GET'));
     if (!$this->permissions->canAccess($this->objectLibraryID)) {
         $this->e403();
     }
     $this->libraryVersion = Zotero_Libraries::getUpdatedVersion($this->objectLibraryID);
     // TEMP: sync transition
     if ($this->queryParams['sincetime'] !== null) {
         $deleted = array("collections" => Zotero_Collections::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['sincetime'], true), "items" => Zotero_Items::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['sincetime'], true), "searches" => Zotero_Searches::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['sincetime'], true), "tags" => Zotero_Tags::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['sincetime'], true), "settings" => Zotero_Settings::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['sincetime'], true));
         echo Zotero_Utilities::formatJSON($deleted);
         $this->end();
     }
     if ($this->queryParams['since'] === null) {
         $this->e400("'since' parameter must be provided");
     }
     $deleted = array("collections" => Zotero_Collections::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['since']), "items" => Zotero_Items::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['since']), "searches" => Zotero_Searches::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['since']), "tags" => Zotero_Tags::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['since']), "settings" => Zotero_Settings::getDeleteLogKeys($this->objectLibraryID, $this->queryParams['since']));
     echo Zotero_Utilities::formatJSON($deleted);
     $this->end();
 }