ILIAS  Release_4_0_x_branch Revision 61816
 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)
 setTextRepresentation ($a_text_representation)
 Set TextRepresentation.
 getTextRepresentation ()
 Get TextRepresentation.
 definesTextRepresentation ()
 check if alias item defines own TextRepresentation or derives TextRepresentation from object
 deriveTextRepresentation ()
 derive TextRepresentation from object (-> TextRepresentation element is removed from media alias item)
 setHorizontalAlign ($a_halign)
 getHorizontalAlign ()
 setParameters ($a_par_array)
 set parameter
 getParameterString ()
 Get all parameters as string.
 getParameters ()
 Get all parameters as array.
 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 27153 2011-01-04 10:47:03Z akill

Definition at line 14 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 574 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 270 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 438 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 185 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::definesTextRepresentation ( )

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

Returns
boolean returns true if TextRepresentation is not derived from object

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

References getMAItemNode(), and getPcId().

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

+ Here is the call graph for this function:

ilMediaAliasItem::delete ( )

delete full item node from dom

Definition at line 719 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 614 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 601 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 284 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 452 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 199 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::deriveTextRepresentation ( )

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

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

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

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

+ 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 126 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 255 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\getAliasValues().

{
$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 230 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\getAliasValues(), ilPCMediaObjectGUI\initAliasForm(), 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 354 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 691 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 628 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 33 of file class.ilMediaAliasItem.php.

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

Referenced by definesCaption(), definesSize(), definesTextRepresentation(), deriveCaption(), deriveSize(), deriveTextRepresentation(), getCaption(), getHeight(), getHorizontalAlign(), getTextRepresentation(), 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 78 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 470 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 429 of file class.ilMediaAliasItem.php.

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

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

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

Referenced by definesParameters(), deriveParameters(), getParameters(), 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::getParameters ( )

Get all parameters as array.

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

References getParameterNodes(), and getPcId().

Referenced by ilPCMediaObjectGUI\initAliasForm().

{
$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 $par_arr;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilMediaAliasItem::getParameterString ( )

Get all parameters as string.

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

References getParameterNodes(), and getPcId().

Referenced by ilPCMediaObjectGUI\getAliasValues().

{
$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 677 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 663 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::getTextRepresentation ( )

Get TextRepresentation.

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

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\getAliasValues().

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

+ 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 705 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 649 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 170 of file class.ilMediaAliasItem.php.

References getMAItemNode(), and getPcId().

Referenced by ilPCMediaObjectGUI\getAliasValues(), 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 21 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 141 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 733 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 (first see whether the instance has w/h defined)
$width = $this->getWidth();
$height = $this->getHeight();
// if instance has no size, use object w/h
if ($width == 0 && $height == 0)
{
$width = $a_st_item->getWidth();
$height = $a_st_item->getHeight();
}
$size = @getimagesize($a_st_item->getMapWorkCopyName());
$x_ratio = 1;
if ($size[0] > 0 && $width > 0)
{
$x_ratio = $width / $size[0];
}
$y_ratio = 1;
if ($size[1] > 0 && $height > 0)
{
$y_ratio = $height / $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 543 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 525 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 507 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 244 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Caption",
array("TextRepresentation", "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 219 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
array("Caption", "TextRepresentation", "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 346 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", "TextRepresentation", "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 367 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 106 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 560 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::setTextRepresentation (   $a_text_representation)

Set TextRepresentation.

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

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "TextRepresentation",
array("Parameter", "MapArea"),
$a_text_representation, array());
}

+ 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 159 of file class.ilMediaAliasItem.php.

References ilDOMUtil\setFirstOptionalElement().

Referenced by ilPCMediaObjectGUI\saveAliasProperties().

{
ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout",
array("Caption", "TextRepresentation", "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 16 of file class.ilMediaAliasItem.php.

ilMediaAliasItem::$hier_id

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

ilMediaAliasItem::$item_node

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

Referenced by insert().

ilMediaAliasItem::$purpose

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


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