ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SAML2\XML\mdui\UIInfo Class Reference
+ Collaboration diagram for SAML2\XML\mdui\UIInfo:

Public Member Functions

 __construct (\DOMElement $xml=null)
 Create a UIInfo element. More...
 
 toXML (\DOMElement $parent)
 Convert this UIInfo to XML. More...
 

Data Fields

 $children = array()
 
 $DisplayName = array()
 
 $Description = array()
 
 $InformationURL = array()
 
 $PrivacyStatementURL = array()
 
 $Keywords = array()
 
 $Logo = array()
 

Detailed Description

Definition at line 14 of file UIInfo.php.

Constructor & Destructor Documentation

◆ __construct()

SAML2\XML\mdui\UIInfo::__construct ( \DOMElement  $xml = null)

Create a UIInfo element.

Parameters
\DOMElement | null$xmlThe XML element we should load.

Definition at line 72 of file UIInfo.php.

References $xml, SAML2\Utils\extractLocalizedStrings(), SAML2\XML\mdui\Common\NS, and SAML2\Utils\xpQuery().

73  {
74  if ($xml === null) {
75  return;
76  }
77 
78  $this->DisplayName = Utils::extractLocalizedStrings($xml, Common::NS, 'DisplayName');
79  $this->Description = Utils::extractLocalizedStrings($xml, Common::NS, 'Description');
80  $this->InformationURL = Utils::extractLocalizedStrings($xml, Common::NS, 'InformationURL');
81  $this->PrivacyStatementURL = Utils::extractLocalizedStrings($xml, Common::NS, 'PrivacyStatementURL');
82 
83  foreach (Utils::xpQuery($xml, './*') as $node) {
84  if ($node->namespaceURI === Common::NS) {
85  switch ($node->localName) {
86  case 'Keywords':
87  $this->Keywords[] = new Keywords($node);
88  break;
89  case 'Logo':
90  $this->Logo[] = new Logo($node);
91  break;
92  }
93  } else {
94  $this->children[] = new Chunk($node);
95  }
96  }
97  }
static extractLocalizedStrings(\DOMElement $parent, $namespaceURI, $localName)
Extract localized strings from a set of nodes.
Definition: Utils.php:580
$xml
Definition: metadata.php:240
static xpQuery(\DOMNode $node, $query)
Do an XPath query on an XML node.
Definition: Utils.php:191
+ Here is the call graph for this function:

Member Function Documentation

◆ toXML()

SAML2\XML\mdui\UIInfo::toXML ( \DOMElement  $parent)

Convert this UIInfo to XML.

Parameters
\DOMElement$parentThe element we should append to.
Returns
|null

Definition at line 105 of file UIInfo.php.

References SAML2\Utils\addStrings(), and SAML2\XML\mdui\Common\NS.

106  {
107  assert(is_array($this->DisplayName));
108  assert(is_array($this->InformationURL));
109  assert(is_array($this->PrivacyStatementURL));
110  assert(is_array($this->Keywords));
111  assert(is_array($this->Logo));
112  assert(is_array($this->children));
113 
114  $e = null;
115  if (!empty($this->DisplayName)
116  || !empty($this->Description)
117  || !empty($this->InformationURL)
118  || !empty($this->PrivacyStatementURL)
119  || !empty($this->Keywords)
120  || !empty($this->Logo)
121  || !empty($this->children)) {
122  $doc = $parent->ownerDocument;
123 
124  $e = $doc->createElementNS(Common::NS, 'mdui:UIInfo');
125  $parent->appendChild($e);
126 
127  Utils::addStrings($e, Common::NS, 'mdui:DisplayName', true, $this->DisplayName);
128  Utils::addStrings($e, Common::NS, 'mdui:Description', true, $this->Description);
129  Utils::addStrings($e, Common::NS, 'mdui:InformationURL', true, $this->InformationURL);
130  Utils::addStrings($e, Common::NS, 'mdui:PrivacyStatementURL', true, $this->PrivacyStatementURL);
131 
132  if (!empty($this->Keywords)) {
133  foreach ($this->Keywords as $child) {
134  $child->toXML($e);
135  }
136  }
137 
138  if (!empty($this->Logo)) {
139  foreach ($this->Logo as $child) {
140  $child->toXML($e);
141  }
142  }
143 
144  if (!empty($this->children)) {
145  foreach ($this->children as $child) {
146  $child->toXML($e);
147  }
148  }
149  }
150 
151  return $e;
152  }
static addStrings(\DOMElement $parent, $namespace, $name, $localized, array $values)
Append string elements.
Definition: Utils.php:659
+ Here is the call graph for this function:

Field Documentation

◆ $children

SAML2\XML\mdui\UIInfo::$children = array()

Definition at line 23 of file UIInfo.php.

◆ $Description

SAML2\XML\mdui\UIInfo::$Description = array()

Definition at line 37 of file UIInfo.php.

◆ $DisplayName

SAML2\XML\mdui\UIInfo::$DisplayName = array()

Definition at line 30 of file UIInfo.php.

◆ $InformationURL

SAML2\XML\mdui\UIInfo::$InformationURL = array()

Definition at line 44 of file UIInfo.php.

◆ $Keywords

SAML2\XML\mdui\UIInfo::$Keywords = array()

Definition at line 58 of file UIInfo.php.

◆ $Logo

SAML2\XML\mdui\UIInfo::$Logo = array()

Definition at line 65 of file UIInfo.php.

◆ $PrivacyStatementURL

SAML2\XML\mdui\UIInfo::$PrivacyStatementURL = array()

Definition at line 51 of file UIInfo.php.


The documentation for this class was generated from the following file: