ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilPCInteractiveImage Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilPCInteractiveImage:
+ Collaboration diagram for ilPCInteractiveImage:

Public Member Functions

 init ()
 
 readMediaObject (int $a_mob_id=0)
 
 setDomNode (DOMNode $dom_node)
 
 setMediaObject (ilObjMediaObject $a_mediaobject)
 
 getMediaObject ()
 
 createMediaObject ()
 
 create ()
 
 getStandardMediaItem ()
 
 getStandardAliasItem ()
 
 getBaseThumbnailTarget ()
 
 createAlias (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 dumpXML ()
 
 addContentPopup (?string $title=null)
 Add a tab. More...
 
 getPopups ()
 Get popup captions. More...
 
 savePopups (array $a_popups)
 Save popups. More...
 
 deletePopup (string $a_hier_id, string $a_pc_id)
 Delete popup. More...
 
 saveContentPopupTitle (string $nr, string $title)
 
 deletePopupByNr (string $nr)
 
 addTriggerArea (ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title, string $hl_mode="", string $hl_class="")
 Add a new trigger. More...
 
 addTriggerMarker (string $title="", string $coords="")
 Add a new trigger marker. More...
 
 getTriggerNodes (string $a_hier_id, string $a_pc_id="")
 
 getTriggers ()
 
 deleteTrigger (ilMediaAliasItem $a_alias_item, int $a_nr)
 Delete Trigger. More...
 
 setTriggerOverlays (array $a_ovs)
 Set trigger overlays. More...
 
 deleteOverlay (string $file)
 
 setTriggerOverlayPositions (array $a_pos)
 Set trigger overlay position. More...
 
 setTriggerMarkerPositions (array $a_pos)
 Set trigger marker position. More...
 
 setTriggerPopupPositions (array $a_pos)
 Set trigger popup position. More...
 
 setTriggerPopupSize (array $a_size)
 Set trigger popup size. More...
 
 setTriggerPopups (array $a_pops)
 Set trigger popups. More...
 
 setTriggerTitles (array $a_titles)
 Set trigger titles. More...
 
 setExtLinkTitle (int $a_nr, string $a_title)
 
 createFromMobId (\ilPageObject $page, int $mob_id, string $hier_id, string $pc_id)
 
 getIIMModel ()
 
 setTriggerProperties (string $nr, string $title, string $shape_type, string $coords, string $hl_mode="", string $hl_class="")
 
 setTriggerOverlay (string $nr, string $overlay, string $coords)
 
 setTriggerPopup (string $nr, string $popup, string $position, string $size)
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 
 getPopupDummy ()
 
 getBackgroundImage ()
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 getNewPageContentNode ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Static Public Member Functions

static handleCopiedContent (DOMDocument $a_domdoc, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 
- Static Public Member Functions inherited from ilPageContent
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 

Data Fields

const AREA = "Area"
 
const MARKER = "Marker"
 
DOMNode $iim_node
 
- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 

Protected Member Functions

 setMapAreaProperties (ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title, string $a_id, string $hl_mode="", string $hl_class="")
 
 getTriggerNode (string $nr)
 
- Protected Member Functions inherited from ilPageContent
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 

Protected Attributes

DOMNode $mal_node
 
DOMNode $med_alias_node
 
ILIAS DI UIServices $ui
 
ILIAS COPage Html TransformUtil $htmlTransform
 
ILIAS COPage PC InteractiveImage IIMManager $manager
 
ilMediaAliasItem $std_alias_item
 
ilObjMediaObject $mediaobject
 
ilLanguage $lng
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $sourcecode_download_script = ''
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Interactive image.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilPCInteractiveImage.php.

Member Function Documentation

◆ addContentPopup()

ilPCInteractiveImage::addContentPopup ( ?string  $title = null)

Add a tab.

Definition at line 169 of file class.ilPCInteractiveImage.php.

References $lng, getPopups(), and ilLanguage\txt().

169  : void
170  {
171  $lng = $this->lng;
172 
173  if ($title === null) {
174  $title = $lng->txt("cont_new_popup");
175  }
176  $max = 0;
177  $popups = $this->getPopups();
178  foreach ($popups as $p) {
179  $max = max($max, (int) $p["nr"]);
180  }
181 
182  $new_item = $this->dom_doc->createElement("ContentPopup");
183  $new_item->setAttribute("Title", $title);
184  $new_item->setAttribute("Nr", $max + 1);
185  $new_item = $this->iim_node->appendChild($new_item);
186  }
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...
getPopups()
Get popup captions.
+ Here is the call graph for this function:

◆ addTriggerArea()

ilPCInteractiveImage::addTriggerArea ( ilMediaAliasItem  $a_alias_item,
string  $a_shape_type,
string  $a_coords,
string  $a_title,
string  $hl_mode = "",
string  $hl_class = "" 
)

Add a new trigger.

Definition at line 307 of file class.ilPCInteractiveImage.php.

References getTriggers(), setMapAreaProperties(), and ilUtil\stripSlashes().

Referenced by setTriggerProperties().

314  : void {
315  $max = 0;
316  $triggers = $this->getTriggers();
317  foreach ($triggers as $t) {
318  $max = max($max, (int) $t["Nr"]);
319  }
320 
321  $this->setMapAreaProperties(
322  $a_alias_item,
323  $a_shape_type,
324  $a_coords,
325  ilUtil::stripSlashes($a_title),
326  (string) ($max + 1),
327  $hl_mode,
328  $hl_class
329  );
330 
331  $attributes = array("Type" => self::AREA,
332  "Title" => ilUtil::stripSlashes($a_title),
333  "Nr" => $max + 1,
334  "OverlayX" => "0",
335  "OverlayY" => "0",
336  "Overlay" => "",
337  "PopupNr" => "",
338  "PopupX" => "0",
339  "PopupY" => "0",
340  "PopupWidth" => "150",
341  "PopupHeight" => "200"
342  );
343  $ma_node = $this->dom_util->addElementToList(
344  $this->iim_node,
345  "Trigger",
346  array("ContentPopup"),
347  "",
348  $attributes
349  );
350  }
setMapAreaProperties(ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title, string $a_id, string $hl_mode="", string $hl_class="")
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTriggerMarker()

ilPCInteractiveImage::addTriggerMarker ( string  $title = "",
string  $coords = "" 
)

Add a new trigger marker.

Definition at line 355 of file class.ilPCInteractiveImage.php.

References $lng, getTriggers(), and ilLanguage\txt().

Referenced by setTriggerProperties().

358  : void {
359  $lng = $this->lng;
360 
361  $max = 0;
362  $triggers = $this->getTriggers();
363  foreach ($triggers as $t) {
364  $max = max($max, (int) $t["Nr"]);
365  }
366 
367  if ($title === "") {
368  $title = $lng->txt("cont_new_marker");
369  }
370  $markerx = "0";
371  $markery = "0";
372  if ($coords !== "") {
373  $coord_parts = explode(",", $coords);
374  $markerx = ($coord_parts[0] ?? "0");
375  $markery = ($coord_parts[1] ?? "0");
376  }
377 
378  $attributes = array("Type" => self::MARKER,
379  "Title" => $title,
380  "Nr" => $max + 1,
381  "OverlayX" => "0",
382  "OverlayY" => "0",
383  "MarkerX" => $markerx,
384  "MarkerY" => $markery,
385  "PopupNr" => "",
386  "PopupX" => "0",
387  "PopupY" => "0",
388  "PopupWidth" => "150",
389  "PopupHeight" => "200"
390  );
391  $ma_node = $this->dom_util->addElementToList(
392  $this->iim_node,
393  "Trigger",
394  array("ContentPopup"),
395  "",
396  $attributes
397  );
398  }
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...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilPCInteractiveImage::create ( )

Definition at line 96 of file class.ilPCInteractiveImage.php.

References ilPageContent\createPageContentNode().

96  : void
97  {
98  $this->createPageContentNode();
99  }
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element) ...
+ Here is the call graph for this function:

◆ createAlias()

ilPCInteractiveImage::createAlias ( ilPageObject  $a_pg_obj,
string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 116 of file class.ilPCInteractiveImage.php.

References ilPageContent\getDomNode(), ILIAS\Survey\Mode\getId(), getMediaObject(), IL_INSERT_AFTER, ilPageObject\insertContent(), and setDomNode().

Referenced by createFromMobId().

120  : void {
121  $this->setDomNode($this->dom_doc->createElement("PageContent"));
122  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
123  $this->iim_node = $this->dom_doc->createElement("InteractiveImage");
124  $this->iim_node = $this->getDomNode()->appendChild($this->iim_node);
125  $this->mal_node = $this->dom_doc->createElement("MediaAlias");
126  $this->mal_node = $this->iim_node->appendChild($this->mal_node);
127  $this->mal_node->setAttribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
128 
129  // standard view
130  $item_node = $this->dom_doc->createElement("MediaAliasItem");
131  $item_node = $this->iim_node->appendChild($item_node);
132  $item_node->setAttribute("Purpose", "Standard");
133  $media_item = $this->getMediaObject()->getMediaItem("Standard");
134 
135  $layout_node = $this->dom_doc->createElement("Layout");
136  $layout_node = $item_node->appendChild($layout_node);
137  $layout_node->setAttribute("HorizontalAlign", "Left");
138 
139  // caption
140  if ($media_item->getCaption() != "") {
141  $cap_node = $this->dom_doc->createElement("Caption");
142  $cap_node = $item_node->appendChild($cap_node);
143  $cap_node->setAttribute("Align", "bottom");
144  $this->dom_util->setContent($cap_node, $media_item->getCaption());
145  }
146 
147  // text representation
148  if ($media_item->getTextRepresentation() != "") {
149  $tr_node = $this->dom_doc->createElement("TextRepresentation");
150  $tr_node = $item_node->appendChild($tr_node);
151  $this->dom_util->setContent($tr_node, $media_item->getTextRepresentation());
152  }
153  }
insertContent(ilPageContent $a_cont_obj, string $a_pos, int $a_mode=IL_INSERT_AFTER, string $a_pcid="", bool $remove_placeholder=true)
insert a content node before/after a sibling or as first child of a parent
const IL_INSERT_AFTER
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createFromMobId()

ilPCInteractiveImage::createFromMobId ( \ilPageObject  $page,
int  $mob_id,
string  $hier_id,
string  $pc_id 
)

Definition at line 643 of file class.ilPCInteractiveImage.php.

References createAlias(), and setMediaObject().

648  : void {
649  $this->setMediaObject(new ilObjMediaObject($mob_id));
650  $this->createAlias($page, $hier_id, $pc_id);
651  }
createAlias(ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
setMediaObject(ilObjMediaObject $a_mediaobject)
+ Here is the call graph for this function:

◆ createMediaObject()

ilPCInteractiveImage::createMediaObject ( )

Definition at line 91 of file class.ilPCInteractiveImage.php.

References setMediaObject().

91  : void
92  {
93  $this->setMediaObject(new ilObjMediaObject());
94  }
setMediaObject(ilObjMediaObject $a_mediaobject)
+ Here is the call graph for this function:

◆ deleteOverlay()

ilPCInteractiveImage::deleteOverlay ( string  $file)

Definition at line 476 of file class.ilPCInteractiveImage.php.

References getMediaObject(), ilPageContent\getPCId(), getTriggerNodes(), and ilUtil\stripSlashes().

476  : void
477  {
478  $file = str_replace("..", "", ilUtil::stripSlashes($file));
479  $this->getMediaObject()
480  ->removeAdditionalFile("overlays/" . $file);
481  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
482  foreach ($tr_nodes as $tr_node) {
483  if ($tr_node->getAttribute("Overlay") === $file) {
484  $tr_node->removeAttribute("Overlay");
485  }
486  }
487  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ deletePopup()

ilPCInteractiveImage::deletePopup ( string  $a_hier_id,
string  $a_pc_id 
)

Delete popup.

Definition at line 231 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c.

234  : void {
235  foreach ($this->iim_node->childNodes as $c) {
236  if ($c->nodeName === "ContentPopup") {
237  if ($a_pc_id == $c->getAttribute("PCID") &&
238  $a_hier_id == $c->getAttribute("HierId")) {
239  $c->parentNode->removeChild($c);
240  }
241  }
242  }
243  }

◆ deletePopupByNr()

ilPCInteractiveImage::deletePopupByNr ( string  $nr)

Definition at line 256 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c, ilPageContent\getPCId(), and getTriggerNodes().

258  : void {
259  foreach ($this->iim_node->childNodes as $c) {
260  if ($c->nodeName === "ContentPopup") {
261  if ($nr === $c->getAttribute("Nr")) {
262  $c->parentNode->removeChild($c);
263  }
264  }
265  }
266  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
267  foreach ($tr_nodes as $tr_node) {
268  if ($tr_node->getAttribute("PopupNr") === $nr) {
269  $tr_node->removeAttribute("PopupNr");
270  }
271  }
272  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ deleteTrigger()

ilPCInteractiveImage::deleteTrigger ( ilMediaAliasItem  $a_alias_item,
int  $a_nr 
)

Delete Trigger.

Definition at line 444 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c, and ilMediaAliasItem\deleteMapAreaById().

447  : void {
448  foreach ($this->iim_node->childNodes as $c) {
449  if ($c->nodeName === "Trigger") {
450  if ($a_nr === (int) $c->getAttribute("Nr")) {
451  $c->parentNode->removeChild($c);
452  }
453  }
454  }
455  $a_alias_item->deleteMapAreaById($a_nr);
456  }
deleteMapAreaById(string $a_id)
Delete map areas by id.
+ Here is the call graph for this function:

◆ dumpXML()

ilPCInteractiveImage::dumpXML ( )

Definition at line 155 of file class.ilPCInteractiveImage.php.

References ilPageContent\getDomNode().

155  : string
156  {
157  $xml = $this->dom_util->dump($this->getDomNode());
158  return $xml;
159  }
+ Here is the call graph for this function:

◆ getBackgroundImage()

ilPCInteractiveImage::getBackgroundImage ( )

Definition at line 822 of file class.ilPCInteractiveImage.php.

References $params, ilUtil\getImagePath(), getMediaObject(), ilFileUtils\getWebspaceDir(), IL_MODE_ALIAS, IL_MODE_OUTPUT, xslt_create(), xslt_error(), and xslt_free().

Referenced by ILIAS\COPage\PC\InteractiveImage\InteractiveImageCommandActionHandler\getStandardResponse().

822  : string
823  {
824  $mob = $this->getMediaObject();
825 
826  //$ilCtrl = $this->ctrl;
827 
828  $st_item = $mob->getMediaItem("Standard");
829 
830  // output image map
831  $xml = "<dummy>";
832  $xml .= $mob->getXML(IL_MODE_ALIAS);
833  $xml .= $mob->getXML(IL_MODE_OUTPUT);
834  $xml .= "</dummy>";
835  $xsl = file_get_contents("./Services/COPage/xsl/page.xsl");
836  //echo htmlentities($xml); exit;
837  $args = array( '/_xml' => $xml, '/_xsl' => $xsl );
838  $xh = xslt_create();
839  $wb_path = \ilFileUtils::getWebspaceDir("output") . "/";
840  $mode = "media";
841  //echo htmlentities($ilCtrl->getLinkTarget($this, "showImageMap"));
842 
843  $random = new \ilRandom();
844  $params = array(
845  'media_mode' => 'enable',
846  'pg_frame' => "",
847  'enlarge_path' => \ilUtil::getImagePath("enlarge.svg"),
848  'webspace_path' => $wb_path);
849  $output = xslt_process($xh, "arg:/_xml", "arg:/_xsl", null, $args, $params);
850  xslt_error($xh);
851  xslt_free($xh);
852 
853  return $output;
854  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
xslt_create()
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
xslt_free(&$proc)
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
xslt_error(&$proc)
const IL_MODE_ALIAS
const IL_MODE_OUTPUT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBaseThumbnailTarget()

ilPCInteractiveImage::getBaseThumbnailTarget ( )

Definition at line 111 of file class.ilPCInteractiveImage.php.

References getMediaObject().

111  : string
112  {
113  return $this->getMediaObject()->getMediaItem("Standard")->getThumbnailTarget();
114  }
+ Here is the call graph for this function:

◆ getIIMModel()

ilPCInteractiveImage::getIIMModel ( )

Definition at line 653 of file class.ilPCInteractiveImage.php.

References getMediaObject(), getPopups(), getStandardAliasItem(), and getTriggers().

Referenced by ILIAS\COPage\PC\InteractiveImage\InteractiveImageCommandActionHandler\getStandardResponse().

653  : ?stdClass
654  {
655  $alias_item = $this->getStandardAliasItem();
656  $model = new \stdClass();
657  $model->triggers = $this->getTriggers();
658  $model->popups = $this->getPopups();
659  $model->media_item = $alias_item->getModel();
660  $model->overlays = $this->manager->getOverlays($this->getMediaObject());
661  return $model;
662  }
getPopups()
Get popup captions.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMediaObject()

ilPCInteractiveImage::getMediaObject ( )

Definition at line 86 of file class.ilPCInteractiveImage.php.

References $mediaobject.

Referenced by createAlias(), deleteOverlay(), getBackgroundImage(), getBaseThumbnailTarget(), getIIMModel(), and getStandardMediaItem().

+ Here is the caller graph for this function:

◆ getPopupDummy()

ilPCInteractiveImage::getPopupDummy ( )

Definition at line 810 of file class.ilPCInteractiveImage.php.

810  : string
811  {
812  $content = <<<EOT
813 <div style='position:relative'><div class='copg-iim-popup copg-iim-popup-md' data-copg-cont-type='iim-popup'>
814 <div class="ilc_iim_ContentPopup" data-copg-iim-data-type="popup"><div class="ilc_Paragraph ilc_text_block_Standard">
815 ###content###
816 </div></div></div></div>
817 
818 EOT;
819  return $content;
820  }

◆ getPopups()

ilPCInteractiveImage::getPopups ( )

Get popup captions.

Definition at line 191 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c, and ilPageContent\$hier_id.

Referenced by addContentPopup(), and getIIMModel().

191  : array
192  {
193  $titles = array();
194  $k = 0;
195  foreach ($this->iim_node->childNodes as $c) {
196  if ($c->nodeName == "ContentPopup") {
197  $pc_id = $c->getAttribute("PCID");
198  $hier_id = $c->getAttribute("HierId");
199  $title = $c->getAttribute("Title");
200  $nr = $c->getAttribute("Nr");
201 
202  $titles[] = array("title" => $title,
203  "nr" => $nr,
204  "pc_id" => $pc_id,
205  "hier_id" => $hier_id
206  );
207  $k++;
208  }
209  }
210  return $titles;
211  }
+ Here is the caller graph for this function:

◆ getStandardAliasItem()

ilPCInteractiveImage::getStandardAliasItem ( )

Definition at line 106 of file class.ilPCInteractiveImage.php.

References $std_alias_item.

Referenced by getIIMModel(), and setTriggerProperties().

107  {
108  return $this->std_alias_item;
109  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getStandardMediaItem()

ilPCInteractiveImage::getStandardMediaItem ( )

Definition at line 101 of file class.ilPCInteractiveImage.php.

References getMediaObject().

101  : ilMediaItem
102  {
103  return $this->getMediaObject()->getMediaItem("Standard");
104  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ getTriggerNode()

ilPCInteractiveImage::getTriggerNode ( string  $nr)
protected

Definition at line 664 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

Referenced by setTriggerOverlay(), setTriggerPopup(), and setTriggerProperties().

665  {
666  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
667  foreach ($tr_nodes as $tr_node) {
668  if ($tr_node->getAttribute("Nr") === $nr) {
669  return $tr_node;
670  }
671  }
672  return null;
673  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTriggerNodes()

ilPCInteractiveImage::getTriggerNodes ( string  $a_hier_id,
string  $a_pc_id = "" 
)

Definition at line 400 of file class.ilPCInteractiveImage.php.

References $path.

Referenced by deleteOverlay(), deletePopupByNr(), getTriggerNode(), getTriggers(), setTriggerMarkerPositions(), setTriggerOverlayPositions(), setTriggerOverlays(), setTriggerPopupPositions(), setTriggerPopups(), setTriggerPopupSize(), and setTriggerTitles().

403  : DOMNodeList {
404  if ($a_pc_id != "") {
405  $path = "//PageContent[@PCID = '" . $a_pc_id . "']/InteractiveImage/Trigger";
406  return $this->dom_util->path($this->dom_doc, $path);
407  }
408 
409  $path = "//PageContent[@HierId = '" . $a_hier_id . "']/InteractiveImage/Trigger";
410  return $this->dom_util->path($this->dom_doc, $path);
411  }
$path
Definition: ltiservices.php:32
+ Here is the caller graph for this function:

◆ getTriggers()

ilPCInteractiveImage::getTriggers ( )

Definition at line 413 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

Referenced by addTriggerArea(), addTriggerMarker(), and getIIMModel().

413  : array
414  {
415  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
416  $trigger_arr = array();
417  foreach ($tr_nodes as $tr_node) {
418  $childs = $tr_node->childNodes;
419  $trigger_arr[] = array(
420  "Nr" => $tr_node->getAttribute("Nr"),
421  "Type" => $tr_node->getAttribute("Type"),
422  "Title" => $tr_node->getAttribute("Title"),
423  "OverlayX" => $tr_node->getAttribute("OverlayX"),
424  "OverlayY" => $tr_node->getAttribute("OverlayY"),
425  "MarkerX" => $tr_node->getAttribute("MarkerX"),
426  "MarkerY" => $tr_node->getAttribute("MarkerY"),
427  "Overlay" => $tr_node->getAttribute("Overlay"),
428  "PopupNr" => $tr_node->getAttribute("PopupNr"),
429  "PopupX" => $tr_node->getAttribute("PopupX"),
430  "PopupY" => $tr_node->getAttribute("PopupY"),
431  "PopupWidth" => $tr_node->getAttribute("PopupWidth"),
432  "PopupHeight" => $tr_node->getAttribute("PopupHeight"),
433  "PopupPosition" => $tr_node->getAttribute("PopupPosition"),
434  "PopupSize" => $tr_node->getAttribute("PopupSize")
435  );
436  }
437 
438  return $trigger_arr;
439  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleCopiedContent()

static ilPCInteractiveImage::handleCopiedContent ( DOMDocument  $a_domdoc,
bool  $a_self_ass = true,
bool  $a_clone_mobs = false,
int  $new_parent_id = 0,
int  $obj_copy_id = 0 
)
static

Definition at line 617 of file class.ilPCInteractiveImage.php.

References $DIC, ilPageContent\$dom_util, $path, ilInternalLink\_extractInstOfTarget(), and ilInternalLink\_extractObjIdOfTarget().

623  : void {
624  global $DIC;
625 
626  $dom_util = $DIC->copage()->internal()->domain()->domUtil();
627  $path = "//InteractiveImage/MediaAlias";
628  $nodes = $dom_util->path($a_domdoc, $path);
629  foreach ($nodes as $node) {
630  $or_id = $node->getAttribute("OriginId");
631  $inst_id = ilInternalLink::_extractInstOfTarget($or_id);
632  $mob_id = ilInternalLink::_extractObjIdOfTarget($or_id);
633  if (!($inst_id > 0)) {
634  if ($mob_id > 0) {
635  $media_object = new ilObjMediaObject($mob_id);
636  $new_mob = $media_object->duplicate();
637  $node->setAttribute("OriginId", "il__mob_" . $new_mob->getId());
638  }
639  }
640  }
641  }
$path
Definition: ltiservices.php:32
global $DIC
Definition: feed.php:28
ILIAS COPage Dom DomUtil $dom_util
+ Here is the call graph for this function:

◆ init()

ilPCInteractiveImage::init ( )

Definition at line 39 of file class.ilPCInteractiveImage.php.

References $DIC, ILIAS\Repository\lng(), ilPageContent\setType(), and ILIAS\Repository\ui().

39  : void
40  {
41  global $DIC;
42 
43  $this->lng = $DIC->language();
44  $this->setType("iim");
45  $this->manager = $DIC->copage()->internal()->domain()->pc()->interactiveImage();
46  $this->htmlTransform = $DIC->copage()->internal()->domain()->htmlTransformUtil();
47  $this->ui = $DIC->copage()->internal()->gui()->ui();
48  }
setType(string $a_type)
Set Type.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCInteractiveImage::modifyPageContentPostXsl ( string  $a_output,
string  $a_mode,
bool  $a_abstract_only = false 
)

Definition at line 759 of file class.ilPCInteractiveImage.php.

References $htmlTransform, $params, ilPageObjectGUI\EDIT, and ILIAS\Repository\ui().

763  : string {
764  $keep_original = false;
765  if (in_array($a_mode, [ilPageObjectGUI::EDIT], true)) {
766  $keep_original = true;
767  }
768  $trans = $this->htmlTransform;
769  while (!is_null($params = $trans->getPlaceholderParams($a_output, "InteractiveImage;PopupStart"))) {
770  $params = $trans->getPlaceholderParams($a_output, "InteractiveImage;PopupStart");
771  $par_page = $params[2] ?? 0;
772  $par_pop_nr = $params[4] ?? 0;
773  $inner = $trans->getInnerContentOfPlaceholders(
774  $a_output,
775  "InteractiveImage;PopupStart",
776  "InteractiveImage;PopupEnd"
777  );
778  if ($keep_original) {
779  $new_inner = $inner;
780  } else {
781  $pop = $this->ui->factory()->popover()->standard(
782  $this->ui->factory()->legacy("#####popovercontent#####")
783  );
784  $signal_id = $pop->getShowSignal()->getId();
785  //$new_inner = $this->ui->renderer()->render($pop);
786  $new_inner = "#####popovercontent#####";
787  // we need a position relative around the absolute inner div, to make 100% the current available space
788  $new_inner = str_replace(
789  "#####popovercontent#####",
790  "<div style='position:relative'><div class='copg-iim-popup copg-iim-popup-md' style='display:none;' data-copg-cont-type='iim-popup' data-signal-id='$signal_id' data-copg-page='$par_page' data-copg-popup-nr='$par_pop_nr'>" . $inner . "</div></div>",
791  $new_inner
792  );
793  }
794  $html = $trans->replaceInnerContentAndPlaceholders(
795  $a_output,
796  "InteractiveImage;PopupStart",
797  "InteractiveImage;PopupEnd",
798  $new_inner
799  );
800  if (is_null($html)) {
801  break;
802  } else {
803  $a_output = $html;
804  }
805  }
806  return $a_output .
807 '<script type="module" src="./Services/COPage/PC/InteractiveImage/js/presentation/src/presentation.js"></script>';
808  }
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:33
ILIAS COPage Html TransformUtil $htmlTransform
+ Here is the call graph for this function:

◆ readMediaObject()

ilPCInteractiveImage::readMediaObject ( int  $a_mob_id = 0)

Definition at line 50 of file class.ilPCInteractiveImage.php.

References setMediaObject().

50  : void
51  {
52  if ($a_mob_id > 0) {
53  $mob = new ilObjMediaObject($a_mob_id);
54  $this->setMediaObject($mob);
55  }
56  }
setMediaObject(ilObjMediaObject $a_mediaobject)
+ Here is the call graph for this function:

◆ saveContentPopupTitle()

ilPCInteractiveImage::saveContentPopupTitle ( string  $nr,
string  $title 
)

Definition at line 245 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c.

245  : void
246  {
247  foreach ($this->iim_node->childNodes as $c) {
248  if ($c->nodeName === "ContentPopup") {
249  if ($nr === $c->getAttribute("Nr")) {
250  $c->setAttribute("Title", $title);
251  }
252  }
253  }
254  }

◆ savePopups()

ilPCInteractiveImage::savePopups ( array  $a_popups)

Save popups.

Definition at line 216 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c, and ilPageContent\$hier_id.

216  : void
217  {
218  foreach ($this->iim_node->childNodes as $c) {
219  if ($c->nodeName == "ContentPopup") {
220  $pc_id = $c->getAttribute("PCID");
221  $hier_id = $c->getAttribute("HierId");
222  $k = $hier_id . ":" . $pc_id;
223  $c->setAttribute("Title", $a_popups[$k]);
224  }
225  }
226  }

◆ setDomNode()

ilPCInteractiveImage::setDomNode ( DOMNode  $dom_node)

Definition at line 58 of file class.ilPCInteractiveImage.php.

References $id, ilInternalLink\_extractObjIdOfTarget(), ilPageContent\getDomDoc(), ILIAS\Repository\object(), ilPageContent\readHierId(), ilPageContent\readPCId(), and setMediaObject().

Referenced by createAlias().

58  : void
59  {
60  parent::setDomNode($dom_node); // this is the PageContent node
61  $this->iim_node = $dom_node->firstChild;
62  if (isset($this->iim_node)) {
63  $this->med_alias_node = $this->iim_node->firstChild;
64  }
65  if (isset($this->med_alias_node)) {
66  $id = $this->med_alias_node->getAttribute("OriginId");
68  if ($this->object->getTypeForObjId($mob_id) == "mob") {
69  $this->setMediaObject(new ilObjMediaObject($mob_id));
70  }
71  }
72  $this->std_alias_item = new ilMediaAliasItem(
73  $this->getDomDoc(),
74  $this->readHierId(),
75  "Standard",
76  $this->readPCId(),
77  "InteractiveImage"
78  );
79  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setMediaObject(ilObjMediaObject $a_mediaobject)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setExtLinkTitle()

ilPCInteractiveImage::setExtLinkTitle ( int  $a_nr,
string  $a_title 
)

Definition at line 597 of file class.ilPCInteractiveImage.php.

References $path, $res, and ilPageContent\getPCId().

Referenced by setTriggerTitles().

600  : void {
601  if ($this->getPCId() != "") {
602  $path = "//PageContent[@PCID = '" . $this->getPCId() . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
603  $res = $this->dom_util->path($this->dom_doc, $path);
604  if (count($res) > 0) {
605  $this->dom_util->setContent($res->item(0), $a_title);
606  }
607  return;
608  }
609 
610  $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
611  $res = $this->dom_util->path($this->dom_doc, $path);
612  if (count($res) > 0) {
613  $this->dom_util->setContent($res->item(0), $a_title);
614  }
615  }
$res
Definition: ltiservices.php:69
$path
Definition: ltiservices.php:32
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMapAreaProperties()

ilPCInteractiveImage::setMapAreaProperties ( ilMediaAliasItem  $a_alias_item,
string  $a_shape_type,
string  $a_coords,
string  $a_title,
string  $a_id,
string  $hl_mode = "",
string  $hl_class = "" 
)
protected

Definition at line 278 of file class.ilPCInteractiveImage.php.

References ilMediaAliasItem\addMapArea(), ilMediaAliasItem\deleteMapAreaById(), IL_EXT_LINK, and ilUtil\stripSlashes().

Referenced by addTriggerArea(), and setTriggerProperties().

286  : void {
287  $link = array(
288  "LinkType" => IL_EXT_LINK,
289  "Href" => ilUtil::stripSlashes("#")
290  );
291 
292  $a_alias_item->deleteMapAreaById($a_id);
293  $a_alias_item->addMapArea(
294  $a_shape_type,
295  $a_coords,
296  ilUtil::stripSlashes($a_title),
297  $link,
298  $a_id,
299  $hl_mode,
300  $hl_class
301  );
302  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
const IL_EXT_LINK
addMapArea(string $a_shape_type, string $a_coords, string $a_title, array $a_link, string $a_id="", string $hl_mode="", string $hl_class="",)
Add a new area to the map.
deleteMapAreaById(string $a_id)
Delete map areas by id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMediaObject()

ilPCInteractiveImage::setMediaObject ( ilObjMediaObject  $a_mediaobject)

Definition at line 81 of file class.ilPCInteractiveImage.php.

Referenced by createFromMobId(), createMediaObject(), readMediaObject(), and setDomNode().

81  : void
82  {
83  $this->mediaobject = $a_mediaobject;
84  }
+ Here is the caller graph for this function:

◆ setTriggerMarkerPositions()

ilPCInteractiveImage::setTriggerMarkerPositions ( array  $a_pos)

Set trigger marker position.

Parameters
array$a_posarray of strings (representing the marker positions for the trigger)

Definition at line 510 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

512  : void {
513  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
514  foreach ($tr_nodes as $tr_node) {
515  if ($tr_node->getAttribute("Type") == self::MARKER) {
516  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
517  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
518  $tr_node->setAttribute("MarkerX", (int) $pos[0]);
519  $tr_node->setAttribute("MarkerY", (int) $pos[1]);
520  }
521  }
522  }
523  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerOverlay()

ilPCInteractiveImage::setTriggerOverlay ( string  $nr,
string  $overlay,
string  $coords 
)

Definition at line 736 of file class.ilPCInteractiveImage.php.

References Vendor\Package\$c, getTriggerNode(), and ILIAS\Repository\int().

736  : void
737  {
738  $tr_node = $this->getTriggerNode($nr);
739  if ($tr_node) {
740  $c = explode(",", $coords);
741  $x = (int) ($c[0] ?? 0);
742  $y = (int) ($c[1] ?? 0);
743  $tr_node->setAttribute("Overlay", $overlay);
744  $tr_node->setAttribute("OverlayX", $x);
745  $tr_node->setAttribute("OverlayY", $y);
746  }
747  }
+ Here is the call graph for this function:

◆ setTriggerOverlayPositions()

ilPCInteractiveImage::setTriggerOverlayPositions ( array  $a_pos)

Set trigger overlay position.

Parameters
array$a_posarray of strings (representing the overlays for the trigger)

Definition at line 493 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

495  : void {
496  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
497  foreach ($tr_nodes as $tr_node) {
498  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
499  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
500  $tr_node->setAttribute("OverlayX", (int) $pos[0]);
501  $tr_node->setAttribute("OverlayY", (int) $pos[1]);
502  }
503  }
504  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerOverlays()

ilPCInteractiveImage::setTriggerOverlays ( array  $a_ovs)

Set trigger overlays.

Parameters
array$a_ovsarray of strings (representing the overlays for the trigger)

Definition at line 462 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

464  : void {
465  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
466  foreach ($tr_nodes as $tr_node) {
467  if (isset($a_ovs["" . $tr_node->getAttribute("Nr")])) {
468  $tr_node->setAttribute(
469  "Overlay",
470  $a_ovs["" . $tr_node->getAttribute("Nr")]
471  );
472  }
473  }
474  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerPopup()

ilPCInteractiveImage::setTriggerPopup ( string  $nr,
string  $popup,
string  $position,
string  $size 
)

Definition at line 749 of file class.ilPCInteractiveImage.php.

References getTriggerNode().

749  : void
750  {
751  $tr_node = $this->getTriggerNode($nr);
752  if ($tr_node) {
753  $tr_node->setAttribute("PopupNr", $popup);
754  $tr_node->setAttribute("PopupPosition", $position);
755  $tr_node->setAttribute("PopupSize", $size);
756  }
757  }
+ Here is the call graph for this function:

◆ setTriggerPopupPositions()

ilPCInteractiveImage::setTriggerPopupPositions ( array  $a_pos)

Set trigger popup position.

Parameters
array$a_posarray of strings (representing the popup positions for the trigger)

Definition at line 529 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

531  : void {
532  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
533  foreach ($tr_nodes as $tr_node) {
534  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
535  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
536  $tr_node->setAttribute("PopupX", (int) $pos[0]);
537  $tr_node->setAttribute("PopupY", (int) $pos[1]);
538  }
539  }
540  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerPopups()

ilPCInteractiveImage::setTriggerPopups ( array  $a_pops)

Set trigger popups.

Parameters
array$a_popsarray of strings (representing the popups for the trigger)

Definition at line 563 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

565  : void {
566  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
567  foreach ($tr_nodes as $tr_node) {
568  if (isset($a_pops[(string) $tr_node->getAttribute("Nr")])) {
569  $pop = $a_pops[(string) $tr_node->getAttribute("Nr")];
570  $tr_node->setAttribute("PopupNr", $pop);
571  }
572  }
573  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerPopupSize()

ilPCInteractiveImage::setTriggerPopupSize ( array  $a_size)

Set trigger popup size.

Parameters
array$a_sizearray of strings (representing the popup sizes for the trigger)

Definition at line 546 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), and getTriggerNodes().

548  : void {
549  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
550  foreach ($tr_nodes as $tr_node) {
551  if (isset($a_size["" . $tr_node->getAttribute("Nr")])) {
552  $size = explode(",", $a_size["" . $tr_node->getAttribute("Nr")]);
553  $tr_node->setAttribute("PopupWidth", (int) $size[0]);
554  $tr_node->setAttribute("PopupHeight", (int) $size[1]);
555  }
556  }
557  }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

◆ setTriggerProperties()

ilPCInteractiveImage::setTriggerProperties ( string  $nr,
string  $title,
string  $shape_type,
string  $coords,
string  $hl_mode = "",
string  $hl_class = "" 
)

Definition at line 675 of file class.ilPCInteractiveImage.php.

References $path, $res, addTriggerArea(), addTriggerMarker(), getStandardAliasItem(), getTriggerNode(), setMapAreaProperties(), and ilUtil\stripSlashes().

675  : void
676  {
677  $tr_node = $this->getTriggerNode($nr);
678 
679  if ($shape_type === "Marker") {
680 
681  if (!$tr_node) {
682  $this->addTriggerMarker(
683  ilUtil::stripSlashes($title),
684  $coords
685  );
686  } else {
687  // set marker properties
688  $tr_node->setAttribute("Type", "Marker");
689  $tr_node->setAttribute(
690  "Title",
691  $title
692  );
693  $coord_parts = explode(",", $coords);
694  $tr_node->setAttribute("MarkerX", ($coord_parts[0] ?? "0"));
695  $tr_node->setAttribute("MarkerY", ($coord_parts[1] ?? "0"));
696 
697  // remove area
698  $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $nr . "']";
699  $res = $this->dom_util->path($this->dom_doc, $path);
700  if ($child = $res->item(0)) {
701  $child->parentNode->removeChild($child);
702  }
703  }
704  return;
705  }
706 
707  if ($tr_node) {
708  $tr_node->setAttribute("Type", "Area");
709  $tr_node->removeAttribute("MarkerX");
710  $tr_node->removeAttribute("MarkerY");
711  $tr_node->setAttribute(
712  "Title",
713  ilUtil::stripSlashes($title),
714  );
715  $this->setMapAreaProperties(
716  $this->getStandardAliasItem(),
717  $shape_type,
718  $coords,
719  ilUtil::stripSlashes($title),
720  $nr,
721  $hl_mode,
722  $hl_class
723  );
724  } else {
725  $this->addTriggerArea(
726  $this->getStandardAliasItem(),
727  $shape_type,
728  $coords,
729  $title,
730  $hl_mode,
731  $hl_class
732  );
733  }
734  }
$res
Definition: ltiservices.php:69
setMapAreaProperties(ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title, string $a_id, string $hl_mode="", string $hl_class="")
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$path
Definition: ltiservices.php:32
addTriggerArea(ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title, string $hl_mode="", string $hl_class="")
Add a new trigger.
addTriggerMarker(string $title="", string $coords="")
Add a new trigger marker.
+ Here is the call graph for this function:

◆ setTriggerTitles()

ilPCInteractiveImage::setTriggerTitles ( array  $a_titles)

Set trigger titles.

Parameters
array$a_titlesarray of strings (representing the titles for the trigger)

Definition at line 579 of file class.ilPCInteractiveImage.php.

References ilPageContent\getPCId(), getTriggerNodes(), and setExtLinkTitle().

581  : void {
582  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
583  foreach ($tr_nodes as $tr_node) {
584  if (isset($a_titles[(string) $tr_node->getAttribute("Nr")])) {
585  $tr_node->setAttribute(
586  "Title",
587  $a_titles[(string) $tr_node->getAttribute("Nr")]
588  );
589  $this->setExtLinkTitle(
590  $tr_node->getAttribute("Nr"),
591  $a_titles[(string) $tr_node->getAttribute("Nr")]
592  );
593  }
594  }
595  }
setExtLinkTitle(int $a_nr, string $a_title)
getTriggerNodes(string $a_hier_id, string $a_pc_id="")
+ Here is the call graph for this function:

Field Documentation

◆ $htmlTransform

ILIAS COPage Html TransformUtil ilPCInteractiveImage::$htmlTransform
protected

Definition at line 31 of file class.ilPCInteractiveImage.php.

Referenced by modifyPageContentPostXsl().

◆ $iim_node

DOMNode ilPCInteractiveImage::$iim_node

Definition at line 37 of file class.ilPCInteractiveImage.php.

◆ $lng

ilLanguage ilPCInteractiveImage::$lng
protected

Definition at line 36 of file class.ilPCInteractiveImage.php.

Referenced by addContentPopup(), and addTriggerMarker().

◆ $mal_node

DOMNode ilPCInteractiveImage::$mal_node
protected

Definition at line 28 of file class.ilPCInteractiveImage.php.

◆ $manager

ILIAS COPage PC InteractiveImage IIMManager ilPCInteractiveImage::$manager
protected

Definition at line 32 of file class.ilPCInteractiveImage.php.

◆ $med_alias_node

DOMNode ilPCInteractiveImage::$med_alias_node
protected

Definition at line 29 of file class.ilPCInteractiveImage.php.

◆ $mediaobject

ilObjMediaObject ilPCInteractiveImage::$mediaobject
protected

Definition at line 35 of file class.ilPCInteractiveImage.php.

Referenced by getMediaObject().

◆ $std_alias_item

ilMediaAliasItem ilPCInteractiveImage::$std_alias_item
protected

Definition at line 34 of file class.ilPCInteractiveImage.php.

Referenced by getStandardAliasItem().

◆ $ui

ILIAS DI UIServices ilPCInteractiveImage::$ui
protected

Definition at line 30 of file class.ilPCInteractiveImage.php.

◆ AREA

const ilPCInteractiveImage::AREA = "Area"

Definition at line 26 of file class.ilPCInteractiveImage.php.

◆ MARKER

const ilPCInteractiveImage::MARKER = "Marker"

Definition at line 27 of file class.ilPCInteractiveImage.php.


The documentation for this class was generated from the following file: