ILIAS  release_8 Revision v8.24
class.ilSoapStructureObject.php
Go to the documentation of this file.
1<?php
2/*
3 +-----------------------------------------------------------------------------+
4 | ILIAS open source |
5 +-----------------------------------------------------------------------------+
6 | Copyright (c) 1998-2001 ILIAS open source, University of Cologne |
7 | |
8 | This program is free software; you can redistribute it and/or |
9 | modify it under the terms of the GNU General Public License |
10 | as published by the Free Software Foundation; either version 2 |
11 | of the License, or (at your option) any later version. |
12 | |
13 | This program is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | GNU General Public License for more details. |
17 | |
18 | You should have received a copy of the GNU General Public License |
19 | along with this program; if not, write to the Free Software |
20 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21 +-----------------------------------------------------------------------------+
22*/
23
29{
30 public int $obj_id;
31 public string $title;
32 public string $type;
33 public string $description;
34 public ?int $parentRefId;
35
36 public array $structureObjects = array();
37
38 public function __construct(int $objId, string $type, string $title, string $description, ?int $parentRefId = null)
39 {
40 $this->setObjId($objId);
41 $this->setType($type);
42 $this->setTitle($title);
43 $this->setDescription($description);
44 $this->parentRefId = $parentRefId;
45 }
46
47 public function addStructureObject(ilSoapStructureObject $structureObject) : void
48 {
49 $this->structureObjects [$structureObject->getObjId()] = $structureObject;
50 }
51
52 public function getStructureObjects() : array
53 {
55 }
56
57 public function setObjId(int $value) : void
58 {
59 $this->obj_id = $value;
60 }
61
62 public function getObjId() : int
63 {
64 return $this->obj_id;
65 }
66
67 public function setTitle(string $value) : void
68 {
69 $this->title = $value;
70 }
71
72 public function getTitle() : string
73 {
74 return $this->title;
75 }
76
77 public function setDescription(string $value) : void
78 {
79 $this->description = $value;
80 }
81
82 public function getDescription() : string
83 {
84 return $this->description;
85 }
86
87 public function setType(string $value) : void
88 {
89 $this->type = $value;
90 }
91
92 public function getType() : string
93 {
94 return $this->type;
95 }
96
97 public function getGotoLink() : string
98 {
99 return ILIAS_HTTP_PATH . "/" . "goto.php?target=" . $this->getType() .
100 "_" . $this->getObjId() .
101 (is_numeric($this->getParentRefId()) ? "_" . $this->getParentRefId() : "") . "&client_id=" . CLIENT_ID;
102 }
103
104 public function getInternalLink() : string
105 {
106 return '';
107 }
108
112 public function _getXMLAttributes() : array
113 {
114 return array(
115 'type' => $this->getType(),
116 'obj_id' => $this->getObjId()
117 );
118 }
119
120 public function _getTagName() : string
121 {
122 return "StructureObject";
123 }
124
125 public function setParentRefId(int $parentRefId) : void
126 {
127 $this->parentRefId = $parentRefId;
128 }
129
130 public function getParentRefId() : ?int
131 {
132 return $this->parentRefId;
133 }
134
135 public function exportXML(ilXmlWriter $xml_writer) : void
136 {
137 $attrs = $this->_getXMLAttributes();
138
139 $xml_writer->xmlStartTag($this->_getTagName(), $attrs);
140
141 $xml_writer->xmlElement('Title', null, $this->getTitle());
142 $xml_writer->xmlElement('Description', null, $this->getDescription());
143 $xml_writer->xmlElement('InternalLink', null, $this->getInternalLink());
144 $xml_writer->xmlElement('GotoLink', null, $this->getGotoLink());
145
146 $xml_writer->xmlStartTag("StructureObjects");
147
149
150 foreach ($structureObjects as $structureObject) {
151 $structureObject->exportXML($xml_writer);
152 }
153
154 $xml_writer->xmlEndTag("StructureObjects");
155
156 $xml_writer->xmlEndTag($this->_getTagName());
157 }
158}
Abstract classs for soap structure objects.
__construct(int $objId, string $type, string $title, string $description, ?int $parentRefId=null)
exportXML(ilXmlWriter $xml_writer)
addStructureObject(ilSoapStructureObject $structureObject)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
const CLIENT_ID
Definition: constants.php:41
$objId
Definition: xapitoken.php:57