53 public function handlerBeginTag($a_xml_parser,
string $a_name, array $a_attribs): void
63 $this->
addProperty(
'type', (
string) $a_attribs[
'type']);
64 if (array_key_exists(
'obj_id', $a_attribs)) {
68 $a_attribs[
"obj_id"] ??
'',
73 if (isset($a_attribs[
'offline'])) {
74 $this->
addProperty(
'offline', $a_attribs[
'offline']);
90 $this->time_target = [];
91 $this->ref_id = $a_attribs[
"ref_id"] ?? 0;
92 $this->parent_id = $a_attribs[
'parent_id'] ?? 0;
96 $this->time_target[
'timing_type'] = $a_attribs[
'type'];
100 if (isset($a_attribs[
'visibility'])) {
101 $this->time_target[
'timing_visibility'] = $a_attribs[
'visibility'];
103 if (isset($a_attribs[
'starting_time'])) {
104 $this->time_target[
'starting_time'] = $a_attribs[
'starting_time'];
106 if (isset($a_attribs[
'ending_time'])) {
107 $this->time_target[
'ending_time'] = $a_attribs[
'ending_time'];
109 if (isset($a_attribs[
'ending_time']) && isset($a_attribs[
'starting_time'])) {
111 if ($a_attribs[
'ending_time'] < $a_attribs[
'starting_time']) {
118 $this->time_target[
'changeable'] = $a_attribs[
'changeable'] ??
false;
120 if (isset($a_attribs[
'starting_time'])) {
121 $this->time_target[
'suggestion_start'] = $a_attribs[
'starting_time'];
123 if (isset($a_attribs[
'ending_time'])) {
124 $this->time_target[
'suggestion_end'] = $a_attribs[
'ending_time'];
147 $this->
addProperty(
'description', trim($this->cdata));
155 $this->
addProperty(
'create_date', trim($this->cdata));
159 $this->
addProperty(
'last_update', trim($this->cdata));
163 $this->
addProperty(
'import_id', trim($this->cdata));
167 if ($this->ref_id !== 0 && $this->parent_id !== 0) {
168 $this->
addReference($this->ref_id, $this->parent_id, $this->time_target);
183 if ($a_data !==
"\n") {
185 $a_data = preg_replace(
"/\t+/",
" ", $a_data);
187 $this->cdata .= $a_data;
201 private function addReference(
int $a_ref_id,
int $a_parent_id, array $a_time_target): void
203 $reference[
'ref_id'] = $a_ref_id;
204 $reference[
'parent_id'] = $a_parent_id;
205 $reference[
'time_target'] = $a_time_target;
207 if (isset($reference[
'time_target'][
'changeable']) && $reference[
'time_target'][
'changeable'] &&
208 !isset($reference[
'time_target'][
'suggestion_start'], $reference[
'time_target'][
'suggestion_end'])) {
210 'Missing attributes: "starting_time" and "ending_time" required for attribute "changeable"'
addReference(int $a_ref_id, int $a_parent_id, array $a_time_target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addProperty(string $a_name, $a_value)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
handlerBeginTag($a_xml_parser, string $a_name, array $a_attribs)
handlerCharacterData($a_xml_parser, string $a_data)
static __extractId(string $ilias_id, int $inst_id)
extract ref id from role title, e.g.
__construct(Container $dic, ilPlugin $plugin)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setHandlers($a_xml_parser)
handlerEndTag($a_xml_parser, string $a_name)
setXMLContent(string $a_xml_content)
__construct(string $a_xml_data='', ?bool $throw_exception=false)