ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
 

Protected Attributes

 $lng
 
- Protected Attributes inherited from ilPageContent
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

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

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

References $lng, and getPopups().

258  {
259  $lng = $this->lng;
260 
261  $max = 0;
262  $popups = $this->getPopups();
263  foreach ($popups as $p) {
264  $max = max($max, (int) $p["nr"]);
265  }
266 
267  $new_item = $this->dom->create_element("ContentPopup");
268  $new_item->set_attribute("Title", $lng->txt("cont_new_popup"));
269  $new_item->set_attribute("Nr", $max + 1);
270  $new_item = $this->iim_node->append_child($new_item);
271  }
getPopups()
Get popup captions.
+ 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 424 of file class.ilPCInteractiveImage.php.

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

430  {
431  $max = 0;
432  $triggers = $this->getTriggers();
433  foreach ($triggers as $t) {
434  $max = max($max, (int) $t["Nr"]);
435  }
436 
437  $link = array(
438  "LinkType" => IL_EXT_LINK,
439  "Href" => ilUtil::stripSlashes("#"));
440 
441  $a_alias_item->addMapArea(
442  $a_shape_type,
443  $a_coords,
444  ilUtil::stripSlashes($a_title),
445  $link,
446  $max + 1
447  );
448 
449  $attributes = array("Type" => self::AREA,
450  "Title" => ilUtil::stripSlashes($a_title),
451  "Nr" => $max + 1,
452  "OverlayX" => "0", "OverlayY" => "0", "Overlay" => "", "PopupNr" => "",
453  "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
454  $ma_node = ilDOMUtil::addElementToList(
455  $this->dom,
456  $this->iim_node,
457  "Trigger",
458  array("ContentPopup"),
459  "",
461  );
462  }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
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. ...
const IL_EXT_LINK
+ Here is the call graph for this function:

◆ addTriggerMarker()

ilPCInteractiveImage::addTriggerMarker ( )

Add a new trigger marker.

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

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

468  {
469  $lng = $this->lng;
470 
471  $max = 0;
472  $triggers = $this->getTriggers();
473  foreach ($triggers as $t) {
474  $max = max($max, (int) $t["Nr"]);
475  }
476 
477  $attributes = array("Type" => self::MARKER,
478  "Title" => $lng->txt("cont_new_marker"),
479  "Nr" => $max + 1, "OverlayX" => "0", "OverlayY" => "0",
480  "MarkerX" => "0", "MarkerY" => "0", "PopupNr" => "",
481  "PopupX" => "0", "PopupY" => "0", "PopupWidth" => "150", "PopupHeight" => "200");
482  $ma_node = ilDOMUtil::addElementToList(
483  $this->dom,
484  $this->iim_node,
485  "Trigger",
486  array("ContentPopup"),
487  "",
489  );
490  }
if(array_key_exists('yes', $_REQUEST)) $attributes
Definition: getconsent.php:85
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. ...
+ Here is the call graph for this function:

◆ create()

ilPCInteractiveImage::create (   $a_pg_obj,
  $a_hier_id 
)

Create pc media object.

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

References ilPageContent\createPageContentNode().

118  {
119  $this->node = $this->createPageContentNode();
120  }
createPageContentNode($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 ( $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 158 of file class.ilPCInteractiveImage.php.

References getMediaObject(), and IL_INSERT_AFTER.

159  {
160  $this->node = $this->dom->create_element("PageContent");
161  $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
162  $this->iim_node = $this->dom->create_element("InteractiveImage");
163  $this->iim_node = $this->node->append_child($this->iim_node);
164  $this->mal_node = $this->dom->create_element("MediaAlias");
165  $this->mal_node = $this->iim_node->append_child($this->mal_node);
166  $this->mal_node->set_attribute("OriginId", "il__mob_" . $this->getMediaObject()->getId());
167 
168  // standard view
169  $item_node = $this->dom->create_element("MediaAliasItem");
170  $item_node = $this->iim_node->append_child($item_node);
171  $item_node->set_attribute("Purpose", "Standard");
172  $media_item = $this->getMediaObject()->getMediaItem("Standard");
173 
174  $layout_node = $this->dom->create_element("Layout");
175  $layout_node = $item_node->append_child($layout_node);
176  if ($media_item->getWidth() > 0) {
177  //$layout_node->set_attribute("Width", $media_item->getWidth());
178  }
179  if ($media_item->getHeight() > 0) {
180  //$layout_node->set_attribute("Height", $media_item->getHeight());
181  }
182  $layout_node->set_attribute("HorizontalAlign", "Left");
183 
184  // caption
185  if ($media_item->getCaption() != "") {
186  $cap_node = $this->dom->create_element("Caption");
187  $cap_node = $item_node->append_child($cap_node);
188  $cap_node->set_attribute("Align", "bottom");
189  $cap_node->set_content($media_item->getCaption());
190  }
191 
192  // text representation
193  if ($media_item->getTextRepresentation() != "") {
194  $tr_node = $this->dom->create_element("TextRepresentation");
195  $tr_node = $item_node->append_child($tr_node);
196  $tr_node->set_content($media_item->getTextRepresentation());
197  }
198  }
getMediaObject()
Get Media Object.
const IL_INSERT_AFTER
+ Here is the call graph for this function:

◆ createMediaObject()

ilPCInteractiveImage::createMediaObject ( )

Create new media object.

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

References setMediaObject().

110  {
111  $this->setMediaObject(new ilObjMediaObject());
112  }
Class ilObjMediaObject.
setMediaObject($a_mediaobject)
Set Media Object.
+ Here is the call graph for this function:

◆ deletePopup()

ilPCInteractiveImage::deletePopup (   $a_hier_id,
  $a_pc_id 
)

Delete popup.

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

References $i, and $nodes.

316  {
317  // File Item
318  $childs = $this->iim_node->child_nodes();
319  $nodes = array();
320  for ($i = 0; $i < count($childs); $i++) {
321  if ($childs[$i]->node_name() == "ContentPopup") {
322  if ($a_pc_id == $childs[$i]->get_attribute("PCID") &&
323  $a_hier_id == $childs[$i]->get_attribute("HierId")) {
324  $childs[$i]->unlink($childs[$i]);
325  }
326  }
327  }
328  }
$i
Definition: disco.tpl.php:19

◆ deleteTrigger()

ilPCInteractiveImage::deleteTrigger (   $a_alias_item,
  $a_nr 
)

Delete Trigger.

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

References $i, and $nodes.

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

◆ dumpXML()

ilPCInteractiveImage::dumpXML ( )

Dump node xml.

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

References $xml.

204  {
205  $xml = $this->dom->dump_node($this->node);
206  return $xml;
207  }

◆ getBaseThumbnailTarget()

ilPCInteractiveImage::getBaseThumbnailTarget ( )

Get base thumbnail target.

Returns
string base thumbnail target

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

References getMediaObject().

147  {
148  return $this->getMediaObject()->getMediaItem("Standard")->getThumbnailTarget();
149  }
getMediaObject()
Get Media Object.
+ Here is the call graph for this function:

◆ getMediaObject()

ilPCInteractiveImage::getMediaObject ( )

Get Media Object.

Returns
object Media Object

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

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

102  {
103  return $this->mediaobject;
104  }
+ Here is the caller graph for this function:

◆ getPopups()

ilPCInteractiveImage::getPopups ( )

Get popup captions.

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

References ilPageContent\$hier_id, $i, and $title.

Referenced by addContentPopup().

277  {
278  $titles = array();
279  $childs = $this->iim_node->child_nodes();
280  $k = 0;
281  for ($i = 0; $i < count($childs); $i++) {
282  if ($childs[$i]->node_name() == "ContentPopup") {
283  $pc_id = $childs[$i]->get_attribute("PCID");
284  $hier_id = $childs[$i]->get_attribute("HierId");
285  $title = $childs[$i]->get_attribute("Title");
286  $nr = $childs[$i]->get_attribute("Nr");
287 
288  $titles[] = array("title" => $title, "nr" => $nr,
289  "pc_id" => $pc_id, "hier_id" => $hier_id);
290  $k++;
291  }
292  }
293  return $titles;
294  }
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ getStandardAliasItem()

ilPCInteractiveImage::getStandardAliasItem ( )

Get standard alias item.

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

136  {
137  return $this->std_alias_item;
138  }

◆ getStandardMediaItem()

ilPCInteractiveImage::getStandardMediaItem ( )

Get standard media item.

Returns

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

References getMediaObject().

128  {
129  return $this->getMediaObject()->getMediaItem("Standard");
130  }
getMediaObject()
Get Media Object.
+ 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  $mal_node = $this->iim_node->first_child();
241  if (is_object($mal_node)) {
242  $class = $mal_node->get_attribute("Class");
243  return $class;
244  }
245  }
246  }

◆ getTriggerNodes()

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

Get trigger nodes.

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

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

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

496  {
497  if ($a_pc_id != "") {
498  $xpc = xpath_new_context($this->dom);
499  $path = "//PageContent[@PCID = '" . $a_pc_id . "']/InteractiveImage/Trigger";
500  $res = xpath_eval($xpc, $path);
501  if (count($res->nodeset) > 0) {
502  return $res->nodeset;
503  }
504  return array();
505  }
506 
507  $xpc = xpath_new_context($this->dom);
508  $path = "//PageContent[@HierId = '" . $a_hier_id . "']/InteractiveImage/Trigger";
509  $res = xpath_eval($xpc, $path);
510  if (count($res->nodeset) > 0) {
511  return $res->nodeset;
512  }
513  }
$path
Definition: aliased.php:25
xpath_new_context($dom_document)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
foreach($_POST as $key=> $value) $res
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTriggers()

ilPCInteractiveImage::getTriggers ( )

Get triggers.

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

References $i, and getTriggerNodes().

Referenced by addTriggerArea(), and addTriggerMarker().

520  {
521  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
522  $trigger_arr = array();
523  for ($i = 0; $i < count($tr_nodes); $i++) {
524  $tr_node = $tr_nodes[$i];
525  $childs = $tr_node->child_nodes();
526  $trigger_arr[] = array(
527  "Nr" => $tr_node->get_attribute("Nr"),
528  "Type" => $tr_node->get_attribute("Type"),
529  "Title" => $tr_node->get_attribute("Title"),
530  "OverlayX" => $tr_node->get_attribute("OverlayX"),
531  "OverlayY" => $tr_node->get_attribute("OverlayY"),
532  "MarkerX" => $tr_node->get_attribute("MarkerX"),
533  "MarkerY" => $tr_node->get_attribute("MarkerY"),
534  "Overlay" => $tr_node->get_attribute("Overlay"),
535  "PopupNr" => $tr_node->get_attribute("PopupNr"),
536  "PopupX" => $tr_node->get_attribute("PopupX"),
537  "PopupY" => $tr_node->get_attribute("PopupY"),
538  "PopupWidth" => $tr_node->get_attribute("PopupWidth"),
539  "PopupHeight" => $tr_node->get_attribute("PopupHeight")
540  );
541  }
542 
543  return $trigger_arr;
544  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

ilPCInteractiveImage::init ( )

Init page content component.

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

References $DIC, and ilPageContent\setType().

33  {
34  global $DIC;
35 
36  $this->lng = $DIC->language();
37  $this->setType("iim");
38  }
global $DIC
Definition: saml.php:7
setType($a_type)
Set Type.
+ 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 45 of file class.ilPCInteractiveImage.php.

References setMediaObject().

46  {
47  if ($a_mob_id > 0) {
48  $mob = new ilObjMediaObject($a_mob_id);
49  $this->setMediaObject($mob);
50  }
51  }
Class ilObjMediaObject.
setMediaObject($a_mediaobject)
Set Media Object.
+ Here is the call graph for this function:

◆ savePopups()

ilPCInteractiveImage::savePopups (   $a_popups)

Save popups.

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

References ilPageContent\$hier_id, and $i.

300  {
301  $childs = $this->iim_node->child_nodes();
302  for ($i = 0; $i < count($childs); $i++) {
303  if ($childs[$i]->node_name() == "ContentPopup") {
304  $pc_id = $childs[$i]->get_attribute("PCID");
305  $hier_id = $childs[$i]->get_attribute("HierId");
306  $k = $hier_id . ":" . $pc_id;
307  $childs[$i]->set_attribute("Title", $a_popups[$k]);
308  }
309  }
310  }
$i
Definition: disco.tpl.php:19

◆ setDom()

ilPCInteractiveImage::setDom ( $a_dom)

Set dom object.

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

82  {
83  $this->dom = $a_dom;
84  }

◆ setExtLinkTitle()

ilPCInteractiveImage::setExtLinkTitle (   $a_nr,
  $a_title 
)

Set ExtLink Title.

Parameters

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

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

Referenced by setTriggerTitles().

705  {
706  if ($this->getPcId() != "") {
707  $xpc = xpath_new_context($this->dom);
708  $path = "//PageContent[@PCID = '" . $this->getPcId() . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
709  $res = xpath_eval($xpc, $path);
710  if (count($res->nodeset) > 0) {
711  $res->nodeset[0]->set_content($a_title);
712  }
713  return;
714  }
715 
716  $xpc = xpath_new_context($this->dom);
717  $path = "//PageContent[@HierId = '" . $this->hier_id . "']/InteractiveImage/MediaAliasItem/MapArea[@Id='" . $a_nr . "']/ExtLink";
718  $res = xpath_eval($xpc, $path);
719  if (count($res->nodeset) > 0) {
720  $res->nodeset[0]->set_content($a_title);
721  }
722  }
$path
Definition: aliased.php:25
xpath_new_context($dom_document)
xpath_eval($xpath_context, $eval_str, $contextnode=null)
foreach($_POST as $key=> $value) $res
+ 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 91 of file class.ilPCInteractiveImage.php.

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

92  {
93  $this->mediaobject = $a_mediaobject;
94  }
+ Here is the caller graph for this function:

◆ setNode()

ilPCInteractiveImage::setNode (   $a_node)

Set node (and media object node)

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

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

57  {
58  parent::setNode($a_node); // this is the PageContent node
59  $this->iim_node = $a_node->first_child();
60  $this->med_alias_node = $this->iim_node->first_child();
61  if (is_object($this->med_alias_node) && $this->med_alias_node->myDOMNode != null) {
62  $id = $this->med_alias_node->get_attribute("OriginId");
64  if (ilObject::_lookupType($mob_id) == "mob") {
65  $this->setMediaObject(new ilObjMediaObject($mob_id));
66  }
67  }
68  include_once("./Services/COPage/classes/class.ilMediaAliasItem.php");
69  $this->std_alias_item = new ilMediaAliasItem(
70  $this->dom,
71  $this->readHierId(),
72  "Standard",
73  $this->readPCId(),
74  "InteractiveImage"
75  );
76  }
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilMediaAliasItem.
readPCId()
Read PC Id.
Class ilObjMediaObject.
static _lookupType($a_id, $a_reference=false)
lookup object type
setMediaObject($a_mediaobject)
Set Media Object.
readHierId()
Read PC Id.
+ Here is the call graph for this function:

◆ setStyleClass()

ilPCInteractiveImage::setStyleClass (   $a_class)

Set style class.

Parameters
string$a_classstyle class

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

215  {
216  // check this
217  die("pcinteractiveimage: setstyleclass");
218  if (is_object($this->iim_node)) {
219  $mal_node = $this->iim_node->first_child();
220  if (is_object($mal_node)) {
221  if (!empty($a_class)) {
222  $mal_node->set_attribute("Class", $a_class);
223  } else {
224  if ($mal_node->has_attribute("Class")) {
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 607 of file class.ilPCInteractiveImage.php.

References $i, and getTriggerNodes().

608  {
609  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
610  for ($i = 0; $i < count($tr_nodes); $i++) {
611  $tr_node = $tr_nodes[$i];
612  if ($tr_node->get_attribute("Type") == self::MARKER) {
613  if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
614  $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
615  $tr_node->set_attribute("MarkerX", (int) $pos[0]);
616  $tr_node->set_attribute("MarkerY", (int) $pos[1]);
617  }
618  }
619  }
620  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 589 of file class.ilPCInteractiveImage.php.

References $i, and getTriggerNodes().

590  {
591  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
592  for ($i = 0; $i < count($tr_nodes); $i++) {
593  $tr_node = $tr_nodes[$i];
594  if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
595  $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
596  $tr_node->set_attribute("OverlayX", (int) $pos[0]);
597  $tr_node->set_attribute("OverlayY", (int) $pos[1]);
598  }
599  }
600  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 570 of file class.ilPCInteractiveImage.php.

References $i, and getTriggerNodes().

571  {
572  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
573  for ($i = 0; $i < count($tr_nodes); $i++) {
574  $tr_node = $tr_nodes[$i];
575  if (isset($a_ovs["" . $tr_node->get_attribute("Nr")])) {
576  $tr_node->set_attribute(
577  "Overlay",
578  $a_ovs["" . $tr_node->get_attribute("Nr")]
579  );
580  }
581  }
582  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 627 of file class.ilPCInteractiveImage.php.

References $i, and getTriggerNodes().

628  {
629  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
630  for ($i = 0; $i < count($tr_nodes); $i++) {
631  $tr_node = $tr_nodes[$i];
632  if (isset($a_pos["" . $tr_node->get_attribute("Nr")])) {
633  $pos = explode(",", $a_pos["" . $tr_node->get_attribute("Nr")]);
634  $tr_node->set_attribute("PopupX", (int) $pos[0]);
635  $tr_node->set_attribute("PopupY", (int) $pos[1]);
636  }
637  }
638  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 663 of file class.ilPCInteractiveImage.php.

References $i, and getTriggerNodes().

664  {
665  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
666  for ($i = 0; $i < count($tr_nodes); $i++) {
667  $tr_node = $tr_nodes[$i];
668  if (isset($a_pops["" . $tr_node->get_attribute("Nr")])) {
669  $pop = $a_pops["" . $tr_node->get_attribute("Nr")];
670  $tr_node->set_attribute("PopupNr", $pop);
671  }
672  }
673  }
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 645 of file class.ilPCInteractiveImage.php.

References $i, $size, and getTriggerNodes().

646  {
647  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
648  for ($i = 0; $i < count($tr_nodes); $i++) {
649  $tr_node = $tr_nodes[$i];
650  if (isset($a_size["" . $tr_node->get_attribute("Nr")])) {
651  $size = explode(",", $a_size["" . $tr_node->get_attribute("Nr")]);
652  $tr_node->set_attribute("PopupWidth", (int) $size[0]);
653  $tr_node->set_attribute("PopupHeight", (int) $size[1]);
654  }
655  }
656  }
$size
Definition: RandomTest.php:84
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ 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 680 of file class.ilPCInteractiveImage.php.

References $i, getTriggerNodes(), and setExtLinkTitle().

681  {
682  $tr_nodes = $this->getTriggerNodes($this->hier_id, $this->getPcId());
683  for ($i = 0; $i < count($tr_nodes); $i++) {
684  $tr_node = $tr_nodes[$i];
685  if (isset($a_titles["" . $tr_node->get_attribute("Nr")])) {
686  $tr_node->set_attribute(
687  "Title",
688  $a_titles["" . $tr_node->get_attribute("Nr")]
689  );
690  $this->setExtLinkTitle(
691  $tr_node->get_attribute("Nr"),
692  $a_titles["" . $tr_node->get_attribute("Nr")]
693  );
694  }
695  }
696  }
setExtLinkTitle($a_nr, $a_title)
Set ExtLink Title.
getTriggerNodes($a_hier_id, $a_pc_id="")
Get trigger nodes.
$i
Definition: disco.tpl.php:19
+ Here is the call graph for this function:

Field Documentation

◆ $dom

ilPCInteractiveImage::$dom

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

◆ $iim_node

ilPCInteractiveImage::$iim_node

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

◆ $lng

ilPCInteractiveImage::$lng
protected

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

Referenced by addContentPopup(), and addTriggerMarker().

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