A hotly disputed court decision could pave the way for John Travolta’s former gay lover to publish a long-awaited sensational memoir about their affair.

Back in Sept. 2012, Doug Gotterba revealed to The National ENQUIRER he was writing a sizzling tell-all about his relationship with the actor, titled “Travolta Exposed,” which touched off a nearly two-year court battle – headed by pit-bull attorney Marty “The Litigator” Singer – to silence the author.

Hoping to bury the project, the lawyer sent out cease-and-desist letters to Doug.

But on July 15, a California appeals court dismissed a motion by Travolta’s legal team to stop Doug from proceeding with his case – a ruling that could lead to the release of the tell-all book.

“I feel vindicated by the court’s decision,” Doug said.

Travolta’s legal eagles claimed the would-be memoir writer once signed a confidentiality agreement with the actor.

But Doug insists that when he was canned by Travolta in March 1987, he was given a termination letter that didn’t include a confidentiality agreement.

For their part, Travolta’s team has argued that Doug did sign a confidentiality agreement about a month after he was dismissed.

Now the recent court decision paves the way for the court to rule on the dispute over the terms of Doug’s

The lower court and the appellate court wrestled with the legal effect of Singer’s demand letters on the case.

But, ultimately, the California appellate court ruled that its decision to permit Doug’s case to go forward was not based upon Singer’s “sabre-rattling,” but on the legal effect and validity of the alleged termination agreements.

The case will continue in a Santa Barbara court in early September, but Singer adamantly declared, “Ultimately, (Doug) will not prevail on his claim