ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPCInteractiveImage Class Reference

Interactive image. More...

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

Public Member Functions

 init ()
 Init page content component. More...
 
 readMediaObject ($a_mob_id=0)
 Read/get Media Object. More...
 
 setNode ($a_node)
 Set node (and media object node) More...
 
 setDom (&$a_dom)
 Set dom object. More...
 
 setMediaObject ($a_mediaobject)
 Set Media Object. More...
 
 getMediaObject ()
 Get Media Object. More...
 
 createMediaObject ()
 Create new media object. More...
 
 create ($a_pg_obj, $a_hier_id)
 Create pc media object. More...
 
 getStandardMediaItem ()
 Get standard media item. More...
 
 getStandardAliasItem ()
 Get standard alias item. More...
 
 getBaseThumbnailTarget ()
 Get base thumbnail target. More...
 
 createAlias (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create an media alias in page. More...
 
 dumpXML ()
 Dump node xml. More...
 
 setStyleClass ($a_class)
 Set style class. More...
 
 getStyleClass ()
 Get style class. More...
 
 addContentPopup ()
 Add a tab. More...
 
 getPopups ()
 Get popup captions. More...
 
 savePopups ($a_popups)
 Save popups. More...
 
 deletePopup ($a_hier_id, $a_pc_id)
 Delete popup. More...
 
 addTriggerArea ($a_alias_item, $a_shape_type, $a_coords, $a_title, $a_link)
 Get caption. More...
 
 addTriggerMarker ()
 Add a new trigger marker. More...
 
 getTriggerNodes ($a_hier_id, $a_pc_id="")
 Get trigger nodes. More...
 
 getTriggers ()
 Get triggers. More...
 
 deleteTrigger ($a_alias_item, $a_nr)
 Delete Trigger. More...
 
 setTriggerOverlays ($a_ovs)
 Set trigger overlays. More...
 
 setTriggerOverlayPositions ($a_pos)
 Set trigger overlay position. More...
 
 setTriggerMarkerPositions ($a_pos)
 Set trigger marker position. More...
 
 setTriggerPopupPositions ($a_pos)
 Set trigger popup position. More...
 
 setTriggerPopupSize ($a_size)
 Set trigger popup size. More...
 
 setTriggerPopups ($a_pops)
 Set trigger popups. More...
 
 setTriggerTitles ($a_titles)
 Set trigger titles. More...
 
 setExtLinkTitle ($a_nr, $a_title)
 Set ExtLink Title. More...
 
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 init ()
 Init object. More...
 
 getType ()
 Get type of page content. More...
 
 setNode ($a_node)
 Set xml node of page content. More...
 
getNode ()
 Get xml node of page content. More...
 
 getJavascriptFiles ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 Get on load code. More...
 
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure. More...
 
 getHierId ()
 Get hierarchical id. More...
 
 lookupHierId ()
 Get hierarchical id from dom. More...
 
 readHierId ()
 Read PC Id. More...
 
 setPcId ($a_pcid)
 Set PC Id. More...
 
 getPCId ()
 Get PC Id. More...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 setEnabled ($value)
 Set Enabled value for page content component. More...
 
 enable ()
 Enable page content. More...
 
 disable ()
 Disable page content. More...
 
 isEnabled ()
 Check whether page content is enabled. More...
 
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl ($a_output, $a_mode)
 Modify page content after xsl. More...
 

Data Fields

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

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number) More...
 
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container. More...
 
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId ($a, $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, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 
- Protected Attributes inherited from ilPageContent
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

Detailed Description

Interactive image.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Member Function Documentation

◆ addContentPopup()

ilPCInteractiveImage::addContentPopup ( )

Add a tab.

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

260 {
261 global $lng;
262
263 $max = 0;
264 $popups = $this->getPopups();
265 foreach ($popups as $p)
266 {
267 $max = max($max, (int) $p["nr"]);
268 }
269
270 $new_item = $this->dom->create_element("ContentPopup");
271 $new_item->set_attribute("Title", $lng->txt("cont_new_popup"));
272 $new_item->set_attribute("Nr", $max + 1);
273 $new_item = $this->iim_node->append_child($new_item);
274 }
global $lng
Definition: privfeed.php:17

References $lng, and getPopups().

+ Here is the call graph for this function:

◆ addTriggerArea()

ilPCInteractiveImage::addTriggerArea (   $a_alias_item,
  $a_shape_type,
  $a_coords,
  $a_title,
  $a_link 
)

Get caption.

Save positions of tabs Save positions of tabs Add a new trigger

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

436 {
437 $max = 0;
438 $triggers = $this->getTriggers();
439 foreach ($triggers as $t)
440 {
441 $max = max($max, (int) $t["Nr"]);
442 }
443
444 $link = array(
445 "LinkType" => IL_EXT_LINK,
446 "Href" => ilUtil::stripSlashes("#"));
447
448 $a_alias_item->addMapArea(
449 $a_shape_type, $a_coords,
450 ilUtil::stripSlashes($a_title), $link, $max + 1);
451
452 $attributes = array("Type" => self::AREA,
453 "Title" => ilUtil::stripSlashes($a_title),
454 "Nr" => $max + 1,
455 "OverlayX" => "0", "OverlayY" => "0", "Overlay" => "", "PopupNr" => "",
456 "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
457 $ma_node = ilDOMUtil::addElementToList($this->dom, $this->iim_node,
458 "Trigger", array("ContentPopup"), "", $attributes);
459 }
const IL_EXT_LINK
static addElementToList($doc, $parent_node, $a_node_name, $a_successors, $a_content, $a_attributes)
Places a new node $a_node_name directly before nodes with names of $a_successors.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $t, ilDOMUtil\addElementToList(), getTriggers(), IL_EXT_LINK, and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ addTriggerMarker()

ilPCInteractiveImage::addTriggerMarker ( )

Add a new trigger marker.

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

465 {
466 global $lng;
467
468 $max = 0;
469 $triggers = $this->getTriggers();
470 foreach ($triggers as $t)
471 {
472 $max = max($max, (int) $t["Nr"]);
473 }
474
475 $attributes = array("Type" => self::MARKER,
476 "Title" => $lng->txt("cont_new_marker"),
477 "Nr" => $max + 1, "OverlayX" => "0", "OverlayY" => "0",
478 "MarkerX" => "0", "MarkerY" => "0", "PopupNr" => "",
479 "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
480 $ma_node = ilDOMUtil::addElementToList($this->dom, $this->iim_node,
481 "Trigger", array("ContentPopup"), "", $attributes);
482 }

References $lng, $t, ilDOMUtil\addElementToList(), and getTriggers().

+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImage::create (   $a_pg_obj,
  $a_hier_id 
)

Create pc media object.

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

108 {
109 $this->node = $this->createPageContentNode();
110 }
createPageContentNode($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 ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create an media alias in page.

Parameters
object$a_pg_objpage object
string$a_hier_idhierarchical ID

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

149 {
150 $this->node = $this->dom->create_element("PageContent");
151 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
152 $this->iim_node = $this->dom->create_element("InteractiveImage");
153 $this->iim_node = $this->node->append_child($this->iim_node);
154 $this->mal_node = $this->dom->create_element("MediaAlias");
155 $this->mal_node = $this->iim_node->append_child($this->mal_node);
156 $this->mal_node->set_attribute("OriginId", "il__mob_".$this->getMediaObject()->getId());
157
158 // standard view
159 $item_node = $this->dom->create_element("MediaAliasItem");
160 $item_node = $this->iim_node->append_child($item_node);
161 $item_node->set_attribute("Purpose", "Standard");
162 $media_item = $this->getMediaObject()->getMediaItem("Standard");
163
164 $layout_node = $this->dom->create_element("Layout");
165 $layout_node = $item_node->append_child($layout_node);
166 if ($media_item->getWidth() > 0)
167 {
168 //$layout_node->set_attribute("Width", $media_item->getWidth());
169 }
170 if ($media_item->getHeight() > 0)
171 {
172 //$layout_node->set_attribute("Height", $media_item->getHeight());
173 }
174 $layout_node->set_attribute("HorizontalAlign", "Left");
175
176 // caption
177 if ($media_item->getCaption() != "")
178 {
179 $cap_node = $this->dom->create_element("Caption");
180 $cap_node = $item_node->append_child($cap_node);
181 $cap_node->set_attribute("Align", "bottom");
182 $cap_node->set_content($media_item->getCaption());
183 }
184
185 // text representation
186 if ($media_item->getTextRepresentation() != "")
187 {
188 $tr_node = $this->dom->create_element("TextRepresentation");
189 $tr_node = $item_node->append_child($tr_node);
190 $tr_node->set_content($media_item->getTextRepresentation());
191 }
192 }
const IL_INSERT_AFTER

References getMediaObject(), and IL_INSERT_AFTER.

+ Here is the call graph for this function:

◆ createMediaObject()

ilPCInteractiveImage::createMediaObject ( )

Create new media object.

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

100 {
101 $this->setMediaObject(new ilObjMediaObject());
102 }
Class ilObjMediaObject.
setMediaObject($a_mediaobject)
Set Media Object.

References setMediaObject().

+ Here is the call graph for this function:

◆ deletePopup()

ilPCInteractiveImage::deletePopup (   $a_hier_id,
  $a_pc_id 
)

Delete popup.

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

323 {
324 // File Item
325 $childs = $this->iim_node->child_nodes();
326 $nodes = array();
327 for ($i=0; $i<count($childs); $i++)
328 {
329 if ($childs[$i]->node_name() == "ContentPopup")
330 {
331 if ($a_pc_id == $childs[$i]->get_attribute("PCID") &&
332 $a_hier_id == $childs[$i]->get_attribute("HierId"))
333 {
334 $childs[$i]->unlink($childs[$i]);
335 }
336 }
337 }
338 }

◆ deleteTrigger()

ilPCInteractiveImage::deleteTrigger (   $a_alias_item,
  $a_nr 
)

Delete Trigger.

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

546 {
547 // File Item
548 $childs = $this->iim_node->child_nodes();
549 $nodes = array();
550 for ($i=0; $i<count($childs); $i++)
551 {
552 if ($childs[$i]->node_name() == "Trigger")
553 {
554 if ($a_nr == $childs[$i]->get_attribute("Nr"))
555 {
556 $childs[$i]->unlink($childs[$i]);
557 }
558 }
559 }
560 $a_alias_item->deleteMapAreaById($a_nr);
561 }

◆ dumpXML()

ilPCInteractiveImage::dumpXML ( )

Dump node xml.

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

198 {
199 $xml = $this->dom->dump_node($this->node);
200 return $xml;
201 }

◆ getBaseThumbnailTarget()

ilPCInteractiveImage::getBaseThumbnailTarget ( )

Get base thumbnail target.

Returns
string base thumbnail target

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

137 {
138 return $this->getMediaObject()->getMediaItem("Standard")->getThumbnailTarget();
139 }

References getMediaObject().

+ Here is the call graph for this function:

◆ getMediaObject()

ilPCInteractiveImage::getMediaObject ( )

Get Media Object.

Returns
object Media Object

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

92 {
93 return $this->mediaobject;
94 }

Referenced by createAlias(), getBaseThumbnailTarget(), and getStandardMediaItem().

+ Here is the caller graph for this function:

◆ getPopups()

ilPCInteractiveImage::getPopups ( )

Get popup captions.

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

280 {
281 $titles = array();
282 $childs = $this->iim_node->child_nodes();
283 $k = 0;
284 for($i = 0; $i < count($childs); $i++)
285 {
286 if ($childs[$i]->node_name() == "ContentPopup")
287 {
288 $pc_id = $childs[$i]->get_attribute("PCID");
289 $hier_id = $childs[$i]->get_attribute("HierId");
290 $title = $childs[$i]->get_attribute("Title");
291 $nr = $childs[$i]->get_attribute("Nr");
292
293 $titles[] = array("title" => $title, "nr" => $nr,
294 "pc_id" => $pc_id, "hier_id" => $hier_id);
295 $k++;
296 }
297 }
298 return $titles;
299 }

References ilPageContent\$hier_id, and $title.

Referenced by addContentPopup().

+ Here is the caller graph for this function:

◆ getStandardAliasItem()

ilPCInteractiveImage::getStandardAliasItem ( )

Get standard alias item.

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

126 {
127 return $this->std_alias_item;
128 }

◆ getStandardMediaItem()

ilPCInteractiveImage::getStandardMediaItem ( )

Get standard media item.

Returns

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

118 {
119 return $this->getMediaObject()->getMediaItem("Standard");
120 }

References getMediaObject().

+ Here is the call graph for this function:

◆ getStyleClass()

ilPCInteractiveImage::getStyleClass ( )

Get style class.

Returns
string style class

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

238 {
239 if (is_object($this->iim_node))
240 {
241 $mal_node = $this->iim_node->first_child();
242 if (is_object($mal_node))
243 {
244 $class = $mal_node->get_attribute("Class");
245 return $class;
246 }
247 }
248 }

◆ getTriggerNodes()

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

Get trigger nodes.

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

488 {
489 if ($a_pc_id != "")
490 {
491 $xpc = xpath_new_context($this->dom);
492 $path = "//PageContent[@PCID = '".$a_pc_id."']/InteractiveImage/Trigger";
493 $res = xpath_eval($xpc, $path);
494 if (count($res->nodeset) > 0)
495 {
496 return $res->nodeset;
497 }
498 return array();
499 }
500
501 $xpc = xpath_new_context($this->dom);
502 $path = "//PageContent[@HierId = '".$a_hier_id."']/InteractiveImage/Trigger";
503 $res = xpath_eval($xpc, $path);
504 if (count($res->nodeset) > 0)
505 {
506 return $res->nodeset;
507 }
508 }
$path
Definition: aliased.php:25
xpath_eval($xpath_context, $eval_str, $contextnode=null)
xpath_new_context($dom_document)

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

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTriggers()

ilPCInteractiveImage::getTriggers ( )

Get triggers.

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

515 {
516 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
517 $trigger_arr = array();
518 for($i=0; $i < count($tr_nodes); $i++)
519 {
520 $tr_node = $tr_nodes[$i];
521 $childs = $tr_node->child_nodes();
522 $trigger_arr[] = array(
523 "Nr" => $tr_node->get_attribute("Nr"),
524 "Type" => $tr_node->get_attribute("Type"),
525 "Title" => $tr_node->get_attribute("Title"),
526 "OverlayX" => $tr_node->get_attribute("OverlayX"),
527 "OverlayY" => $tr_node->get_attribute("OverlayY"),
528 "MarkerX" => $tr_node->get_attribute("MarkerX"),
529 "MarkerY" => $tr_node->get_attribute("MarkerY"),
530 "Overlay" => $tr_node->get_attribute("Overlay"),
531 "PopupNr" => $tr_node->get_attribute("PopupNr"),
532 "PopupX" => $tr_node->get_attribute("PopupX"),
533 "PopupY" => $tr_node->get_attribute("PopupY"),
534 "PopupWidth" => $tr_node->get_attribute("PopupWidth"),
535 "PopupHeight" => $tr_node->get_attribute("PopupHeight")
536 );
537 }
538
539 return $trigger_arr;
540 }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.

References getTriggerNodes().

Referenced by addTriggerArea(), and addTriggerMarker().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPCInteractiveImage::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

27 {
28 $this->setType("iim");
29 }
setType($a_type)
Set Type.

References ilPageContent\setType().

+ Here is the call graph for this function:

◆ readMediaObject()

ilPCInteractiveImage::readMediaObject (   $a_mob_id = 0)

Read/get Media Object.

Parameters
intmedia object ID

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

37 {
38 if ($a_mob_id > 0)
39 {
40 $mob = new ilObjMediaObject($a_mob_id);
41 $this->setMediaObject($mob);
42 }
43 }

References setMediaObject().

+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImage::savePopups (   $a_popups)

Save popups.

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

305 {
306 $childs = $this->iim_node->child_nodes();
307 for($i = 0; $i < count($childs); $i++)
308 {
309 if ($childs[$i]->node_name() == "ContentPopup")
310 {
311 $pc_id = $childs[$i]->get_attribute("PCID");
312 $hier_id = $childs[$i]->get_attribute("HierId");
313 $k = $hier_id.":".$pc_id;
314 $childs[$i]->set_attribute("Title", $a_popups[$k]);
315 }
316 }
317 }

References ilPageContent\$hier_id.

◆ setDom()

ilPCInteractiveImage::setDom ( $a_dom)

Set dom object.

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

72 {
73 $this->dom = $a_dom;
74 }

◆ setExtLinkTitle()

ilPCInteractiveImage::setExtLinkTitle (   $a_nr,
  $a_title 
)

Set ExtLink Title.

Parameters

return

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

713 {
714 if ($this->getPcId() != "")
715 {
716 $xpc = xpath_new_context($this->dom);
717 $path = "//PageContent[@PCID = '".$this->getPcId()."']/InteractiveImage/MediaAliasItem/MapArea[@Id='".$a_nr."']/ExtLink";
718 $res = xpath_eval($xpc, $path);
719 if (count($res->nodeset) > 0)
720 {
721 $res->nodeset[0]->set_content($a_title);
722 }
723 return;
724 }
725
726 $xpc = xpath_new_context($this->dom);
727 $path = "//PageContent[@HierId = '".$this->hier_id."']/InteractiveImage/MediaAliasItem/MapArea[@Id='".$a_nr."']/ExtLink";
728 $res = xpath_eval($xpc, $path);
729 if (count($res->nodeset) > 0)
730 {
731 $res->nodeset[0]->set_content($a_title);
732 }
733 }

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

Referenced by setTriggerTitles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setMediaObject()

ilPCInteractiveImage::setMediaObject (   $a_mediaobject)

Set Media Object.

Parameters
object$a_mediaobjectMedia Object

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

82 {
83 $this->mediaobject = $a_mediaobject;
84 }

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

+ Here is the caller graph for this function:

◆ setNode()

ilPCInteractiveImage::setNode (   $a_node)

Set node (and media object node)

Reimplemented from ilPageContent.

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

49 {
50 parent::setNode($a_node); // this is the PageContent node
51 $this->iim_node = $a_node->first_child();
52 $this->med_alias_node = $this->iim_node->first_child();
53 if (is_object($this->med_alias_node) && $this->med_alias_node->myDOMNode != null)
54 {
55 $id = $this->med_alias_node->get_attribute("OriginId");
57 if (ilObject::_lookupType($mob_id) == "mob")
58 {
59 $this->setMediaObject(new ilObjMediaObject($mob_id));
60 }
61 }
62 include_once("./Services/COPage/classes/class.ilMediaAliasItem.php");
63 $this->std_alias_item = new ilMediaAliasItem($this->dom,
64 $this->readHierId(), "Standard", $this->readPCId(),
65 "InteractiveImage");
66 }
Class ilMediaAliasItem.
static _lookupType($a_id, $a_reference=false)
lookup object type
readHierId()
Read PC Id.
readPCId()
Read PC Id.

References ilInternalLink\_extractObjIdOfTarget(), ilObject\_lookupType(), ilPageContent\readHierId(), ilPageContent\readPCId(), and setMediaObject().

+ Here is the call graph for this function:

◆ setStyleClass()

ilPCInteractiveImage::setStyleClass (   $a_class)

Set style class.

Parameters
string$a_classstyle class

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

209 {
210// check this
211die("pcinteractiveimage: setstyleclass");
212 if (is_object($this->iim_node))
213 {
214 $mal_node = $this->iim_node->first_child();
215 if (is_object($mal_node))
216 {
217 if (!empty($a_class))
218 {
219 $mal_node->set_attribute("Class", $a_class);
220 }
221 else
222 {
223 if ($mal_node->has_attribute("Class"))
224 {
225 $mal_node->remove_attribute("Class");
226 }
227 }
228 }
229 }
230 }

◆ setTriggerMarkerPositions()

ilPCInteractiveImage::setTriggerMarkerPositions (   $a_pos)

Set trigger marker position.

Parameters
arrayarray of strings (representing the marker positions for the trigger)

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

609 {
610 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
611 for($i=0; $i < count($tr_nodes); $i++)
612 {
613 $tr_node = $tr_nodes[$i];
614 if ($tr_node->get_attribute("Type") == self::MARKER)
615 {
616 if (isset($a_pos["".$tr_node->get_attribute("Nr")]))
617 {
618 $pos = explode(",", $a_pos["".$tr_node->get_attribute("Nr")]);
619 $tr_node->set_attribute("MarkerX", (int) $pos[0]);
620 $tr_node->set_attribute("MarkerY", (int) $pos[1]);
621 }
622 }
623 }
624 }

References getTriggerNodes(), and MARKER.

+ Here is the call graph for this function:

◆ setTriggerOverlayPositions()

ilPCInteractiveImage::setTriggerOverlayPositions (   $a_pos)

Set trigger overlay position.

Parameters
arrayarray of strings (representing the overlays for the trigger)

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

589 {
590 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
591 for($i=0; $i < count($tr_nodes); $i++)
592 {
593 $tr_node = $tr_nodes[$i];
594 if (isset($a_pos["".$tr_node->get_attribute("Nr")]))
595 {
596 $pos = explode(",", $a_pos["".$tr_node->get_attribute("Nr")]);
597 $tr_node->set_attribute("OverlayX", (int) $pos[0]);
598 $tr_node->set_attribute("OverlayY", (int) $pos[1]);
599 }
600 }
601 }

References getTriggerNodes().

+ Here is the call graph for this function:

◆ setTriggerOverlays()

ilPCInteractiveImage::setTriggerOverlays (   $a_ovs)

Set trigger overlays.

Parameters
arrayarray of strings (representing the overlays for the trigger)

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

570 {
571 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
572 for($i=0; $i < count($tr_nodes); $i++)
573 {
574 $tr_node = $tr_nodes[$i];
575 if (isset($a_ovs["".$tr_node->get_attribute("Nr")]))
576 {
577 $tr_node->set_attribute("Overlay",
578 $a_ovs["".$tr_node->get_attribute("Nr")]);
579 }
580 }
581 }

References getTriggerNodes().

+ Here is the call graph for this function:

◆ setTriggerPopupPositions()

ilPCInteractiveImage::setTriggerPopupPositions (   $a_pos)

Set trigger popup position.

Parameters
arrayarray of strings (representing the popup positions for the trigger)

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

632 {
633 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
634 for($i=0; $i < count($tr_nodes); $i++)
635 {
636 $tr_node = $tr_nodes[$i];
637 if (isset($a_pos["".$tr_node->get_attribute("Nr")]))
638 {
639 $pos = explode(",", $a_pos["".$tr_node->get_attribute("Nr")]);
640 $tr_node->set_attribute("PopupX", (int) $pos[0]);
641 $tr_node->set_attribute("PopupY", (int) $pos[1]);
642 }
643 }
644 }

References getTriggerNodes().

+ Here is the call graph for this function:

◆ setTriggerPopups()

ilPCInteractiveImage::setTriggerPopups (   $a_pops)

Set trigger popups.

Parameters
arrayarray of strings (representing the popups for the trigger)

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

672 {
673 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
674 for($i=0; $i < count($tr_nodes); $i++)
675 {
676 $tr_node = $tr_nodes[$i];
677 if (isset($a_pops["".$tr_node->get_attribute("Nr")]))
678 {
679 $pop = $a_pops["".$tr_node->get_attribute("Nr")];
680 $tr_node->set_attribute("PopupNr", $pop);
681 }
682 }
683 }

References getTriggerNodes().

+ Here is the call graph for this function:

◆ setTriggerPopupSize()

ilPCInteractiveImage::setTriggerPopupSize (   $a_size)

Set trigger popup size.

Parameters
arrayarray of strings (representing the popup sizes for the trigger)

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

652 {
653 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
654 for($i=0; $i < count($tr_nodes); $i++)
655 {
656 $tr_node = $tr_nodes[$i];
657 if (isset($a_size["".$tr_node->get_attribute("Nr")]))
658 {
659 $size = explode(",", $a_size["".$tr_node->get_attribute("Nr")]);
660 $tr_node->set_attribute("PopupWidth", (int) $size[0]);
661 $tr_node->set_attribute("PopupHeight", (int) $size[1]);
662 }
663 }
664 }
$size
Definition: RandomTest.php:79

References $size, and getTriggerNodes().

+ Here is the call graph for this function:

◆ setTriggerTitles()

ilPCInteractiveImage::setTriggerTitles (   $a_titles)

Set trigger titles.

Parameters
arrayarray of strings (representing the titles for the trigger)

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

691 {
692 $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
693 for($i=0; $i < count($tr_nodes); $i++)
694 {
695 $tr_node = $tr_nodes[$i];
696 if (isset($a_titles["".$tr_node->get_attribute("Nr")]))
697 {
698 $tr_node->set_attribute("Title",
699 $a_titles["".$tr_node->get_attribute("Nr")]);
700 $this->setExtLinkTitle($tr_node->get_attribute("Nr"),
701 $a_titles["".$tr_node->get_attribute("Nr")]);
702 }
703 }
704 }
setExtLinkTitle($a_nr, $a_title)
Set ExtLink Title.

References getTriggerNodes(), and setExtLinkTitle().

+ Here is the call graph for this function:

Field Documentation

◆ $dom

ilPCInteractiveImage::$dom

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

◆ $iim_node

ilPCInteractiveImage::$iim_node

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

◆ AREA

const ilPCInteractiveImage::AREA = "Area"

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

Referenced by ilPCIIMTriggerTableGUI\fillRow().

◆ MARKER

const ilPCInteractiveImage::MARKER = "Marker"

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

Referenced by setTriggerMarkerPositions().


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