48 public function init(): void
52 $component_repository = $DIC[
"component.repository"];
55 $this->ds->initByExporter($this);
56 $this->ds->setDSPrefix(
"ds");
57 $this->config = $this->
getExport()->getConfig(
"components/ILIAS/COPage");
58 if ($this->config->getMasterLanguageOnly()) {
59 $this->ds->setMasterLanguageOnly(
true);
63 foreach ($component_repository->getPluginSlotById(
"pgcp")->getActivePlugins() as
$plugin) {
64 $plugin_name =
$plugin->getName();
65 if (
$plugin->supportsExport()) {
66 $this->plugin_dependencies[$plugin_name] = array(
67 "component" =>
"Plugins/" . $plugin_name,
77 string $a_target_release,
80 if ($a_entity ==
"pg") {
84 foreach ($a_ids as $pg_id) {
85 $pg_id = explode(
":", $pg_id);
87 $lang = ($this->config->getMasterLanguageOnly())
92 if ($this->config->getIncludeMedia()) {
94 foreach ($mids as $mid) {
102 $files = ilObjFile::_getFilesOfObject($pg_id[0] .
":pg", $pg_id[1], 0,
$lang);
103 foreach ($files as $file) {
112 "component" =>
"components/ILIAS/MediaObjects",
116 "component" =>
"components/ILIAS/File",
127 string $a_target_release,
130 if ($a_entity ==
"pgtp") {
132 foreach ($a_ids as
$id) {
133 $pg_ids[] =
"stys:" .
$id;
138 "component" =>
"components/ILIAS/COPage",
144 if (!empty($this->plugin_dependencies)) {
146 return array_values($this->plugin_dependencies);
154 string $a_schema_version,
157 if ($a_entity ==
"pg") {
158 $id = explode(
":", $a_id);
161 if (!$this->config->getMasterLanguageOnly()) {
163 foreach ($trans as $t) {
171 foreach ($langs as $l) {
173 $page_object->buildDom();
175 $this->extractPluginProperties($page_object);
176 $pxml = $page_object->getXMLFromDom(
false,
false,
false,
"",
true);
177 $pxml = str_replace(
"&",
"&", $pxml);
178 $a_media = ($this->config->getIncludeMedia())
180 :
'WithoutMedia="1"';
181 $xml .=
'<PageObject Language="' . $l .
'" Active="' . $page_object->getActive() .
'" ActivationStart="' . $page_object->getActivationStart() .
'" ActivationEnd="' .
182 $page_object->getActivationEnd() .
'" ShowActivationInfo="' . $page_object->getShowActivationInfo() .
'" ' . $a_media .
'>';
184 $xml .=
"</PageObject>";
185 $page_object->freeDom();
190 if ($a_entity ==
"pgtp") {
191 return $this->ds->getXmlRepresentation($a_entity, $a_schema_version, [$a_id],
"",
true,
true);
199 if ($a_entity ==
"pg") {
202 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_2",
203 "xsd_file" =>
"ilias_pg_4_2.xsd",
207 "namespace" =>
"https://www.ilias.de/Services/COPage/pg/4_1",
208 "xsd_file" =>
"ilias_pg_4_1.xsd",
213 if ($a_entity ==
"pgtp") {
216 "namespace" =>
"https://www.ilias.de/Services/COPage/pgtp/4_1",
217 "xsd_file" =>
"ilias_pgtp_4_1.xsd",
218 "uses_dataset" =>
true,
234 protected function extractPluginProperties(
237 if (empty($this->plugin_dependencies)) {
244 $nodes = $xpath->query(
"//PageContent[child::Plugged]");
247 foreach ($nodes as $pcnode) {
249 $pc_id = $pcnode->getAttribute(
'PCID');
250 $plnode = $pcnode->childNodes->item(0);
251 $plugin_name = $plnode->getAttribute(
'PluginName');
252 $plugin_version = $plnode->getAttribute(
'PluginVersion');
255 if (isset($this->plugin_dependencies[$plugin_name])) {
258 .
':' . $a_page->
getId()
262 $properties = array();
264 foreach ($plnode->childNodes as $child) {
265 $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
273 $this->plugin_dependencies[$plugin_name][
'ids'][] =
$id;
getXmlRepresentation(string $a_entity, string $a_schema_version, string $a_id)
buildDom(bool $a_force=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDomDoc()
Get dom doc (DOMDocument)
static lookupTranslations(string $a_parent_type, int $a_id)
Lookup translations.
getValidSchemaVersions(string $a_entity)
Export configuration class parent class.
static setPCVersion(string $a_id, string $a_version)
Set the version of a plugged page content This method is used by ilCOPageExporter to provide the vers...
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD)
getXmlExportHeadDependencies(string $a_entity, string $a_target_release, array $a_ids)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
getXmlExportTailDependencies(string $a_entity, string $a_target_release, array $a_ids)
static _lookupType(int $id, bool $reference=false)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getInstance(string $a_parent_type, int $a_id=0, int $a_old_nr=0, string $a_lang="-")
Get page object instance.
array $plugin_dependencies
static setPCProperties(string $a_id, array $a_properties)
Set the properties of a plugged page content This method is used by ilCOPageExporter to provide the p...