ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilAdvancedMDFieldDefinitionExternalLink.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
11 {
16  public function getType()
17  {
18  return self::TYPE_EXTERNAL_LINK;
19  }
20 
21 
26  protected function initADTDefinition()
27  {
28  return ilADTFactory::getInstance()->getDefinitionInstanceByType("ExternalLink");
29  }
30 
35  public function getValueForXML(\ilADT $element)
36  {
37  return $element->getTitle() . '#' . $element->getUrl();
38  }
39 
44  public function importValueFromXML($a_cdata)
45  {
46  $parts = explode("#", $a_cdata);
47  if (count($parts) == 2) {
48  $adt = $this->getADT();
49  $adt->setTitle($parts[0]);
50  $adt->setUrl($parts[1]);
51  }
52  }
53 }
static getInstance()
Get singleton.
ADT base class.
Definition: class.ilADT.php:11