ILIAS  Release_4_2_x_branch Revision 61807
 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)
 Create pc media object.
 createAlias (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create an media alias in page.
 updateObjectReference ()
 Updates the media object referenced by the media alias.
 dumpXML ()
 Dump node xml.
 setClass ($a_class)
 Set Style Class of table.
 getClass ()
 Get characteristic of section.
- 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.
 lookupHierId ()
 Get hierarchical id from dom.
 readHierId ()
 Read PC Id.
 setPcId ($a_pcid)
 Set PC Id.
 getPCId ()
 Get PC Id.
 readPCId ()
 Read PC Id.
 writePCId ($a_pc_id)
 Write pc id.
 isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b.
 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.
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order.
- 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 16 of file class.ilPCMediaObject.php.

Member Function Documentation

ilPCMediaObject::create ( $a_pg_obj,
  $a_hier_id 
)

Create pc media object.

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

References ilPageContent\createPageContentNode().

{
$this->node = $this->createPageContentNode();
}

+ 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 w

Definition at line 104 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());
}
// text representation
if ($media_item->getTextRepresentation() != "")
{
$tr_node =& $this->dom->create_element("TextRepresentation");
$tr_node =& $item_node->append_child($tr_node);
$tr_node->set_content($media_item->getTextRepresentation());
}
$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());
}
// text representation
if ($fullscreen_item->getTextRepresentation() != "")
{
$tr_node =& $this->dom->create_element("TextRepresentation");
$tr_node =& $item_node->append_child($tr_node);
$tr_node->set_content($fullscreen_item->getTextRepresentation());
}
$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 85 of file class.ilPCMediaObject.php.

References setMediaObject().

{
}

+ Here is the call graph for this function:

ilPCMediaObject::dumpXML ( )

Dump node xml.

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

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

Get characteristic of section.

Returns
string characteristic

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

{
if (is_object($this->mob_node))
{
$mal_node = $this->mob_node->first_child();
if (is_object($mal_node))
{
$class = $mal_node->get_attribute("Class");
return $class;
}
}
}
ilPCMediaObject::getMediaObject ( )

Get Media Object.

Returns
object Media Object

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

Referenced by createAlias(), and updateObjectReference().

{
return $this->mediaobject;
}

+ Here is the caller graph for this function:

ilPCMediaObject::init ( )

Init page content component.

Reimplemented from ilPageContent.

Definition at line 24 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 34 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::setClass (   $a_class)

Set Style Class of table.

Parameters
string$a_classclass

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

{
if (is_object($this->mob_node))
{
$mal_node = $this->mob_node->first_child();
if (is_object($mal_node))
{
if (!empty($a_class))
{
$mal_node->set_attribute("Class", $a_class);
}
else
{
if ($mal_node->has_attribute("Class"))
{
$mal_node->remove_attribute("Class");
}
}
}
}
}
ilPCMediaObject::setDom ( $a_dom)

set dom object

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

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

set hierarchical edit id

Reimplemented from ilPageContent.

Definition at line 60 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 70 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 43 of file class.ilPCMediaObject.php.

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

Updates the media object referenced by the media alias.

This makes only sense, after the media object has changed. (-> change object reference function)

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

References getMediaObject().

{
if (is_object($this->mob_node))
{
$this->mal_node =& $this->mob_node->first_child();
if (is_object($this->mal_node) && $this->mal_node->node_name() == "MediaAlias")
{
$this->mal_node->set_attribute("OriginId", "il__mob_".$this->getMediaObject()->getId());
}
}
}

+ Here is the call graph for this function:

Field Documentation

ilPCMediaObject::$dom

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

ilPCMediaObject::$mob_node

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


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