ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 try {
52 $linkXml = str_replace('<LinkTargets></LinkTargets>', '', $linkXml);
53
54 $domDoc = new DOMDocument();
55 $domDoc->loadXML('<?xml version="1.0" encoding="UTF-8"?>' . $linkXml);
56
57 $xpath = new DOMXPath($domDoc);
58 $links = $xpath->query('//IntLinkInfos/IntLinkInfo');
59
60 if ($links->length > 0) {
61 foreach ($links as $link) {
63 $link->attributes->getNamedItem('LinkTarget')->nodeValue = '_blank';
64 }
65 }
66
67 $linkXmlWithBlankTargets = $domDoc->saveXML();
68
69 $this->setLinkXML(str_replace('<?xml version="1.0" encoding="UTF-8"?>', '', $linkXmlWithBlankTargets));
70 } catch (Throwable $e) {
71 $this->log->error(sprintf(
72 'Could not manipulate page editor link XML: %s / Error Message: %s',
73 $linkXml,
74 $e->getMessage()
75 ));
76 }
77 return;
78 }
79 }
80}
An exception for terminatinating execution or to throw for unit testing.
Class ilContentPagePageGUI @ilCtrl_Calls ilContentPagePageGUI: ilPageEditorGUI, ilEditClipboardGUI,...
__construct($a_id=0, $a_old_nr=0, $isEmbeddedMode=false)
ilContentPagePageGUI constructor.
getProfileBackUrl()
Get profile back url.
Class ilPageObjectGUI.
setTemplateOutput($a_output=true)
setDefaultLinkXml()
Set standard link xml.
setTemplateTargetVar($a_variable)
Interface ilContentPageObjectConstants.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc