ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilADTLocalizedTextPresentationBridge.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3
9{
10 private $lng;
11
12 public function __construct(ilADT $a_adt)
13 {
14 global $DIC;
15
16 $this->lng = $DIC->language();
17
18 parent::__construct($a_adt);
19 }
20
21 protected function isValidADT(ilADT $a_adt)
22 {
23 return $a_adt instanceof ilADTLocalizedText;
24 }
25
26 public function getHTML()
27 {
28 if (!$this->getADT()->isNull()) {
29 return $this->decorate(nl2br($this->getADT()->getTextForLanguage($this->lng->getLangKey())));
30 }
31 }
32
33 public function getSortable()
34 {
35 if (!$this->getADT()->isNull()) {
36 return strtolower($this->getADT()->getTextForLanguage($this->lng->getLangKey()));
37 }
38 }
39}
An exception for terminatinating execution or to throw for unit testing.
isValidADT(ilADT $a_adt)
Check if given ADT is valid.
Class ilADTLocalizedText.
ADT base class.
Definition: class.ilADT.php:12
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc