ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilContentPagePageGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2018 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
11 {
13  protected $isEmbeddedMode = false;
14 
21  public function __construct($a_id = 0, $a_old_nr = 0, $isEmbeddedMode = false)
22  {
23  parent::__construct(self::OBJ_TYPE, $a_id, $a_old_nr);
24  $this->setTemplateTargetVar('ADM_CONTENT');
25  $this->setTemplateOutput(false);
26  $this->isEmbeddedMode = $isEmbeddedMode;
27  }
28 
32  public function getProfileBackUrl()
33  {
34  if ($this->isEmbeddedMode) {
35  return '';
36  }
37 
38  return parent::getProfileBackUrl();
39  }
40 
44  public function setDefaultLinkXml()
45  {
46  parent::setDefaultLinkXml();
47 
48  if ($this->isEmbeddedMode) {
49  $linkXml = $this->getLinkXML();
50 
51  $domDoc = new \DOMDocument();
52  $domDoc->loadXML('<?xml version="1.0" encoding="UTF-8"?>' . $linkXml);
53 
54  $xpath = new \DOMXPath($domDoc);
55  $links = $xpath->query('//IntLinkInfos/IntLinkInfo');
56 
57  if ($links->length > 0) {
58  foreach ($links as $link) {
60  $link->attributes->getNamedItem('LinkTarget')->nodeValue = '_blank';
61  }
62  }
63 
64  $linkXmlWithBlankTargets = $domDoc->saveXML();
65 
66  $this->setLinkXML(str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $linkXmlWithBlankTargets));
67  return;
68  }
69  }
70 }
Class ilContentPagePageGUI ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI, ilMDEditorGUI ilContentPagePageGUI: ilPublicUserProfileGUI, ilNoteGUI ilContentPagePageGUI: ilPropertyFormGUI, ilInternalLinkGUI.
setTemplateOutput($a_output=true)
Interface ilContentPageObjectConstants.
Class ilPageObjectGUI.
setDefaultLinkXml()
Set standard link xml.
setTemplateTargetVar($a_variable)
__construct($a_id=0, $a_old_nr=0, $isEmbeddedMode=false)
ilContentPagePageGUI constructor.
$links