ILIAS  release_8 Revision v8.24
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 ()
 Init object. More...
 
 readMediaObject (int $a_mob_id=0)
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 setDom (php4DOMDocument $a_dom)
 
 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 ()
 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...
 
 addTriggerArea (ilMediaAliasItem $a_alias_item, string $a_shape_type, string $a_coords, string $a_title)
 Add a new trigger. More...
 
 addTriggerMarker ()
 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...
 
 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)
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 setNode (php4DOMElement $a_node)
 Set xml node of page content. More...
 
 getNode ()
 
 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...
 
 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...
 

Data Fields

const AREA = "Area"
 
const MARKER = "Marker"
 
php4DOMElement $iim_node
 
- Data Fields inherited from ilPageContent
string $hier_id = ""
 
php4DOMElement $node = null
 
php4DOMDocument $dom = null
 
string $page_lang = ""
 

Protected Attributes

php4DOMElement $mal_node
 
php4DOMElement $med_alias_node
 
ilMediaAliasItem $std_alias_item
 
ilObjMediaObject $mediaobject
 
ilLanguage $lng
 
- Protected Attributes inherited from ilPageContent
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link
 
string $fullscreen_link
 
string $sourcecode_download_script
 
ilLogger $log
 
string $profile_back_url = ""
 

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static incEdId (string $ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId (string $ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
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...
 
- Protected Member Functions inherited from ilPageContent
 setType (string $a_type)
 Set Type. More...
 

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 ( )

Add a tab.

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

176 : void
177 {
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->create_element("ContentPopup");
187 $new_item->set_attribute("Title", $lng->txt("cont_new_popup"));
188 $new_item->set_attribute("Nr", $max + 1);
189 $new_item = $this->iim_node->append_child($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...

References $lng.

◆ addTriggerArea()

ilPCInteractiveImage::addTriggerArea ( ilMediaAliasItem  $a_alias_item,
string  $a_shape_type,
string  $a_coords,
string  $a_title 
)

Add a new trigger.

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

263 : void {
264 $max = 0;
265 $triggers = $this->getTriggers();
266 foreach ($triggers as $t) {
267 $max = max($max, (int) $t["Nr"]);
268 }
269
270 $link = array(
271 "LinkType" => IL_EXT_LINK,
272 "Href" => ilUtil::stripSlashes("#"));
273
274 $a_alias_item->addMapArea(
275 $a_shape_type,
276 $a_coords,
277 ilUtil::stripSlashes($a_title),
278 $link,
279 $max + 1
280 );
281
282 $attributes = array("Type" => self::AREA,
283 "Title" => ilUtil::stripSlashes($a_title),
284 "Nr" => $max + 1,
285 "OverlayX" => "0", "OverlayY" => "0", "Overlay" => "", "PopupNr" => "",
286 "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
288 $this->dom,
289 $this->iim_node,
290 "Trigger",
291 array("ContentPopup"),
292 "",
294 );
295 }
const IL_EXT_LINK
static addElementToList(php4DOMDocument $doc, php4DOMElement $parent_node, string $a_node_name, array $a_successors, string $a_content, array $a_attributes)
Places a new node $a_node_name directly before nodes with names of $a_successors.
addMapArea(string $a_shape_type, string $a_coords, string $a_title, array $a_link, string $a_id="")
Add a new area to the map.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
$attributes
Definition: metadata.php:248

◆ addTriggerMarker()

ilPCInteractiveImage::addTriggerMarker ( )

Add a new trigger marker.

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

300 : void
301 {
303
304 $max = 0;
305 $triggers = $this->getTriggers();
306 foreach ($triggers as $t) {
307 $max = max($max, (int) $t["Nr"]);
308 }
309
310 $attributes = array("Type" => self::MARKER,
311 "Title" => $lng->txt("cont_new_marker"),
312 "Nr" => $max + 1, "OverlayX" => "0", "OverlayY" => "0",
313 "MarkerX" => "0", "MarkerY" => "0", "PopupNr" => "",
314 "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
316 $this->dom,
317 $this->iim_node,
318 "Trigger",
319 array("ContentPopup"),
320 "",
322 );
323 }

References $attributes, $lng, and ilDOMUtil\addElementToList().

+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImage::create ( )

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

95 : void
96 {
97 $this->node = $this->createPageContentNode();
98 }
createPageContentNode(bool $a_set_this_node=true)
Create page content node (always use this method first when adding a new element)

References ilPageContent\createPageContentNode().

+ 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.

120 : void {
121 $this->node = $this->dom->create_element("PageContent");
122 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
123 $this->iim_node = $this->dom->create_element("InteractiveImage");
124 $this->iim_node = $this->node->append_child($this->iim_node);
125 $this->mal_node = $this->dom->create_element("MediaAlias");
126 $this->mal_node = $this->iim_node->append_child($this->mal_node);
127 $this->mal_node->set_attribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
128
129 // standard view
130 $item_node = $this->dom->create_element("MediaAliasItem");
131 $item_node = $this->iim_node->append_child($item_node);
132 $item_node->set_attribute("Purpose", "Standard");
133 $media_item = $this->getMediaObject()->getMediaItem("Standard");
134
135 $layout_node = $this->dom->create_element("Layout");
136 $layout_node = $item_node->append_child($layout_node);
137 if ($media_item->getWidth() > 0) {
138 //$layout_node->set_attribute("Width", $media_item->getWidth());
139 }
140 if ($media_item->getHeight() > 0) {
141 //$layout_node->set_attribute("Height", $media_item->getHeight());
142 }
143 $layout_node->set_attribute("HorizontalAlign", "Left");
144
145 // caption
146 if ($media_item->getCaption() != "") {
147 $cap_node = $this->dom->create_element("Caption");
148 $cap_node = $item_node->append_child($cap_node);
149 $cap_node->set_attribute("Align", "bottom");
150 $cap_node->set_content($media_item->getCaption());
151 }
152
153 // text representation
154 if ($media_item->getTextRepresentation() != "") {
155 $tr_node = $this->dom->create_element("TextRepresentation");
156 $tr_node = $item_node->append_child($tr_node);
157 $tr_node->set_content($media_item->getTextRepresentation());
158 }
159 }
const IL_INSERT_AFTER
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

◆ createMediaObject()

ilPCInteractiveImage::createMediaObject ( )

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

90 : void
91 {
92 $this->setMediaObject(new ilObjMediaObject());
93 }
setMediaObject(ilObjMediaObject $a_mediaobject)

References setMediaObject().

+ Here is the call graph for this function:

◆ deletePopup()

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

Delete popup.

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

237 : void {
238 // File Item
239 $childs = $this->iim_node->child_nodes();
240 $nodes = array();
241 for ($i = 0; $i < count($childs); $i++) {
242 if ($childs[$i]->node_name() == "ContentPopup") {
243 if ($a_pc_id == $childs[$i]->get_attribute("PCID") &&
244 $a_hier_id == $childs[$i]->get_attribute("HierId")) {
245 $childs[$i]->unlink($childs[$i]);
246 }
247 }
248 }
249 }
$i
Definition: metadata.php:41

◆ deleteTrigger()

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

Delete Trigger.

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

380 : void {
381 // File Item
382 $childs = $this->iim_node->child_nodes();
383 $nodes = array();
384 for ($i = 0; $i < count($childs); $i++) {
385 if ($childs[$i]->node_name() == "Trigger") {
386 if ($a_nr == $childs[$i]->get_attribute("Nr")) {
387 $childs[$i]->unlink($childs[$i]);
388 }
389 }
390 }
391 $a_alias_item->deleteMapAreaById($a_nr);
392 }
deleteMapAreaById(string $a_id)
Delete map areas by id.

◆ dumpXML()

ilPCInteractiveImage::dumpXML ( )

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

161 : string
162 {
163 $xml = $this->dom->dump_node($this->node);
164 return $xml;
165 }
$xml
Definition: metadata.php:351

References $xml.

◆ getBaseThumbnailTarget()

ilPCInteractiveImage::getBaseThumbnailTarget ( )

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

110 : string
111 {
112 return $this->getMediaObject()->getMediaItem("Standard")->getThumbnailTarget();
113 }

References getMediaObject().

+ Here is the call graph for this function:

◆ getMediaObject()

ilPCInteractiveImage::getMediaObject ( )

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

86 {
87 return $this->mediaobject;
88 }

References $mediaobject.

Referenced by ilPCIIMTriggerTableGUI\__construct(), getBaseThumbnailTarget(), and getStandardMediaItem().

+ Here is the caller graph for this function:

◆ getPopups()

ilPCInteractiveImage::getPopups ( )

Get popup captions.

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

195 : array
196 {
197 $titles = array();
198 $childs = $this->iim_node->child_nodes();
199 $k = 0;
200 for ($i = 0; $i < count($childs); $i++) {
201 if ($childs[$i]->node_name() == "ContentPopup") {
202 $pc_id = $childs[$i]->get_attribute("PCID");
203 $hier_id = $childs[$i]->get_attribute("HierId");
204 $title = $childs[$i]->get_attribute("Title");
205 $nr = $childs[$i]->get_attribute("Nr");
206
207 $titles[] = array("title" => $title, "nr" => $nr,
208 "pc_id" => $pc_id, "hier_id" => $hier_id);
209 $k++;
210 }
211 }
212 return $titles;
213 }

References $i.

◆ getStandardAliasItem()

ilPCInteractiveImage::getStandardAliasItem ( )

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

106 {
108 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $std_alias_item.

◆ getStandardMediaItem()

ilPCInteractiveImage::getStandardMediaItem ( )

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

101 {
102 return $this->getMediaObject()->getMediaItem("Standard");
103 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References getMediaObject().

+ Here is the call graph for this function:

◆ getTriggerNodes()

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

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

328 : array {
329 $xpc = xpath_new_context($this->dom);
330 if ($a_pc_id != "") {
331 $path = "//PageContent[@PCID = '" . $a_pc_id . "']/InteractiveImage/Trigger";
332 $res = xpath_eval($xpc, $path);
333 if (count($res->nodeset) > 0) {
334 return $res->nodeset;
335 }
336 return [];
337 }
338
339 $path = "//PageContent[@HierId = '" . $a_hier_id . "']/InteractiveImage/Trigger";
340 $res = xpath_eval($xpc, $path);
341 if (count($res->nodeset) > 0) {
342 return $res->nodeset;
343 }
344 return [];
345 }
xpath_new_context($dom_document)
xpath_eval(php4DOMXPath $xpath_context, string $eval_str, $contextnode=null)
$path
Definition: ltiservices.php:32
$res
Definition: ltiservices.php:69

References $path, $res, and xpath_eval().

+ Here is the call graph for this function:

◆ getTriggers()

ilPCInteractiveImage::getTriggers ( )

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

347 : array
348 {
349 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
350 $trigger_arr = array();
351 for ($i = 0; $i < count($tr_nodes); $i++) {
352 $tr_node = $tr_nodes[$i];
353 $childs = $tr_node->child_nodes();
354 $trigger_arr[] = array(
355 "Nr" => $tr_node->get_attribute("Nr"),
356 "Type" => $tr_node->get_attribute("Type"),
357 "Title" => $tr_node->get_attribute("Title"),
358 "OverlayX" => $tr_node->get_attribute("OverlayX"),
359 "OverlayY" => $tr_node->get_attribute("OverlayY"),
360 "MarkerX" => $tr_node->get_attribute("MarkerX"),
361 "MarkerY" => $tr_node->get_attribute("MarkerY"),
362 "Overlay" => $tr_node->get_attribute("Overlay"),
363 "PopupNr" => $tr_node->get_attribute("PopupNr"),
364 "PopupX" => $tr_node->get_attribute("PopupX"),
365 "PopupY" => $tr_node->get_attribute("PopupY"),
366 "PopupWidth" => $tr_node->get_attribute("PopupWidth"),
367 "PopupHeight" => $tr_node->get_attribute("PopupHeight")
368 );
369 }
370
371 return $trigger_arr;
372 }
getTriggerNodes(string $a_hier_id, string $a_pc_id="")

References $i.

◆ init()

ilPCInteractiveImage::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

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

36 : void
37 {
38 global $DIC;
39
40 $this->lng = $DIC->language();
41 $this->setType("iim");
42 }
setType(string $a_type)
Set Type.
global $DIC
Definition: feed.php:28

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

+ Here is the call graph for this function:

◆ readMediaObject()

ilPCInteractiveImage::readMediaObject ( int  $a_mob_id = 0)

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

44 : void
45 {
46 if ($a_mob_id > 0) {
47 $mob = new ilObjMediaObject($a_mob_id);
48 $this->setMediaObject($mob);
49 }
50 }

References setMediaObject().

+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImage::savePopups ( array  $a_popups)

Save popups.

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

218 : void
219 {
220 $childs = $this->iim_node->child_nodes();
221 for ($i = 0; $i < count($childs); $i++) {
222 if ($childs[$i]->node_name() == "ContentPopup") {
223 $pc_id = $childs[$i]->get_attribute("PCID");
224 $hier_id = $childs[$i]->get_attribute("HierId");
225 $k = $hier_id . ":" . $pc_id;
226 $childs[$i]->set_attribute("Title", $a_popups[$k]);
227 }
228 }
229 }

References $i.

◆ setDom()

ilPCInteractiveImage::setDom ( php4DOMDocument  $a_dom)

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

75 : void
76 {
77 $this->dom = $a_dom;
78 }

◆ setExtLinkTitle()

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

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

531 : void {
532 if ($this->getPCId() != "") {
533 $xpc = xpath_new_context($this->dom);
534 $path = "//PageContent[@PCID = '" . $this->getPCId() . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
535 $res = xpath_eval($xpc, $path);
536 if (count($res->nodeset) > 0) {
537 $res->nodeset[0]->set_content($a_title);
538 }
539 return;
540 }
541
542 $xpc = xpath_new_context($this->dom);
543 $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
544 $res = xpath_eval($xpc, $path);
545 if (count($res->nodeset) > 0) {
546 $res->nodeset[0]->set_content($a_title);
547 }
548 }

References $path, $res, xpath_eval(), and xpath_new_context().

+ Here is the call graph for this function:

◆ setMediaObject()

ilPCInteractiveImage::setMediaObject ( ilObjMediaObject  $a_mediaobject)

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

80 : void
81 {
82 $this->mediaobject = $a_mediaobject;
83 }

Referenced by createMediaObject(), readMediaObject(), and setNode().

+ Here is the caller graph for this function:

◆ setNode()

ilPCInteractiveImage::setNode ( php4DOMElement  $a_node)

Set xml node of page content.

Parameters
php4DOMElement$a_nodenode object

Reimplemented from ilPageContent.

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

52 : void
53 {
54 parent::setNode($a_node); // this is the PageContent node
55 $this->iim_node = $a_node->first_child();
56 if (isset($this->iim_node->myDOMNode)) {
57 $this->med_alias_node = $this->iim_node->first_child();
58 }
59 if (isset($this->med_alias_node) && $this->med_alias_node->myDOMNode != null) {
60 $id = $this->med_alias_node->get_attribute("OriginId");
62 if (ilObject::_lookupType($mob_id) == "mob") {
63 $this->setMediaObject(new ilObjMediaObject($mob_id));
64 }
65 }
66 $this->std_alias_item = new ilMediaAliasItem(
67 $this->dom,
68 $this->readHierId(),
69 "Standard",
70 $this->readPCId(),
71 "InteractiveImage"
72 );
73 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupType(int $id, bool $reference=false)

References $id, ilInternalLink\_extractObjIdOfTarget(), ilObject\_lookupType(), php4DOMNode\first_child(), ilPageContent\readHierId(), ilPageContent\readPCId(), and setMediaObject().

+ Here is the call 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 436 of file class.ilPCInteractiveImage.php.

438 : void {
439 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
440 for ($i = 0; $i < count($tr_nodes); $i++) {
441 $tr_node = $tr_nodes[$i];
442 if ($tr_node->get_attribute("Type") == self::MARKER) {
443 if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
444 $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
445 $tr_node->set_attribute("MarkerX", (int) $pos[0]);
446 $tr_node->set_attribute("MarkerY", (int) $pos[1]);
447 }
448 }
449 }
450 }

◆ 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 418 of file class.ilPCInteractiveImage.php.

420 : void {
421 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
422 for ($i = 0; $i < count($tr_nodes); $i++) {
423 $tr_node = $tr_nodes[$i];
424 if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
425 $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
426 $tr_node->set_attribute("OverlayX", (int) $pos[0]);
427 $tr_node->set_attribute("OverlayY", (int) $pos[1]);
428 }
429 }
430 }

◆ setTriggerOverlays()

ilPCInteractiveImage::setTriggerOverlays ( array  $a_ovs)

Set trigger overlays.

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

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

401 : void {
402 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
403 for ($i = 0; $i < count($tr_nodes); $i++) {
404 $tr_node = $tr_nodes[$i];
405 if (isset($a_ovs["" . $tr_node->get_attribute("Nr")])) {
406 $tr_node->set_attribute(
407 "Overlay",
408 $a_ovs["" . $tr_node->get_attribute("Nr")]
409 );
410 }
411 }
412 }

◆ 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 456 of file class.ilPCInteractiveImage.php.

458 : void {
459 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
460 for ($i = 0; $i < count($tr_nodes); $i++) {
461 $tr_node = $tr_nodes[$i];
462 if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
463 $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
464 $tr_node->set_attribute("PopupX", (int) $pos[0]);
465 $tr_node->set_attribute("PopupY", (int) $pos[1]);
466 }
467 }
468 }

◆ setTriggerPopups()

ilPCInteractiveImage::setTriggerPopups ( array  $a_pops)

Set trigger popups.

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

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

494 : void {
495 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
496 for ($i = 0; $i < count($tr_nodes); $i++) {
497 $tr_node = $tr_nodes[$i];
498 if (isset($a_pops[(string) $tr_node->get_attribute("Nr")])) {
499 $pop = $a_pops[(string) $tr_node->get_attribute("Nr")];
500 $tr_node->set_attribute("PopupNr", $pop);
501 }
502 }
503 }

◆ 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 474 of file class.ilPCInteractiveImage.php.

476 : void {
477 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
478 for ($i = 0; $i < count($tr_nodes); $i++) {
479 $tr_node = $tr_nodes[$i];
480 if (isset($a_size["" . $tr_node->get_attribute("Nr")])) {
481 $size = explode(",", $a_size["" . $tr_node->get_attribute("Nr")]);
482 $tr_node->set_attribute("PopupWidth", (int) $size[0]);
483 $tr_node->set_attribute("PopupHeight", (int) $size[1]);
484 }
485 }
486 }

◆ setTriggerTitles()

ilPCInteractiveImage::setTriggerTitles ( array  $a_titles)

Set trigger titles.

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

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

511 : void {
512 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPCId());
513 for ($i = 0; $i < count($tr_nodes); $i++) {
514 $tr_node = $tr_nodes[$i];
515 if (isset($a_titles[(string) $tr_node->get_attribute("Nr")])) {
516 $tr_node->set_attribute(
517 "Title",
518 $a_titles[(string) $tr_node->get_attribute("Nr")]
519 );
520 $this->setExtLinkTitle(
521 $tr_node->get_attribute("Nr"),
522 $a_titles[(string) $tr_node->get_attribute("Nr")]
523 );
524 }
525 }
526 }
setExtLinkTitle(int $a_nr, string $a_title)

Field Documentation

◆ $iim_node

php4DOMElement ilPCInteractiveImage::$iim_node

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

◆ $lng

ilLanguage ilPCInteractiveImage::$lng
protected

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

◆ $mal_node

php4DOMElement ilPCInteractiveImage::$mal_node
protected

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

◆ $med_alias_node

php4DOMElement ilPCInteractiveImage::$med_alias_node
protected

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

◆ $mediaobject

ilObjMediaObject ilPCInteractiveImage::$mediaobject
protected

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

Referenced by getMediaObject().

◆ $std_alias_item

ilMediaAliasItem ilPCInteractiveImage::$std_alias_item
protected

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

Referenced by getStandardAliasItem().

◆ AREA

const ilPCInteractiveImage::AREA = "Area"

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

Referenced by ilPCIIMTriggerTableGUI\fillRow().

◆ 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: