Public Member Functions | |
ilMediaAliasItem (&$a_dom, $a_hier_id, $a_purpose) | |
exists () | |
check if item node exists | |
insert () | |
inserts new node in dom | |
setWidth ($a_width) | |
getWidth () | |
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) | |
getHeight () | |
setCaption ($a_caption) | |
getCaption () | |
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) | |
delete () | |
delete full item node from dom | |
Data Fields | |
$dom | |
$hier_id | |
$purpose | |
$item_node |
Definition at line 35 of file class.ilMediaAliasItem.php.
ilMediaAliasItem::definesCaption | ( | ) |
check if alias item defines own caption or derives caption from object
Definition at line 198 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."']/Caption"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) > 0) { return true; } return false; }
ilMediaAliasItem::definesParameters | ( | ) |
check if alias item defines own parameters or derives parameters from object
Definition at line 308 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."']/Parameter"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) > 0) { return true; } return false; }
ilMediaAliasItem::definesSize | ( | ) |
check if alias item defines own size or derives size from object
Definition at line 117 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."']/Layout"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $layout_node =& $res->nodeset[0]; return $layout_node->has_attribute("Width"); } return false; }
ilMediaAliasItem::delete | ( | ) |
delete full item node from dom
Definition at line 341 of file class.ilMediaAliasItem.php.
{
if (is_object($this->item_node))
{
$this->item_node->unlink_node($this->item_node);
}
}
ilMediaAliasItem::deriveCaption | ( | ) |
derive caption from object (-> caption element is removed from media alias item)
Definition at line 213 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."']/Caption"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) > 0) { $caption_node =& $res->nodeset[0]; $caption_node->unlink_node($caption_node); } }
ilMediaAliasItem::deriveParameters | ( | ) |
derive parameters from object (-> all parameter elements are removed from media alias item)
Definition at line 323 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."']/Parameter"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) > 0) { for($i=0; $i < count($res->nodeset); $i++) { $par_node =& $res->nodeset[$i]; $par_node->unlink_node($par_node); } } }
ilMediaAliasItem::deriveSize | ( | ) |
derive size from object (-> width and height attributes are removed from layout element)
Definition at line 133 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."']/Layout"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $layout_node =& $res->nodeset[0]; if ($layout_node->has_attribute("Width")) { $layout_node->remove_attribute("Width"); } if ($layout_node->has_attribute("Height")) { $layout_node->remove_attribute("Height"); } } }
ilMediaAliasItem::exists | ( | ) |
check if item node exists
Definition at line 62 of file class.ilMediaAliasItem.php.
{ if (is_object($this->item_node)) { return true; } else { return false; } }
ilMediaAliasItem::getCaption | ( | ) |
Definition at line 181 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."']/Caption"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $caption_node =& $res->nodeset[0]; return $caption_node->get_content(); } }
ilMediaAliasItem::getHeight | ( | ) |
Definition at line 160 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."']/Layout"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $layout_node =& $res->nodeset[0]; return $layout_node->get_attribute("Height"); } }
ilMediaAliasItem::getHorizontalAlign | ( | ) |
Definition at line 233 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."']/Layout"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $layout_node =& $res->nodeset[0]; return $layout_node->get_attribute("HorizontalAlign"); } }
ilMediaAliasItem::getParameter | ( | $ | a_name | ) |
ilMediaAliasItem::getParameterString | ( | ) |
get all parameters
Definition at line 281 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."']/Parameter"; $res =& xpath_eval($xpc, $path); $par_arr = array(); for($i=0; $i < count($res->nodeset); $i++) { $par_node =& $res->nodeset[$i]; $par_arr[] = $par_node->get_attribute("Name")."=\"".$par_node->get_attribute("Value")."\""; } return implode($par_arr, ", "); }
ilMediaAliasItem::getWidth | ( | ) |
Definition at line 100 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."']/Layout"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) == 1) { $layout_node =& $res->nodeset[0]; return $layout_node->get_attribute("Width"); } }
ilMediaAliasItem::ilMediaAliasItem | ( | &$ | a_dom, | |
$ | a_hier_id, | |||
$ | a_purpose | |||
) |
Definition at line 42 of file class.ilMediaAliasItem.php.
References $res, xpath_eval(), and xpath_new_context().
{ $this->dom =& $a_dom; $this->hier_id = $a_hier_id; $this->purpose = $a_purpose; $xpc = xpath_new_context($this->dom); $path = "//PageContent[@HierId = '".$this->hier_id."']/MediaObject/MediaAliasItem[@Purpose='$a_purpose']"; $res =& xpath_eval($xpc, $path); if (count($res->nodeset) > 0) { $this->item_node =& $res->nodeset[0]; } }
ilMediaAliasItem::insert | ( | ) |
inserts new node in dom
Definition at line 77 of file class.ilMediaAliasItem.php.
References $item_node, $res, xpath_eval(), and xpath_new_context().
{ $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; } }
ilMediaAliasItem::setCaption | ( | $ | a_caption | ) |
Definition at line 173 of file class.ilMediaAliasItem.php.
References ilDOMUtil::setFirstOptionalElement().
{ ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Caption", array("Parameter"), $a_caption, array("Align" => "bottom")); }
ilMediaAliasItem::setHeight | ( | $ | a_height | ) |
Definition at line 152 of file class.ilMediaAliasItem.php.
References ilDOMUtil::setFirstOptionalElement().
{ ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout", array("Caption", "Parameter"), "", array("Height" => $a_height), false); }
ilMediaAliasItem::setHorizontalAlign | ( | $ | a_halign | ) |
Definition at line 225 of file class.ilMediaAliasItem.php.
References ilDOMUtil::setFirstOptionalElement().
{ ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout", array("Caption", "Parameter"), "", array("HorizontalAlign" => $a_halign), false); }
ilMediaAliasItem::setParameters | ( | $ | a_par_array | ) |
set parameter
note: parameter tags are simply appended to the item node, so if current element definition (MediaAliasItem (Layout?, Caption?, Parameter*)>) changes, adoptions may be necessary
Definition at line 253 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."']/Parameter"; $res =& xpath_eval($xpc, $path); $par_arr = array(); for($i=0; $i < count($res->nodeset); $i++) { $par_node =& $res->nodeset[$i]; $par_node->unlink_node($par_node); } if (is_array($a_par_array)) { foreach($a_par_array as $par => $val) { $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); } } }
ilMediaAliasItem::setWidth | ( | $ | a_width | ) |
Definition at line 92 of file class.ilMediaAliasItem.php.
References ilDOMUtil::setFirstOptionalElement().
{ ilDOMUtil::setFirstOptionalElement($this->dom, $this->item_node, "Layout", array("Caption", "Parameter"), "", array("Width" => $a_width), false); }
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.