ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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

ILIAS MediaObjects Thumbs ThumbsManager $thumbs
 
ILIAS COPage Xsl XslManager $xsl
 
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 173 of file class.ilPCInteractiveImage.php.

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

173  : void
174  {
175  $lng = $this->lng;
176 
177  if ($title === null) {
178  $title = $lng->txt("cont_new_popup");
179  }
180  $max = 0;
181  $popups = $this->getPopups();
182  foreach ($popups as $p) {
183  $max = max($max, (int) $p["nr"]);
184  }
185 
186  $new_item = $this->dom_doc->createElement("ContentPopup");
187  $new_item->setAttribute("Title", $title);
188  $new_item->setAttribute("Nr", $max + 1);
189  $new_item = $this->iim_node->appendChild($new_item);
190  }
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...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 311 of file class.ilPCInteractiveImage.php.

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

Referenced by setTriggerProperties().

318  : void {
319  $max = 0;
320  $triggers = $this->getTriggers();
321  foreach ($triggers as $t) {
322  $max = max($max, (int) $t["Nr"]);
323  }
324 
325  $this->setMapAreaProperties(
326  $a_alias_item,
327  $a_shape_type,
328  $a_coords,
329  ilUtil::stripSlashes($a_title),
330  (string) ($max + 1),
331  $hl_mode,
332  $hl_class
333  );
334 
335  $attributes = array("Type" => self::AREA,
336  "Title" => ilUtil::stripSlashes($a_title),
337  "Nr" => $max + 1,
338  "OverlayX" => "0",
339  "OverlayY" => "0",
340  "Overlay" => "",
341  "PopupNr" => "",
342  "PopupX" => "0",
343  "PopupY" => "0",
344  "PopupWidth" => "150",
345  "PopupHeight" => "200"
346  );
347  $ma_node = $this->dom_util->addElementToList(
348  $this->iim_node,
349  "Trigger",
350  array("ContentPopup"),
351  "",
352  $attributes
353  );
354  }
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 359 of file class.ilPCInteractiveImage.php.

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

Referenced by setTriggerProperties().

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

References ilPageContent\createPageContentNode().

100  : void
101  {
102  $this->createPageContentNode();
103  }
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 120 of file class.ilPCInteractiveImage.php.

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

Referenced by createFromMobId().

124  : void {
125  $this->setDomNode($this->dom_doc->createElement("PageContent"));
126  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
127  $this->iim_node = $this->dom_doc->createElement("InteractiveImage");
128  $this->iim_node = $this->getDomNode()->appendChild($this->iim_node);
129  $this->mal_node = $this->dom_doc->createElement("MediaAlias");
130  $this->mal_node = $this->iim_node->appendChild($this->mal_node);
131  $this->mal_node->setAttribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
132 
133  // standard view
134  $item_node = $this->dom_doc->createElement("MediaAliasItem");
135  $item_node = $this->iim_node->appendChild($item_node);
136  $item_node->setAttribute("Purpose", "Standard");
137  $media_item = $this->getMediaObject()->getMediaItem("Standard");
138 
139  $layout_node = $this->dom_doc->createElement("Layout");
140  $layout_node = $item_node->appendChild($layout_node);
141  $layout_node->setAttribute("HorizontalAlign", "Left");
142 
143  // caption
144  if ($media_item->getCaption() != "") {
145  $cap_node = $this->dom_doc->createElement("Caption");
146  $cap_node = $item_node->appendChild($cap_node);
147  $cap_node->setAttribute("Align", "bottom");
148  $this->dom_util->setContent($cap_node, $media_item->getCaption());
149  }
150 
151  // text representation
152  if ($media_item->getTextRepresentation() != "") {
153  $tr_node = $this->dom_doc->createElement("TextRepresentation");
154  $tr_node = $item_node->appendChild($tr_node);
155  $this->dom_util->setContent($tr_node, $media_item->getTextRepresentation());
156  }
157  }
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 649 of file class.ilPCInteractiveImage.php.

References createAlias(), and setMediaObject().

654  : void {
655  $this->setMediaObject(new ilObjMediaObject($mob_id));
656  $this->createAlias($page, $hier_id, $pc_id);
657  }
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 95 of file class.ilPCInteractiveImage.php.

References setMediaObject().

95  : void
96  {
97  $this->setMediaObject(new ilObjMediaObject());
98  }
setMediaObject(ilObjMediaObject $a_mediaobject)
+ Here is the call graph for this function:

◆ deleteOverlay()

ilPCInteractiveImage::deleteOverlay ( string  $file)

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

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

480  : void
481  {
482  $file = str_replace("..", "", ilUtil::stripSlashes($file));
483  $this->getMediaObject()
484  ->removeAdditionalFile("overlays/" . $file);
485  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
486  for ($i = 0; $i < count($tr_nodes); $i++) {
487  $tr_node = $tr_nodes[$i];
488  if ($tr_node->getAttribute("Overlay") === $file) {
489  $tr_node->removeAttribute("Overlay");
490  }
491  }
492  }
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 235 of file class.ilPCInteractiveImage.php.

References $c.

238  : void {
239  foreach ($this->iim_node->childNodes as $c) {
240  if ($c->nodeName === "ContentPopup") {
241  if ($a_pc_id == $c->getAttribute("PCID") &&
242  $a_hier_id == $c->getAttribute("HierId")) {
243  $c->parentNode->removeChild($c);
244  }
245  }
246  }
247  }
$c
Definition: deliver.php:25

◆ deletePopupByNr()

ilPCInteractiveImage::deletePopupByNr ( string  $nr)

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

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

262  : void {
263  foreach ($this->iim_node->childNodes as $c) {
264  if ($c->nodeName === "ContentPopup") {
265  if ($nr === $c->getAttribute("Nr")) {
266  $c->parentNode->removeChild($c);
267  }
268  }
269  }
270  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
271  foreach ($tr_nodes as $tr_node) {
272  if ($tr_node->getAttribute("PopupNr") === $nr) {
273  $tr_node->removeAttribute("PopupNr");
274  }
275  }
276  }
$c
Definition: deliver.php:25
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 448 of file class.ilPCInteractiveImage.php.

References $c, and ilMediaAliasItem\deleteMapAreaById().

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

◆ dumpXML()

ilPCInteractiveImage::dumpXML ( )

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

References ilPageContent\getDomNode().

159  : string
160  {
161  $xml = $this->dom_util->dump($this->getDomNode());
162  return $xml;
163  }
+ Here is the call graph for this function:

◆ getBackgroundImage()

ilPCInteractiveImage::getBackgroundImage ( )

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

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

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

829  : string
830  {
831  $mob = $this->getMediaObject();
832 
833  // output image map
834  $xml = "<dummy>";
835  $xml .= $mob->getXML(IL_MODE_ALIAS);
836  $xml .= $mob->getXML(IL_MODE_OUTPUT);
837  $xml .= "</dummy>";
838  $wb_path = \ilFileUtils::getWebspaceDir("output") . "/";
839  $params = array(
840  'media_mode' => 'enable',
841  'pg_frame' => "",
842  'enlarge_path' => \ilUtil::getImagePath("enlarge.svg"),
843  'webspace_path' => $wb_path);
844 
845  $output = $this->xsl->process($xml, $params);
846  return $output;
847  }
static getWebspaceDir(string $mode="filesystem")
get webspace directory
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
Definition: ltiregstart.php:31
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
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 115 of file class.ilPCInteractiveImage.php.

References ILIAS\Survey\Mode\getId(), and getMediaObject().

115  : string
116  {
117  return $this->thumbs->getThumbSrc($this->getMediaObject()->getId());
118  }
+ Here is the call graph for this function:

◆ getIIMModel()

ilPCInteractiveImage::getIIMModel ( )

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

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

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

659  : ?stdClass
660  {
661  $alias_item = $this->getStandardAliasItem();
662  $model = new \stdClass();
663  $model->triggers = $this->getTriggers();
664  $model->popups = $this->getPopups();
665  $model->media_item = $alias_item->getModel();
666  $model->overlays = $this->manager->getOverlays($this->getMediaObject());
667  return $model;
668  }
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 90 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 817 of file class.ilPCInteractiveImage.php.

817  : string
818  {
819  $content = <<<EOT
820 <div style='position:relative'><div class='copg-iim-popup copg-iim-popup-md' data-copg-cont-type='iim-popup'>
821 <div class="ilc_iim_ContentPopup" data-copg-iim-data-type="popup"><div class="ilc_Paragraph ilc_text_block_Standard">
822 ###content###
823 </div></div></div></div>
824 
825 EOT;
826  return $content;
827  }

◆ getPopups()

ilPCInteractiveImage::getPopups ( )

Get popup captions.

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

References $c, and ilPageContent\$hier_id.

Referenced by addContentPopup(), and getIIMModel().

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

◆ getStandardAliasItem()

ilPCInteractiveImage::getStandardAliasItem ( )

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

References $std_alias_item.

Referenced by getIIMModel(), and setTriggerProperties().

111  {
112  return $this->std_alias_item;
113  }
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 105 of file class.ilPCInteractiveImage.php.

References getMediaObject().

105  : ilMediaItem
106  {
107  return $this->getMediaObject()->getMediaItem("Standard");
108  }
Class ilMediaItem Media Item, component of a media object (file or reference)
+ Here is the call graph for this function:

◆ getTriggerNode()

ilPCInteractiveImage::getTriggerNode ( string  $nr)
protected

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

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

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

671  {
672  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
673  for ($i = 0; $i < count($tr_nodes); $i++) {
674  $tr_node = $tr_nodes[$i];
675  if ($tr_node->getAttribute("Nr") == $nr) {
676  return $tr_node;
677  }
678  }
679  return null;
680  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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 404 of file class.ilPCInteractiveImage.php.

References $path.

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

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

◆ getTriggers()

ilPCInteractiveImage::getTriggers ( )

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

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

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

417  : array
418  {
419  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
420  $trigger_arr = array();
421  foreach ($tr_nodes as $tr_node) {
422  $childs = $tr_node->childNodes;
423  $trigger_arr[] = array(
424  "Nr" => $tr_node->getAttribute("Nr"),
425  "Type" => $tr_node->getAttribute("Type"),
426  "Title" => $tr_node->getAttribute("Title"),
427  "OverlayX" => $tr_node->getAttribute("OverlayX"),
428  "OverlayY" => $tr_node->getAttribute("OverlayY"),
429  "MarkerX" => $tr_node->getAttribute("MarkerX"),
430  "MarkerY" => $tr_node->getAttribute("MarkerY"),
431  "Overlay" => $tr_node->getAttribute("Overlay"),
432  "PopupNr" => $tr_node->getAttribute("PopupNr"),
433  "PopupX" => $tr_node->getAttribute("PopupX"),
434  "PopupY" => $tr_node->getAttribute("PopupY"),
435  "PopupWidth" => $tr_node->getAttribute("PopupWidth"),
436  "PopupHeight" => $tr_node->getAttribute("PopupHeight"),
437  "PopupPosition" => $tr_node->getAttribute("PopupPosition"),
438  "PopupSize" => $tr_node->getAttribute("PopupSize")
439  );
440  }
441 
442  return $trigger_arr;
443  }
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 623 of file class.ilPCInteractiveImage.php.

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

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

◆ init()

ilPCInteractiveImage::init ( )

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

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

41  : void
42  {
43  global $DIC;
44 
45  $this->lng = $DIC->language();
46  $this->setType("iim");
47  $this->manager = $DIC->copage()->internal()->domain()->pc()->interactiveImage();
48  $this->htmlTransform = $DIC->copage()->internal()->domain()->htmlTransformUtil();
49  $this->ui = $DIC->copage()->internal()->gui()->ui();
50  $this->xsl = $DIC->copage()->internal()->domain()->xsl();
51  $this->thumbs = $DIC->mediaObjects()->internal()->domain()->thumbs();
52  }
setType(string $a_type)
Set Type.
global $DIC
Definition: shib_login.php:26
+ 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 766 of file class.ilPCInteractiveImage.php.

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

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

◆ readMediaObject()

ilPCInteractiveImage::readMediaObject ( int  $a_mob_id = 0)

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

References setMediaObject().

54  : void
55  {
56  if ($a_mob_id > 0) {
57  $mob = new ilObjMediaObject($a_mob_id);
58  $this->setMediaObject($mob);
59  }
60  }
setMediaObject(ilObjMediaObject $a_mediaobject)
+ Here is the call graph for this function:

◆ saveContentPopupTitle()

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

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

References $c.

249  : void
250  {
251  foreach ($this->iim_node->childNodes as $c) {
252  if ($c->nodeName === "ContentPopup") {
253  if ($nr === $c->getAttribute("Nr")) {
254  $c->setAttribute("Title", $title);
255  }
256  }
257  }
258  }
$c
Definition: deliver.php:25

◆ savePopups()

ilPCInteractiveImage::savePopups ( array  $a_popups)

Save popups.

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

References $c, and ilPageContent\$hier_id.

220  : void
221  {
222  foreach ($this->iim_node->childNodes as $c) {
223  if ($c->nodeName == "ContentPopup") {
224  $pc_id = $c->getAttribute("PCID");
225  $hier_id = $c->getAttribute("HierId");
226  $k = $hier_id . ":" . $pc_id;
227  $c->setAttribute("Title", $a_popups[$k]);
228  }
229  }
230  }
$c
Definition: deliver.php:25

◆ setDomNode()

ilPCInteractiveImage::setDomNode ( DOMNode  $dom_node)

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

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

Referenced by createAlias().

62  : void
63  {
64  parent::setDomNode($dom_node); // this is the PageContent node
65  $this->iim_node = $dom_node->firstChild;
66  if (isset($this->iim_node)) {
67  $this->med_alias_node = $this->iim_node->firstChild;
68  }
69  if (isset($this->med_alias_node)) {
70  $id = $this->med_alias_node->getAttribute("OriginId");
72  if ($this->object->getTypeForObjId($mob_id) == "mob") {
73  $this->setMediaObject(new ilObjMediaObject($mob_id));
74  }
75  }
76  $this->std_alias_item = new ilMediaAliasItem(
77  $this->getDomDoc(),
78  $this->readHierId(),
79  "Standard",
80  $this->readPCId(),
81  "InteractiveImage"
82  );
83  }
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 603 of file class.ilPCInteractiveImage.php.

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

Referenced by setTriggerTitles().

606  : void {
607  if ($this->getPCId() != "") {
608  $path = "//PageContent[@PCID = '" . $this->getPCId() . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
609  $res = $this->dom_util->path($this->dom_doc, $path);
610  if (count($res) > 0) {
611  $this->dom_util->setContent($res->item(0), $a_title);
612  }
613  return;
614  }
615 
616  $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
617  $res = $this->dom_util->path($this->dom_doc, $path);
618  if (count($res) > 0) {
619  $this->dom_util->setContent($res->item(0), $a_title);
620  }
621  }
$res
Definition: ltiservices.php:66
$path
Definition: ltiservices.php:29
+ 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 282 of file class.ilPCInteractiveImage.php.

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

Referenced by addTriggerArea(), and setTriggerProperties().

290  : void {
291  $link = array(
292  "LinkType" => IL_EXT_LINK,
293  "Href" => ilUtil::stripSlashes("#")
294  );
295 
296  $a_alias_item->deleteMapAreaById($a_id);
297  $a_alias_item->addMapArea(
298  $a_shape_type,
299  $a_coords,
300  ilUtil::stripSlashes($a_title),
301  $link,
302  $a_id,
303  $hl_mode,
304  $hl_class
305  );
306  }
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 85 of file class.ilPCInteractiveImage.php.

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

85  : void
86  {
87  $this->mediaobject = $a_mediaobject;
88  }
+ 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 516 of file class.ilPCInteractiveImage.php.

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

518  : void {
519  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
520  foreach ($tr_nodes as $tr_node) {
521  if ($tr_node->getAttribute("Type") == self::MARKER) {
522  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
523  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
524  $tr_node->setAttribute("MarkerX", (int) $pos[0]);
525  $tr_node->setAttribute("MarkerY", (int) $pos[1]);
526  }
527  }
528  }
529  }
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 743 of file class.ilPCInteractiveImage.php.

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

743  : void
744  {
745  $tr_node = $this->getTriggerNode($nr);
746  if ($tr_node) {
747  $c = explode(",", $coords);
748  $x = (int) ($c[0] ?? 0);
749  $y = (int) ($c[1] ?? 0);
750  $tr_node->setAttribute("Overlay", $overlay);
751  $tr_node->setAttribute("OverlayX", $x);
752  $tr_node->setAttribute("OverlayY", $y);
753  }
754  }
$c
Definition: deliver.php:25
+ 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 498 of file class.ilPCInteractiveImage.php.

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

500  : void {
501  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
502  for ($i = 0; $i < count($tr_nodes); $i++) {
503  $tr_node = $tr_nodes[$i];
504  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
505  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
506  $tr_node->setAttribute("OverlayX", (int) $pos[0]);
507  $tr_node->setAttribute("OverlayY", (int) $pos[1]);
508  }
509  }
510  }
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 466 of file class.ilPCInteractiveImage.php.

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

468  : void {
469  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
470  foreach ($tr_nodes as $tr_node) {
471  if (isset($a_ovs["" . $tr_node->getAttribute("Nr")])) {
472  $tr_node->setAttribute(
473  "Overlay",
474  $a_ovs["" . $tr_node->getAttribute("Nr")]
475  );
476  }
477  }
478  }
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 756 of file class.ilPCInteractiveImage.php.

References getTriggerNode().

756  : void
757  {
758  $tr_node = $this->getTriggerNode($nr);
759  if ($tr_node) {
760  $tr_node->setAttribute("PopupNr", $popup);
761  $tr_node->setAttribute("PopupPosition", $position);
762  $tr_node->setAttribute("PopupSize", $size);
763  }
764  }
+ 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 535 of file class.ilPCInteractiveImage.php.

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

537  : void {
538  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
539  foreach ($tr_nodes as $tr_node) {
540  if (isset($a_pos["" . $tr_node->getAttribute("Nr")])) {
541  $pos = explode(",", $a_pos["" . $tr_node->getAttribute("Nr")]);
542  $tr_node->setAttribute("PopupX", (int) $pos[0]);
543  $tr_node->setAttribute("PopupY", (int) $pos[1]);
544  }
545  }
546  }
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 569 of file class.ilPCInteractiveImage.php.

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

571  : void {
572  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
573  foreach ($tr_nodes as $tr_node) {
574  if (isset($a_pops[(string) $tr_node->getAttribute("Nr")])) {
575  $pop = $a_pops[(string) $tr_node->getAttribute("Nr")];
576  $tr_node->setAttribute("PopupNr", $pop);
577  }
578  }
579  }
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 552 of file class.ilPCInteractiveImage.php.

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

554  : void {
555  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
556  foreach ($tr_nodes as $tr_node) {
557  if (isset($a_size["" . $tr_node->getAttribute("Nr")])) {
558  $size = explode(",", $a_size["" . $tr_node->getAttribute("Nr")]);
559  $tr_node->setAttribute("PopupWidth", (int) $size[0]);
560  $tr_node->setAttribute("PopupHeight", (int) $size[1]);
561  }
562  }
563  }
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 682 of file class.ilPCInteractiveImage.php.

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

682  : void
683  {
684  $tr_node = $this->getTriggerNode($nr);
685 
686  if ($shape_type === "Marker") {
687 
688  if (!$tr_node) {
689  $this->addTriggerMarker(
690  ilUtil::stripSlashes($title),
691  $coords
692  );
693  } else {
694  // set marker properties
695  $tr_node->setAttribute("Type", "Marker");
696  $tr_node->setAttribute(
697  "Title",
698  $title
699  );
700  $coord_parts = explode(",", $coords);
701  $tr_node->setAttribute("MarkerX", ($coord_parts[0] ?? "0"));
702  $tr_node->setAttribute("MarkerY", ($coord_parts[1] ?? "0"));
703 
704  // remove area
705  $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $nr . "']";
706  $res = $this->dom_util->path($this->dom_doc, $path);
707  if ($child = $res->item(0)) {
708  $child->parentNode->removeChild($child);
709  }
710  }
711  return;
712  }
713 
714  if ($tr_node) {
715  $tr_node->setAttribute("Type", "Area");
716  $tr_node->removeAttribute("MarkerX");
717  $tr_node->removeAttribute("MarkerY");
718  $tr_node->setAttribute(
719  "Title",
720  ilUtil::stripSlashes($title),
721  );
722  $this->setMapAreaProperties(
723  $this->getStandardAliasItem(),
724  $shape_type,
725  $coords,
726  ilUtil::stripSlashes($title),
727  $nr,
728  $hl_mode,
729  $hl_class
730  );
731  } else {
732  $this->addTriggerArea(
733  $this->getStandardAliasItem(),
734  $shape_type,
735  $coords,
736  $title,
737  $hl_mode,
738  $hl_class
739  );
740  }
741  }
$res
Definition: ltiservices.php:66
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:29
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 585 of file class.ilPCInteractiveImage.php.

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

587  : void {
588  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
589  foreach ($tr_nodes as $tr_node) {
590  if (isset($a_titles[(string) $tr_node->getAttribute("Nr")])) {
591  $tr_node->setAttribute(
592  "Title",
593  $a_titles[(string) $tr_node->getAttribute("Nr")]
594  );
595  $this->setExtLinkTitle(
596  $tr_node->getAttribute("Nr"),
597  $a_titles[(string) $tr_node->getAttribute("Nr")]
598  );
599  }
600  }
601  }
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 33 of file class.ilPCInteractiveImage.php.

Referenced by modifyPageContentPostXsl().

◆ $iim_node

DOMNode ilPCInteractiveImage::$iim_node

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

◆ $lng

ilLanguage ilPCInteractiveImage::$lng
protected

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

Referenced by addContentPopup(), and addTriggerMarker().

◆ $mal_node

DOMNode ilPCInteractiveImage::$mal_node
protected

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

◆ $manager

ILIAS COPage PC InteractiveImage IIMManager ilPCInteractiveImage::$manager
protected

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

◆ $med_alias_node

DOMNode ilPCInteractiveImage::$med_alias_node
protected

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

◆ $mediaobject

ilObjMediaObject ilPCInteractiveImage::$mediaobject
protected

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

Referenced by getMediaObject().

◆ $std_alias_item

ilMediaAliasItem ilPCInteractiveImage::$std_alias_item
protected

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

Referenced by getStandardAliasItem().

◆ $thumbs

ILIAS MediaObjects Thumbs ThumbsManager ilPCInteractiveImage::$thumbs
protected

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

◆ $ui

ILIAS DI UIServices ilPCInteractiveImage::$ui
protected

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

◆ $xsl

ILIAS COPage Xsl XslManager ilPCInteractiveImage::$xsl
protected

Definition at line 29 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: