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

Class ilPCMap. More...

+ Inheritance diagram for ilPCMap:
+ Collaboration diagram for ilPCMap:

Public Member Functions

 init ()
 Init page content component.
 setNode (&$a_node)
 Set node.
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create map node in xml.
 setLatitude ($a_lat)
 Set latitude of map.
 getLatitude ()
 Get latitude of map.
 setLongitude ($a_long)
 Set longitude of map.
 getLongitude ()
 Get longitude of map.
 setZoom ($a_zoom)
 Set zoom of map.
 getZoom ()
 Get zoom of map.
 setLayout ($a_width, $a_height, $a_horizontal_align)
 Set Layout.
 getWidth ()
 Get Width.
 getHeight ()
 Get Height.
 getHorizontalAlign ()
 Get Horizontal Alignment.
 setCaption ($a_caption)
 Set Caption.
 getCaption ()
 Get Caption.
- Public Member Functions inherited from ilPageContent
 __construct ($a_dom)
 Constructor.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure.
 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)

Static Public Member Functions

static handleCaptionInput ($a_text)
static handleCaptionFormOutput ($a_text)
- 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.

Data Fields

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

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type.

Detailed Description

Class ilPCMap.

Map 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.ilPCMap.php.

Member Function Documentation

ilPCMap::create ( $a_pg_obj,
  $a_hier_id,
  $a_pc_id = "" 
)

Create map node in xml.

Parameters
object$a_pg_objPage Object
string$a_hier_idHierarchical ID

Definition at line 64 of file class.ilPCMap.php.

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

{
$this->node = $this->createPageContentNode();
$a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
$this->map_node =& $this->dom->create_element("Map");
$this->map_node =& $this->node->append_child($this->map_node);
$this->map_node->set_attribute("Latitude", "0");
$this->map_node->set_attribute("Longitude", "0");
$this->map_node->set_attribute("Zoom", "3");
}

+ Here is the call graph for this function:

ilPCMap::getCaption ( )

Get Caption.

Returns
string Caption

Definition at line 271 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
$childs = $this->map_node->child_nodes();
foreach($childs as $child)
{
if ($child->node_name() == "MapCaption")
{
return $child->get_content();
}
}
}
}
ilPCMap::getHeight ( )

Get Height.

Returns
integer Height

Definition at line 217 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
$childs = $this->map_node->child_nodes();
foreach($childs as $child)
{
if ($child->node_name() == "Layout")
{
return $child->get_attribute("Height");
}
}
}
}
ilPCMap::getHorizontalAlign ( )

Get Horizontal Alignment.

Returns
string Horizontal Alignment

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

{
if (is_object($this->map_node))
{
$childs = $this->map_node->child_nodes();
foreach($childs as $child)
{
if ($child->node_name() == "Layout")
{
return $child->get_attribute("HorizontalAlign");
}
}
}
}
ilPCMap::getLatitude ( )

Get latitude of map.

Returns
string latitude

Definition at line 101 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
return $this->map_node->get_attribute("Latitude");
}
}
ilPCMap::getLongitude ( )

Get longitude of map.

Returns
string longitude

Definition at line 134 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
return $this->map_node->get_attribute("Longitude");
}
}
ilPCMap::getWidth ( )

Get Width.

Returns
integer Width

Definition at line 197 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
$childs = $this->map_node->child_nodes();
foreach($childs as $child)
{
if ($child->node_name() == "Layout")
{
return $child->get_attribute("Width");
}
}
}
}
ilPCMap::getZoom ( )

Get zoom of map.

Returns
string zoom

Definition at line 167 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
return $this->map_node->get_attribute("Zoom");
}
}
static ilPCMap::handleCaptionFormOutput (   $a_text)
static

Definition at line 295 of file class.ilPCMap.php.

{
$a_text = str_replace("<br />", "\n", $a_text);
$a_text = str_replace("<br/>", "\n", $a_text);
return $a_text;
}
static ilPCMap::handleCaptionInput (   $a_text)
static

Definition at line 286 of file class.ilPCMap.php.

{
$a_text = str_replace(chr(13).chr(10),"<br />",$a_text);
$a_text = str_replace(chr(13),"<br />", $a_text);
$a_text = str_replace(chr(10),"<br />", $a_text);
return $a_text;
}
ilPCMap::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

References ilPageContent\setType().

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

+ Here is the call graph for this function:

ilPCMap::setCaption (   $a_caption)

Set Caption.

Parameters
string$a_captionCaption

Definition at line 257 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
"MapCaption", array(), $a_caption, array());
}
}
ilPCMap::setLatitude (   $a_lat)

Set latitude of map.

Parameters
string$a_latlatitude

Definition at line 81 of file class.ilPCMap.php.

{
if (!empty($a_lat))
{
$this->map_node->set_attribute("Latitude", $a_lat);
}
else
{
if ($this->map_node->has_attribute("Latitude"))
{
$this->map_node->remove_attribute("Latitude");
}
}
}
ilPCMap::setLayout (   $a_width,
  $a_height,
  $a_horizontal_align 
)

Set Layout.

Parameters
integer$a_widthWidth
integer$a_heightHeight
integer$a_horizonal_alignHorizontal Alignment

Definition at line 182 of file class.ilPCMap.php.

{
if (is_object($this->map_node))
{
ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
"Layout", array("MapCaption"), "", array("Width" => $a_width,
"Height" => $a_height, "HorizontalAlign" => $a_horizontal_align));
}
}
ilPCMap::setLongitude (   $a_long)

Set longitude of map.

Parameters
string$a_longlongitude

Definition at line 114 of file class.ilPCMap.php.

{
if (!empty($a_long))
{
$this->map_node->set_attribute("Longitude", $a_long);
}
else
{
if ($this->map_node->has_attribute("Longitude"))
{
$this->map_node->remove_attribute("Longitude");
}
}
}
ilPCMap::setNode ( $a_node)

Set node.

Reimplemented from ilPageContent.

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

{
parent::setNode($a_node); // this is the PageContent node
$this->map_node =& $a_node->first_child(); // this is the Map node
}
ilPCMap::setZoom (   $a_zoom)

Set zoom of map.

Parameters
string$a_zoomzoom

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

{
if (!empty($a_zoom))
{
$this->map_node->set_attribute("Zoom", $a_zoom);
}
else
{
if ($this->map_node->has_attribute("Zoom"))
{
$this->map_node->remove_attribute("Zoom");
}
}
}

Field Documentation

ilPCMap::$dom

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

ilPCMap::$map_node

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


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