31     public function init(): void
    35         $this->
lng = $DIC->language();
    37         $this->component_repository = $DIC[
"component.repository"] ?? null;
    38         $this->component_factory = $DIC[
"component.factory"] ?? null;
    48         string $a_plugin_name,
    49         string $a_plugin_version
    55             [
"PluginName" => $a_plugin_name, 
"PluginVersion" => $a_plugin_version]
    71         foreach ($a_properties as 
$key => $value) {
    72             $prop_node = $this->dom_doc->createElement(
"PluggedProperty");
    73             $prop_node = $this->
getChildNode()->appendChild($prop_node);
    74             $prop_node->setAttribute(
"Name", 
$key);
    76                 $this->dom_util->setContent($prop_node, $value);
    86         $properties = array();
    90                 if ($c->nodeName == 
"PluggedProperty") {
    91                     $properties[$c->getAttribute(
"Name")] =
    92                         $this->dom_util->getContent($c);
   102         if (!empty($a_version)) {
   103             $this->
getChildNode()->setAttribute(
"PluginVersion", $a_version);
   105             if ($this->
getChildNode()->hasAttribute(
"PluginVersion")) {
   106                 $this->
getChildNode()->removeAttribute(
"PluginVersion");
   114             return $this->
getChildNode()->getAttribute(
"PluginVersion");
   121         if (!empty($a_name)) {
   122             $this->
getChildNode()->setAttribute(
"PluginName", $a_name);
   124             if ($this->
getChildNode()->hasAttribute(
"PluginName")) {
   133             return $this->
getChildNode()->getAttribute(
"PluginName");
   141         $component_repository = $DIC[
'component.repository'];
   142         $component_factory = $DIC[
'component.factory'];
   148         if (is_object($plugin_info) && $plugin_info->isActive()) {
   150             $plugin_obj = $component_factory->
getPlugin($plugin_info->getId());
   160     public static function handleCopiedPluggedContent(
   165         $dom_util = $DIC->copage()->internal()->domain()->domUtil();
   166         $component_repository = $DIC[
'component.repository'];
   167         $component_factory = $DIC[
'component.factory'];
   170         $nodes = $xpath->query(
"//Plugged");
   173         foreach ($nodes as $node) {
   174             $plugin_name = $node->getAttribute(
'PluginName');
   175             $plugin_version = $node->getAttribute(
'PluginVersion');
   177             $plugin_obj = self::getActivePluginByName($plugin_name);
   178             if (is_object($plugin_obj)) {
   179                 $plugin_obj->setPageObj($a_page);
   181                 $properties = array();
   183                 foreach ($node->childNodes as $child) {
   184                     $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
   189                 $plugin_obj->onClone($properties, $plugin_version);
   192                 foreach ($properties as $name => $value) {
   195                         str_replace(
"&", 
"&", $value)
   197                     $node->appendChild($child);
   198                     $child->setAttribute(
'Name', $name);
   211         $dom_util = $DIC->copage()->internal()->domain()->domUtil();
   213         $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
   216         $component_factory = $DIC[
"component.factory"];
   219         $component_repository = $DIC[
"component.repository"];
   222         $nodes = $xpath->query(
"//Plugged");
   225         foreach ($nodes as $node) {
   226             $plugin_name = $node->getAttribute(
'PluginName');
   227             $plugin_version = $node->getAttribute(
'PluginVersion');
   228             $plugin_obj = self::getActivePluginByName($plugin_name);
   230             if (is_object($plugin_obj)) {
   231                 $plugin_obj->setPageObj($page);
   233                 $properties = array();
   235                 foreach ($node->childNodes as $child) {
   236                     $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
   241                 $plugin_obj->afterRepositoryCopy($properties, $mapping, $source_ref_id, $plugin_version);
   244                 foreach ($properties as $name => $value) {
   247                         str_replace(
"&", 
"&", $value)
   249                     $node->appendChild($child);
   250                     $child->setAttribute(
'Name', $name);
   260     public static function handleDeletedPluggedNode(
   263         bool $move_operation = 
false   266         $component_repository = $DIC[
'component.repository'];
   267         $component_factory = $DIC[
'component.factory'];
   269         $plugin_name = $a_node->getAttribute(
'PluginName');
   270         $plugin_version = $a_node->getAttribute(
'PluginVersion');
   272         $plugin_obj = self::getActivePluginByName($plugin_name);
   273         if (is_object($plugin_obj)) {
   274             $plugin_obj->setPageObj($a_page);
   276             $properties = array();
   278             foreach ($a_node->childNodes as $child) {
   279                 $properties[$child->getAttribute(
'Name')] = $child->nodeValue;
   283             $plugin_obj->onDelete($properties, $plugin_version, $move_operation);
   290         bool $a_abstract_only = 
false   295         $start = strpos($a_output, 
"{{{{{Plugged<pl");
   297         if (is_int($start)) {
   298             $end = strpos($a_output, 
"}}}}}", $start);
   302             $param = substr($a_output, $start + 5, $end - $start - 5);
   303             $param = str_replace(
' xmlns:xhtml="http://www.w3.org/1999/xhtml"', 
"", 
$param);
   307             $plugin_version = 
$param[2];
   308             $properties = array();
   310             for ($i = 3; $i < count(
$param); $i += 2) {
   311                 $properties[
$param[$i]] = $param[$i + 1];
   315             if ($a_mode == 
"edit") {
   316                 $plugin_html = 
'<div class="ilBox">' . $lng->
txt(
"content_plugin_not_activated") . 
" (" . $plugin_name . 
")</div>";
   319             $plugin_obj = self::getActivePluginByName($plugin_name);
   321             if (is_object($plugin_obj)) {
   322                 $plugin_obj->setPageObj($this->
getPage());
   323                 $gui_obj = $plugin_obj->getUIClassInstance();
   324                 $plugin_html = $gui_obj->getElementHTML($a_mode, $properties, $plugin_version);
   326                 if ($a_mode === 
"edit") {
   327                     $plugin_html = sprintf($this->
lng->txt(
"copg_plugin_not_avail"), $plugin_name);
   333             $a_output = substr($a_output, 0, $start) .
   335                 substr($a_output, $end + 5);
   337             if (strlen($a_output) > $start + 5) {
   338                 $start = strpos($a_output, 
"{{{{{Plugged<pl", $start + 5);
   343             if (is_int($start)) {
   344                 $end = strpos($a_output, 
"}}}}}", $start);
   355         foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as 
$plugin) {
   357             $pl_dir = 
$plugin->getDirectory();
   359             $pl_js_files = 
$plugin->getJavascriptFiles($a_mode);
   360             foreach ($pl_js_files as $pl_js_file) {
   361                 if (!is_int(strpos($pl_js_file, 
"//"))) {
   362                     $pl_js_file = $pl_dir . 
"/" . $pl_js_file;
   364                 if (!in_array($pl_js_file, $js_files)) {
   365                     $js_files[] = $pl_js_file;
   375         $css_files = array();
   377         foreach ($this->component_factory->getActivePluginsInSlot(
"pgcp") as 
$plugin) {
   379             $pl_dir = 
$plugin->getDirectory();
   381             $pl_css_files = 
$plugin->getCssFiles($a_mode);
   382             foreach ($pl_css_files as $pl_css_file) {
   383                 if (!is_int(strpos($pl_css_file, 
"//"))) {
   384                     $pl_css_file = $pl_dir . 
"/" . $pl_css_file;
   386                 if (!in_array($pl_css_file, $css_files)) {
   387                     $css_files[] = $pl_css_file;
 static afterRepositoryCopy(ilPageObject $page, array $mapping, int $source_ref_id)
After repository (container) copy action. 
 
setType(string $a_type)
Set Type. 
 
Readable part of repository interface to ilComponentDataDB. 
 
setProperties(array $a_properties)
Set properties of plugged component. 
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
getProperties()
Get properties of plugged component. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getCssFiles(string $a_mode)
 
getDomDoc()
Get dom doc (DOMDocument) 
 
getPlugin(string $id)
Get the plugin for the given id. 
 
getJavascriptFiles(string $a_mode)
 
setPluginVersion(string $a_version)
 
Content object of ilPageObject (see ILIAS DTD). 
 
getPluginByName(string $name)
Get a plugin by name. 
 
Class ilPageObject Handles PageObjects of ILIAS Learning Modules (see ILIAS DTD) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
setPluginName(string $a_name)
 
modifyPageContentPostXsl(string $a_output, string $a_mode, bool $a_abstract_only=false)
 
ilComponentRepository $component_repository
 
ILIAS COPage Dom DomUtil $dom_util
 
create(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id, string $a_plugin_name, string $a_plugin_version)
Create plugged node in xml. 
 
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 
ilComponentFactory $component_factory