ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilADTInternalLinkPresentationBridge.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 ilADTInternalLink;
22  }
23 
28  public function getHTML()
29  {
30  if ($this->getADT()->isNull()) {
31  return;
32  }
33 
34  if (!$this->getADT()->isValid()) {
35  return;
36  }
37 
38  $access = $GLOBALS['DIC']->access();
39  $user = $GLOBALS['DIC']->user();
40 
41  if ($access->checkAccess('read', '', $this->getADT()->getTargetRefId())) {
42  $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getADT()->getTargetRefId()));
43  $link = ilLink::_getLink($this->getADT()->getTargetRefId());
44 
45  return $this->decorate(
46  '<a href="' . $link . '">' . $title . '</a>'
47  );
48  }
49  if ($access->checkAccess('visible', '', $this->getADT()->getTargetRefId())) {
50  $title = ilObject::_lookupTitle(ilObject::_lookupObjId($this->getADT()->getTargetRefId()));
51 
52  return $this->decorate($title);
53  }
54  return;
55  }
56 
61  public function getSortable()
62  {
63  if (!$this->getADT()->isNull()) {
64  return $this->getADT()->getTargetRefId();
65  }
66  }
67 }
decorate($a_value)
Decorate value.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupTitle($a_id)
lookup object title
ADT base class.
Definition: class.ilADT.php:11
static _lookupObjId($a_id)
ADT presentation bridge base class.