ILIAS  release_8 Revision v8.24
class.ilPluginReader.php
Go to the documentation of this file.
1<?php
33{
34 protected $ctype;
35 protected $cname;
36 protected $slot_id;
37 protected $pname;
38
39 public function __construct(?string $a_path, $a_ctype, $a_cname, $a_slot_id, $a_pname)
40 {
41 parent::__construct($a_path);
42
43 $this->ctype = $a_ctype;
44 $this->cname = $a_cname;
45 $this->slot_id = $a_slot_id;
46 $this->pname = $a_pname;
47 }
48
52 public function clearEvents(): void
53 {
54 global $DIC;
55 $ilDB = $DIC->database();
56
57 $component = "Plugins/" . $this->pname;
58 $ilDB->manipulate("DELETE FROM il_event_handling WHERE component = " . $ilDB->quote($component, 'text'));
59 }
60
61
62 public function startParsing(): void
63 {
64 if ($this->getInputType() === 'file' && !file_exists($this->xml_file)) {
65 // not every plugin has a plugin.xml yet
66 return;
67 }
68 parent::startParsing();
69 }
70
71 public function setHandlers($a_xml_parser): void
72 {
73 xml_set_object($a_xml_parser, $this);
74 xml_set_element_handler($a_xml_parser, 'handlerBeginTag', 'handlerEndTag');
75 xml_set_character_data_handler($a_xml_parser, 'handlerCharacterData');
76 }
77
86 public function handlerBeginTag($a_xml_parser, $a_name, $a_attribs): void
87 {
88 global $DIC;
89 $ilDB = $DIC->database();
90
91 if ($a_name === "event") {
92 $component = "Plugins/" . $this->pname;
93 $q = "INSERT INTO il_event_handling (component, type, id) VALUES (" .
94 $ilDB->quote($component, "text") . "," .
95 $ilDB->quote($a_attribs["type"], "text") . "," .
96 $ilDB->quote($a_attribs["id"], "text") . ")";
97 $ilDB->manipulate($q);
98 }
99 }
100
108 public function handlerEndTag($a_xml_parser, $a_name): void
109 {
110 }
111
119 public function handlerCharacterData($a_xml_parser, $a_data): void
120 {
121 }
122}
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
clearEvents()
Delete the event listeneing information.
setHandlers($a_xml_parser)
handlerCharacterData($a_xml_parser, $a_data)
end tag handler
handlerBeginTag($a_xml_parser, $a_name, $a_attribs)
start tag handler
__construct(?string $a_path, $a_ctype, $a_cname, $a_slot_id, $a_pname)
handlerEndTag($a_xml_parser, $a_name)
end tag handler
startParsing()
stores xml data in array
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc