ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilADTExternalLinkPresentationBridge.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
4
12{
13
19 protected function isValidADT(ilADT $a_adt)
20 {
21 return $a_adt instanceof ilADTExternalLink;
22 }
23
28 public function getHTML()
29 {
30 if ($this->getADT()->isNull()) {
31 return;
32 }
33 if (!strlen($this->getADT()->getTitle())) {
34 $presentation_value = $this->getADT()->getUrl();
35 $presentation_clickable = ilUtil::makeClickable($presentation_value);
36 return $this->decorate($presentation_clickable);
37 }
38
39 return $this->decorate(
40 '<a target="_blank" href="' . $this->getADT()->getUrl() . '">' . $this->getADT()->getTitle() . '</a>'
41 );
42 }
43
48 public function getSortable()
49 {
50 if (!$this->getADT()->isNull()) {
51 return $this->getADT()->getUrl();
52 }
53 }
54}
An exception for terminatinating execution or to throw for unit testing.
ADT presentation bridge base class.
ADT base class.
Definition: class.ilADT.php:12
static makeClickable($a_text, $detectGotoLinks=false)
makeClickable In Texten enthaltene URLs und Mail-Adressen klickbar machen