Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diviner/renderer/DivinerDefaultRenderer.php
| Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | final class DivinerDefaultRenderer extends DivinerRenderer { | ||||
| } | } | ||||
| public function normalizeAtomRef(DivinerAtomRef $ref) { | public function normalizeAtomRef(DivinerAtomRef $ref) { | ||||
| if (!strlen($ref->getBook())) { | if (!strlen($ref->getBook())) { | ||||
| $ref->setBook($this->getConfig('name')); | $ref->setBook($this->getConfig('name')); | ||||
| } | } | ||||
| if ($ref->getBook() != $this->getConfig('name')) { | if ($ref->getBook() != $this->getConfig('name')) { | ||||
| // If the ref is from a different book, we can't normalize it. Just return | // If the ref is from a different book, we can't normalize it. | ||||
| // it as-is if it has enough information to resolve. | // Just return it as-is if it has enough information to resolve. | ||||
| if ($ref->getName() && $ref->getType()) { | if ($ref->getName() && $ref->getType()) { | ||||
| return $ref; | return $ref; | ||||
| } else { | } else { | ||||
| return null; | return null; | ||||
| } | } | ||||
| } | } | ||||
| $atom = $this->getPublisher()->findAtomByRef($ref); | $atom = $this->getPublisher()->findAtomByRef($ref); | ||||
| Show All 40 Lines | protected function renderAtomRefLink(DivinerAtomRef $ref) { | ||||
| return phutil_tag( | return phutil_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'href' => $this->getHrefForAtomRef($ref), | 'href' => $this->getHrefForAtomRef($ref), | ||||
| ), | ), | ||||
| $ref->getTitle()); | $ref->getTitle()); | ||||
| } | } | ||||
| } | } | ||||