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

Class ilPCMediaObject. More...

+ Inheritance diagram for ilPCMediaObject:
+ Collaboration diagram for ilPCMediaObject:

Public Member Functions

 init ()
 Init page content component.
 readMediaObject ($a_mob_id=0)
 Read/get Media Object.
 setNode (&$a_node)
 Set xml node of page content.
 setDom (&$a_dom)
 set dom object
 setHierId ($a_hier_id)
 set hierarchical edit id
 setMediaObject ($a_mediaobject)
 Set Media Object.
 getMediaObject ()
 Get Media Object.
 createMediaObject ()
 create (&$a_pg_obj, $a_hier_id)
 createAlias (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create an media alias in page.
 dumpXML ()
 Dump node xml.
- Public Member Functions inherited from ilPageContent
 __construct ($a_dom)
 Constructor.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 getHierId ()
 Get hierarchical id.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 setEnabled ($value)
 Set Enabled value for page content component.
 enable ()
 Enable page content.
 disable ()
 Disable page content.
 isEnabled ()
 Check whether page content is enabled.
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element)

Data Fields

 $dom
 $mob_node
- Data Fields inherited from ilPageContent
 $hier_id
 $node
 $dom

Additional Inherited Members

- Static Public Member Functions inherited from ilPageContent
static incEdId ($ed_id)
 Increases an hierarchical editing id at lowest level (last number)
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number)
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container.
- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCMediaObject.

Media content object (see ILIAS DTD)

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

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

Member Function Documentation

ilPCMediaObject::create ( $a_pg_obj,
  $a_hier_id 
)

Definition at line 110 of file class.ilPCMediaObject.php.

References ilPageContent\createPageContentNode().

{
//echo "::".is_object($this->dom).":";
$this->node = $this->createPageContentNode();
//$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER);
//$this->list_node =& $this->dom->create_element("List");
//$this->list_node =& $this->node->append_child($this->list_node);
}

+ Here is the call graph for this function:

ilPCMediaObject::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 126 of file class.ilPCMediaObject.php.

References getMediaObject(), and IL_INSERT_AFTER.

{
$this->node =& $this->dom->create_element("PageContent");
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
$this->mob_node =& $this->dom->create_element("MediaObject");
$this->mob_node =& $this->node->append_child($this->mob_node);
$this->mal_node =& $this->dom->create_element("MediaAlias");
$this->mal_node =& $this->mob_node->append_child($this->mal_node);
$this->mal_node->set_attribute("OriginId", "il__mob_".$this->getMediaObject()->getId());
// standard view
$item_node =& $this->dom->create_element("MediaAliasItem");
$item_node =& $this->mob_node->append_child($item_node);
$item_node->set_attribute("Purpose", "Standard");
$media_item =& $this->getMediaObject()->getMediaItem("Standard");
$layout_node =& $this->dom->create_element("Layout");
$layout_node =& $item_node->append_child($layout_node);
if ($media_item->getWidth() > 0)
{
$layout_node->set_attribute("Width", $media_item->getWidth());
}
if ($media_item->getHeight() > 0)
{
$layout_node->set_attribute("Height", $media_item->getHeight());
}
$layout_node->set_attribute("HorizontalAlign", "Left");
// caption
if ($media_item->getCaption() != "")
{
$cap_node =& $this->dom->create_element("Caption");
$cap_node =& $item_node->append_child($cap_node);
$cap_node->set_attribute("Align", "bottom");
$cap_node->set_content($media_item->getCaption());
}
$pars = $media_item->getParameters();
foreach($pars as $par => $val)
{
$par_node =& $this->dom->create_element("Parameter");
$par_node =& $item_node->append_child($par_node);
$par_node->set_attribute("Name", $par);
$par_node->set_attribute("Value", $val);
}
// fullscreen view
$fullscreen_item =& $this->getMediaObject()->getMediaItem("Fullscreen");
if (is_object($fullscreen_item))
{
$item_node =& $this->dom->create_element("MediaAliasItem");
$item_node =& $this->mob_node->append_child($item_node);
$item_node->set_attribute("Purpose", "Fullscreen");
// width and height
$layout_node =& $this->dom->create_element("Layout");
$layout_node =& $item_node->append_child($layout_node);
if ($fullscreen_item->getWidth() > 0)
{
$layout_node->set_attribute("Width", $fullscreen_item->getWidth());
}
if ($fullscreen_item->getHeight() > 0)
{
$layout_node->set_attribute("Height", $fullscreen_item->getHeight());
}
// caption
if ($fullscreen_item->getCaption() != "")
{
$cap_node =& $this->dom->create_element("Caption");
$cap_node =& $item_node->append_child($cap_node);
$cap_node->set_attribute("Align", "bottom");
$cap_node->set_content($fullscreen_item->getCaption());
}
$pars = $fullscreen_item->getParameters();
foreach($pars as $par => $val)
{
$par_node =& $this->dom->create_element("Parameter");
$par_node =& $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:

ilPCMediaObject::createMediaObject ( )

Definition at line 105 of file class.ilPCMediaObject.php.

References setMediaObject().

{
}

+ Here is the call graph for this function:

ilPCMediaObject::dumpXML ( )

Dump node xml.

Definition at line 215 of file class.ilPCMediaObject.php.

{
$xml = $this->dom->dump_node($this->node);
return $xml;
}
ilPCMediaObject::getMediaObject ( )

Get Media Object.

Returns
object Media Object

Definition at line 100 of file class.ilPCMediaObject.php.

Referenced by createAlias().

{
return $this->mediaobject;
}

+ Here is the caller graph for this function:

ilPCMediaObject::init ( )

Init page content component.

Reimplemented from ilPageContent.

Definition at line 44 of file class.ilPCMediaObject.php.

References ilPageContent\setType().

{
$this->setType("media");
}

+ Here is the call graph for this function:

ilPCMediaObject::readMediaObject (   $a_mob_id = 0)

Read/get Media Object.

Parameters
intmedia object ID

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

References setMediaObject().

Referenced by ilPageEditorGUI\insertFromClipboard().

{
if ($a_mob_id > 0)
{
$mob = new ilObjMediaObject($a_mob_id);
$this->setMediaObject($mob);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPCMediaObject::setDom ( $a_dom)

set dom object

Definition at line 72 of file class.ilPCMediaObject.php.

{
$this->dom =& $a_dom;
}
ilPCMediaObject::setHierId (   $a_hier_id)

set hierarchical edit id

Reimplemented from ilPageContent.

Definition at line 80 of file class.ilPCMediaObject.php.

{
$this->hier_id = $a_hier_id;
}
ilPCMediaObject::setMediaObject (   $a_mediaobject)

Set Media Object.

Parameters
object$a_mediaobjectMedia Object

Definition at line 90 of file class.ilPCMediaObject.php.

Referenced by createMediaObject(), and readMediaObject().

{
$this->mediaobject = $a_mediaobject;
}

+ Here is the caller graph for this function:

ilPCMediaObject::setNode ( $a_node)

Set xml node of page content.

Parameters
object$a_nodenode object

Reimplemented from ilPageContent.

Definition at line 63 of file class.ilPCMediaObject.php.

{
parent::setNode($a_node); // this is the PageContent node
$this->mob_node =& $a_node->first_child();
}

Field Documentation

ilPCMediaObject::$dom

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

ilPCMediaObject::$mob_node

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


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