ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMediaAliasItem Class Reference

Class ilMediaAliasItem. More...

+ Collaboration diagram for ilMediaAliasItem:

Public Member Functions

 ilMediaAliasItem (&$a_dom, $a_hier_id, $a_purpose, $a_pc_id="")
 getMAItemNode ($a_hier_id, $a_purpose, $a_pc_id="", $a_sub_element="")
 getParameterNodes ($a_hier_id, $a_purpose, $a_pc_id="")
 getMapAreaNodes ($a_hier_id, $a_purpose, $a_pc_id="")
 setPcId ($a_pcid)
 Set PC Id.
 getPcId ()
 Get PC Id.
 exists ()
 check if item node exists
 insert ()
 inserts new node in dom
 setWidth ($a_width)
 Set width.
 getWidth ()
 Get width.
 definesSize ()
 check if alias item defines own size or derives size from object
 deriveSize ()
 derive size from object (-> width and height attributes are removed from layout element)
 setHeight ($a_height)
 Set Height.
 getHeight ()
 Get Height.
 setCaption ($a_caption)
 Set Caption.
 getCaption ()
 Get Caption.
 definesCaption ()
 check if alias item defines own caption or derives caption from object
 deriveCaption ()
 derive caption from object (-> caption element is removed from media alias item)
 setHorizontalAlign ($a_halign)
 getHorizontalAlign ()
 setParameters ($a_par_array)
 set parameter
 getParameterString ()
 get all parameters
 getParameter ($a_name)
 get a single parameter
 definesParameters ()
 check if alias item defines own parameters or derives parameters from object
 deriveParameters ()
 derive parameters from object (-> all parameter elements are removed from media alias item)
 getMapAreas ()
 Get all map areas.
 setAreaTitle ($a_nr, $a_title)
 Set title of area.
 setAreaIntLink ($a_nr, $a_type, $a_target, $a_target_frame)
 Set link of area to an internal one.
 setAreaExtLink ($a_nr, $a_href)
 Set link of area to an external one.
 setShape ($a_nr, $a_shape_type, $a_coords)
 Set shape and coords of single area.
 addMapArea ($a_shape_type, $a_coords, $a_title, $a_link)
 Add a new area to the map.
 deleteMapArea ($a_nr)
 Delete a sinlge map area.
 deleteAllMapAreas ()
 Delete all map areas.
 getLinkTypeOfArea ($a_nr)
 Get link type.
 getTypeOfArea ($a_nr)
 Get type (only interna link.
 getTargetOfArea ($a_nr)
 Get target (only interna link.
 getTargetFrameOfArea ($a_nr)
 Get target frame (only interna link.
 getHrefOfArea ($a_nr)
 Get href (only external link)
 getTitleOfArea ($a_nr)
 Get title.
 delete ()
 delete full item node from dom
 makeMapWorkCopy ($a_st_item, $a_area_nr=0, $a_exclude=false, $a_output_new_area, $a_area_type, $a_coords)
 make map work copy of image

Data Fields

 $dom
 $hier_id
 $purpose
 $item_node

Detailed Description

Class ilMediaAliasItem.

Media Alias Item, component of a media object (file or reference)

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
Id:
class.ilMediaAliasItem.php 17399 2008-09-15 21:26:52Z akill

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

Member Function Documentation

ilMediaAliasItem::addMapArea (   $a_shape_type,
  $a_coords,
  $a_title,
  $a_link 
)

Add a new area to the map.

Definition at line 527 of file class.ilMediaAliasItem.php.

References ilDOMUtil\addElementToList(), and ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCImageMapEditorGUI\saveArea().

{
$attributes = array("Shape" => $a_shape_type,
"Coords" => $a_coords);
$ma_node = ilDOMUtil::addElementToList($this->dom, $this->item_node,
"MapArea", array(), "", $attributes);
if ($a_link["LinkType"] == "int" || $a_link["LinkType"] == "IntLink")
{
$attributes = array("Type" => $a_link["Type"],
"TargetFrame" => $a_link["TargetFrame"],
"Target" => $a_link["Target"]);
ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "IntLink",
array(""), $a_title, $attributes);
}
if ($a_link["LinkType"] == "ext" || $a_link["LinkType"] == "ExtLink")
{
$attributes = array("Href" => $a_link["Href"]);
ilDOMUtil::setFirstOptionalElement($this->dom, $ma_node, "ExtLink",
array(""), $a_title, $attributes);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::definesCaption ( )

check if alias item defines own caption or derives caption from object

Returns
boolean returns true if caption is not derived from object

Definition at line 291 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

{
$caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Caption");
if (is_object($caption_node))
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMediaAliasItem::definesParameters ( )

check if alias item defines own parameters or derives parameters from object

Returns
boolean returns true if parameters are not derived from object

Definition at line 391 of file class.ilMediaAliasItem.php.

References getParameterNodes(), and getPcId().

{
$par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (count($par_nodes) > 0)
{
return true;
}
return false;
}

+ Here is the call graph for this function:

ilMediaAliasItem::definesSize ( )

check if alias item defines own size or derives size from object

Returns
boolean returns true if size is not derived from object

Definition at line 206 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

{
$layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Layout");
if (is_object($layout_node))
{
return $layout_node->has_attribute("Width");
}
return false;
}

+ Here is the call graph for this function:

ilMediaAliasItem::delete ( )

delete full item node from dom

Definition at line 672 of file class.ilMediaAliasItem.php.

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
if (is_object($this->item_node))
{
$this->item_node->unlink_node($this->item_node);
}
}

+ Here is the caller graph for this function:

ilMediaAliasItem::deleteAllMapAreas ( )

Delete all map areas.

Definition at line 567 of file class.ilMediaAliasItem.php.

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

{
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@HierId = '".$this->hier_id."']/MediaObject/MediaAliasItem[@Purpose='".$this->purpose."']/MapArea";
$res =& xpath_eval($xpc, $path);
for ($i = 0; $i < count($res->nodeset); $i++)
{
$res->nodeset[$i]->unlink_node($res->nodeset[$i]);
}
}

+ Here is the call graph for this function:

ilMediaAliasItem::deleteMapArea (   $a_nr)

Delete a sinlge map area.

Definition at line 554 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\deleteAreas().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$ma_nodes[$a_nr - 1]->unlink_node($ma_nodes[$a_nr - 1]);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::deriveCaption ( )

derive caption from object (-> caption element is removed from media alias item)

Definition at line 305 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
$caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Caption");
if (is_object($caption_node))
{
$caption_node->unlink_node($caption_node);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::deriveParameters ( )

derive parameters from object (-> all parameter elements are removed from media alias item)

Definition at line 405 of file class.ilMediaAliasItem.php.

References getParameterNodes(), and getPcId().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
$par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (count($par_nodes) > 0)
{
for($i=0; $i < count($par_nodes); $i++)
{
$par_node =& $par_nodes[$i];
$par_node->unlink_node($par_node);
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::deriveSize ( )

derive size from object (-> width and height attributes are removed from layout element)

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

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
$layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Layout");
if (is_object($layout_node))
{
if ($layout_node->has_attribute("Width"))
{
$layout_node->remove_attribute("Width");
}
if ($layout_node->has_attribute("Height"))
{
$layout_node->remove_attribute("Height");
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::exists ( )

check if item node exists

Returns
boolean returns true if item node exists

Definition at line 147 of file class.ilMediaAliasItem.php.

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
if (is_object($this->item_node))
{
return true;
}
else
{
return false;
}
}

+ Here is the caller graph for this function:

ilMediaAliasItem::getCaption ( )

Get Caption.

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

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\editAlias().

{
$caption_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Caption");
if (is_object($caption_node))
{
return $caption_node->get_content();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getHeight ( )

Get Height.

Definition at line 251 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\editAlias(), and makeMapWorkCopy().

{
$layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Layout");
if (is_object($layout_node))
{
return $layout_node->get_attribute("Height");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getHorizontalAlign ( )

Definition at line 323 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

{
$layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Layout");
if (is_object($layout_node))
{
return $layout_node->get_attribute("HorizontalAlign");
}
}

+ Here is the call graph for this function:

ilMediaAliasItem::getHrefOfArea (   $a_nr)

Get href (only external link)

Definition at line 644 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\getHrefOfArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
return $childs[0]->get_attribute("Href");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getLinkTypeOfArea (   $a_nr)

Get link type.

Definition at line 581 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\getLinkTypeOfArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
if ($childs[0]->node_name() == "IntLink")
{
return "int";
}
if ($childs[0]->node_name() == "ExtLink")
{
return "ext";
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getMAItemNode (   $a_hier_id,
  $a_purpose,
  $a_pc_id = "",
  $a_sub_element = "" 
)

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

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

Referenced by definesCaption(), definesSize(), deriveCaption(), deriveSize(), getCaption(), getHeight(), getHorizontalAlign(), getWidth(), and ilMediaAliasItem().

{
if ($a_pc_id != "")
{
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@PCID = '".$a_pc_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) == 1)
{
return $res->nodeset[0];
}
}
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@HierId = '".$a_hier_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']".$a_sub_element;
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
return $res->nodeset[0];
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getMapAreaNodes (   $a_hier_id,
  $a_purpose,
  $a_pc_id = "" 
)

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

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

Referenced by deleteMapArea(), getHrefOfArea(), getLinkTypeOfArea(), getMapAreas(), getTargetFrameOfArea(), getTargetOfArea(), getTitleOfArea(), getTypeOfArea(), setAreaExtLink(), setAreaIntLink(), setAreaTitle(), and setShape().

{
if ($a_pc_id != "")
{
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@PCID = '".$a_pc_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
return $res->nodeset;
}
return array();
}
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@HierId = '".$a_hier_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/MapArea";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
return $res->nodeset;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getMapAreas ( )

Get all map areas.

Definition at line 423 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapTableGUI\getItems(), makeMapWorkCopy(), and ilPCImageMapEditorGUI\updateAreas().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
$maparea_arr = array();
for($i=0; $i < count($ma_nodes); $i++)
{
$maparea_node = $ma_nodes[$i];
$childs = $maparea_node->child_nodes();
$link = array();
if ($childs[0]->node_name() == "ExtLink")
{
$link = array("LinkType" => "ExtLink",
"Href" => $childs[0]->get_attribute("Href"),
"Title" => $childs[0]->get_content());
}
if ($childs[0]->node_name() == "IntLink")
{
$link = array("LinkType" => "IntLink",
"Target" => $childs[0]->get_attribute("Target"),
"Type" => $childs[0]->get_attribute("Type"),
"TargetFrame" => $childs[0]->get_attribute("TargetFame"),
"Title" => $childs[0]->get_content());
}
$maparea_arr[] = array(
"Nr" => $i + 1,
"Shape" => $maparea_node->get_attribute("Shape"),
"Coords" => $maparea_node->get_attribute("Coords"),
"Link" => $link);
}
return $maparea_arr;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getParameter (   $a_name)

get a single parameter

Definition at line 382 of file class.ilMediaAliasItem.php.

{
}
ilMediaAliasItem::getParameterNodes (   $a_hier_id,
  $a_purpose,
  $a_pc_id = "" 
)

Definition at line 76 of file class.ilMediaAliasItem.php.

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

Referenced by definesParameters(), deriveParameters(), getParameterString(), and setParameters().

{
if ($a_pc_id != "")
{
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@PCID = '".$a_pc_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
return $res->nodeset;
}
return array();
}
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@HierId = '".$a_hier_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']/Parameter";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
return $res->nodeset;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getParameterString ( )

get all parameters

Definition at line 365 of file class.ilMediaAliasItem.php.

References getParameterNodes(), and getPcId().

Referenced by ilPCMediaObjectGUI\editAlias().

{
$par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
$this->getPcId());
$par_arr = array();
for($i=0; $i < count($par_nodes); $i++)
{
$par_node =& $par_nodes[$i];
$par_arr[] = $par_node->get_attribute("Name")."=\"".$par_node->get_attribute("Value")."\"";
}
return implode($par_arr, ", ");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getTargetFrameOfArea (   $a_nr)

Get target frame (only interna link.

Definition at line 630 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\getTargetFrameOfArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
return $childs[0]->get_attribute("TargetFrame");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getTargetOfArea (   $a_nr)

Get target (only interna link.

Definition at line 616 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\getTargetOfArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
return $childs[0]->get_attribute("Target");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getTitleOfArea (   $a_nr)

Get title.

Definition at line 658 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by setAreaExtLink(), and setAreaIntLink().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
return $childs[0]->get_content();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getTypeOfArea (   $a_nr)

Get type (only interna link.

Definition at line 602 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\getTypeOfArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
return $childs[0]->get_attribute("Type");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getWidth ( )

Get width.

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

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\editAlias(), and makeMapWorkCopy().

{
$layout_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId(), "/Layout");
if (is_object($layout_node))
{
return $layout_node->get_attribute("Width");
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::ilMediaAliasItem ( $a_dom,
  $a_hier_id,
  $a_purpose,
  $a_pc_id = "" 
)

Definition at line 42 of file class.ilMediaAliasItem.php.

References getMAItemNode(), getPcId(), and setPcId().

{
$this->dom =& $a_dom;
$this->hier_id = $a_hier_id;
$this->purpose = $a_purpose;
$this->setPcId($a_pc_id);
//echo "+$a_pc_id+";
$this->item_node = $this->getMAItemNode($this->hier_id, $this->purpose,
$this->getPcId());
//var_dump($this->item_node);
}

+ Here is the call graph for this function:

ilMediaAliasItem::insert ( )

inserts new node in dom

Definition at line 162 of file class.ilMediaAliasItem.php.

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

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
$xpc = xpath_new_context($this->dom);
$path = "//PageContent[@HierId = '".$this->hier_id."']/MediaObject";
$res =& xpath_eval($xpc, $path);
if (count($res->nodeset) > 0)
{
$obj_node =& $res->nodeset[0];
$item_node =& $this->dom->create_element("MediaAliasItem");
$item_node =& $obj_node->append_child($item_node);
$item_node->set_attribute("Purpose", $this->purpose);
$this->item_node =& $item_node;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::makeMapWorkCopy (   $a_st_item,
  $a_area_nr = 0,
  $a_exclude = false,
  $a_output_new_area,
  $a_area_type,
  $a_coords 
)

make map work copy of image

Parameters
int$a_area_nrdraw area $a_area_nr only
boolean$a_excludetrue: draw all areas but area $a_area_nr

Definition at line 686 of file class.ilMediaAliasItem.php.

References $lng, $size, getHeight(), getMapAreas(), and getWidth().

Referenced by ilPCImageMapEditorGUI\makeMapWorkCopy().

{
global $lng;
if (!$a_st_item->copyOriginal())
{
return false;
}
$a_st_item->buildMapWorkImage();
// determine ratios
$size = @getimagesize($a_st_item->getMapWorkCopyName());
$x_ratio = 1;
if ($size[0] > 0 && $this->getWidth() > 0)
{
$x_ratio = $this->getWidth() / $size[0];
}
$y_ratio = 1;
if ($size[1] > 0 && $this->getHeight() > 0)
{
$y_ratio = $this->getHeight() / $size[1];
}
// draw map areas
$areas = $this->getMapAreas();
for ($i=0; $i < count($areas); $i++)
{
if ( ((($i+1) == $a_area_nr) && !$a_exclude) ||
((($i+1) != $a_area_nr) && $a_exclude) ||
($a_area_nr == 0)
)
{
$area = new ilMapArea();
$area->setShape($areas[$i]["Shape"]);
$area->setCoords($areas[$i]["Coords"]);
$area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, true,
$x_ratio, $y_ratio);
}
}
if ($a_output_new_area)
{
$area = new ilMapArea();
$area->setShape($a_area_type);
$area->setCoords($a_coords);
$area->draw($a_st_item->getMapWorkImage(), $a_st_item->color1, $a_st_item->color2, false,
$x_ratio, $y_ratio);
}
$a_st_item->saveMapWorkImage();
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setAreaExtLink (   $a_nr,
  $a_href 
)

Set link of area to an external one.

Definition at line 496 of file class.ilMediaAliasItem.php.

References $title, ilDOMUtil\deleteAllChildsByName(), getMapAreaNodes(), getPcId(), getTitleOfArea(), and ilDOMUtil\setFirstOptionalElement().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$title = $this->getTitleOfArea($a_nr);
ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
$attributes = array("Href" => $a_href);
ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "ExtLink",
array(""), $title, $attributes);
}
}

+ Here is the call graph for this function:

ilMediaAliasItem::setAreaIntLink (   $a_nr,
  $a_type,
  $a_target,
  $a_target_frame 
)

Set link of area to an internal one.

Definition at line 478 of file class.ilMediaAliasItem.php.

References $title, ilDOMUtil\deleteAllChildsByName(), getMapAreaNodes(), getPcId(), getTitleOfArea(), and ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCImageMapEditorGUI\saveArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$title = $this->getTitleOfArea($a_nr);
ilDOMUtil::deleteAllChildsByName($ma_nodes[$a_nr - 1], array("IntLink", "ExtLink"));
$attributes = array("Type" => $a_type, "Target" => $a_target,
"TargetFrame" => $a_target_frame);
ilDOMUtil::setFirstOptionalElement($this->dom, $ma_nodes[$a_nr - 1], "IntLink",
array(""), $title, $attributes);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setAreaTitle (   $a_nr,
  $a_title 
)

Set title of area.

Definition at line 460 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$childs = $ma_nodes[$a_nr - 1]->child_nodes();
if (is_object($childs[0]) &&
($childs[0]->node_name() == "IntLink" || $childs[0]->node_name() == "ExtLink"))
{
$childs[0]->set_content($a_title);
}
}
}

+ Here is the call graph for this function:

ilMediaAliasItem::setCaption (   $a_caption)

Set Caption.

Definition at line 265 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Caption",
array("Parameter", "MapArea"),
$a_caption, array("Align" => "bottom"));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setHeight (   $a_height)

Set Height.

Definition at line 240 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
array("Caption", "Parameter", "MapArea"),
"", array("Height" => $a_height), false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setHorizontalAlign (   $a_halign)

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

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\centerAlign(), ilPCMediaObjectGUI\leftAlign(), ilPCMediaObjectGUI\leftFloatAlign(), ilPCMediaObjectGUI\rightAlign(), and ilPCMediaObjectGUI\rightFloatAlign().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
array("Caption", "Parameter", "MapArea"),
"", array("HorizontalAlign" => $a_halign), false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setParameters (   $a_par_array)

set parameter

Definition at line 336 of file class.ilMediaAliasItem.php.

References ilDOMUtil\addElementToList(), getParameterNodes(), and getPcId().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
$par_nodes = $this->getParameterNodes($this->hier_id, $this->purpose,
$this->getPcId());
$par_arr = array();
for($i=0; $i < count($par_nodes); $i++)
{
$par_node =& $par_nodes[$i];
$par_node->unlink_node($par_node);
}
if (is_array($a_par_array))
{
foreach($a_par_array as $par => $val)
{
$attributes = array ("Name" => $par, "Value" => $val);
ilDOMUtil::addElementToList($this->dom, $this->item_node,
"Parameter", array("MapArea"), "", $attributes);
/* $par_node =& $this->dom->create_element("Parameter");
$par_node =& $this->item_node->append_child($par_node);
$par_node->set_attribute("Name", $par);
$par_node->set_attribute("Value", $val); */
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setPcId (   $a_pcid)

Set PC Id.

Parameters
string$a_pcidPC Id

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

Referenced by ilMediaAliasItem().

{
$this->pcid = $a_pcid;
}

+ Here is the caller graph for this function:

ilMediaAliasItem::setShape (   $a_nr,
  $a_shape_type,
  $a_coords 
)

Set shape and coords of single area.

Definition at line 513 of file class.ilMediaAliasItem.php.

References getMapAreaNodes(), and getPcId().

Referenced by ilPCImageMapEditorGUI\saveArea().

{
$ma_nodes = $this->getMapAreaNodes($this->hier_id, $this->purpose,
$this->getPcId());
if (is_object($ma_nodes[$a_nr - 1]))
{
$ma_nodes[$a_nr - 1]->set_attribute("Shape", $a_shape_type);
$ma_nodes[$a_nr - 1]->set_attribute("Coords", $a_coords);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::setWidth (   $a_width)

Set width.

Definition at line 180 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
array("Caption", "Parameter", "MapArea"),
"", array("Width" => $a_width), false);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilMediaAliasItem::$dom

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

ilMediaAliasItem::$hier_id

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

ilMediaAliasItem::$item_node

Definition at line 40 of file class.ilMediaAliasItem.php.

Referenced by insert().

ilMediaAliasItem::$purpose

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


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