Commit 90c3d0461119a3a3bf3d16b207d0c756f90de516

Authored by Tiago Guimarães
1 parent 95fc90c15f
Exists in DSpace52++

only opens in newtab if it is a DOI

dspace-jspui/src/main/java/org/dspace/app/webui/jsptag/ItemTag.java
... ... @@ -543,7 +543,8 @@ public class ItemTag extends TagSupport
543 543  
544 544 if (isLink)
545 545 {
546   - out.print("<a target=\"_blank\" href=\"" + values[j].value + "\">"
  546 + out.print("<a " + (qualifier.equals("doi")?"target=\"_blank\"":"")
  547 + + "href=\"" + values[j].value + "\">"
547 548 + Utils.addEntities(values[j].value) + "</a>");
548 549 }
549 550 else if (isDate)
... ... @@ -562,7 +563,8 @@ public class ItemTag extends TagSupport
562 563 || value.startsWith("ftps://"))
563 564 {
564 565 // Already a URL, print as if it was a regular link
565   - out.print("<a target=\"_blank\" href=\"" + value + "\">"
  566 + out.print("<a" + (qualifier.equals("doi")?"target=\"_blank\"":"")
  567 + + "href=\"" + value + "\">"
566 568 + Utils.addEntities(value) + "</a>");
567 569 }
568 570 else
... ... @@ -592,7 +594,8 @@ public class ItemTag extends TagSupport
592 594 }
593 595  
594 596 String url = urn2baseurl.get(foundUrn);
595   - out.print("<a target=\"_blank\" href=\"" + url
  597 + out.print("<a" + (qualifier.equals("doi")?"target=\"_blank\"":"")
  598 + + "href=\"" + url
596 599 + value + "\">"
597 600 + Utils.addEntities(values[j].value)
598 601 + "</a>");
... ...