ILIAS  Release_5_0_x_branch Revision 61816
 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.
 modifyPageContentPostXsl ($a_html, $a_mode)
 Modify page content after xsl.
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor.
 setPage ($a_val)
 Set page.
 getPage ()
 Get page.
 getType ()
 Get type of page content.
getNode ()
 Get xml node of page content.
 getJavascriptFiles ()
 Get Javascript files.
 getCssFiles ()
 Get css files.
 getOnloadCode ()
 Get on load code.
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure.
 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)

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.
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order.
static getLangVars ()
 Get lang vars needed for editing.
static handleCopiedContent (DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content.
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created)
static beforePageDelete ($a_page)
 Before page is being deleted.
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created.

Data Fields

 $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 17 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 44 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 251 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 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("Height");
}
}
}
}
ilPCMap::getHorizontalAlign ( )

Get Horizontal Alignment.

Returns
string Horizontal Alignment

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("HorizontalAlign");
}
}
}
}
ilPCMap::getLatitude ( )

Get latitude of map.

Returns
string latitude

Definition at line 81 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 114 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 177 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 147 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 275 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 266 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 24 of file class.ilPCMap.php.

References ilPageContent\setType().

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

+ Here is the call graph for this function:

ilPCMap::modifyPageContentPostXsl (   $a_html,
  $a_mode 
)

Modify page content after xsl.

Parameters
string$a_output
Returns
string

Reimplemented from ilPageContent.

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

References ilMapUtil\getMapGUI().

{
$c_pos = 0;
$start = strpos($a_html, "[[[[[Map;");
if (is_int($start))
{
$end = strpos($a_html, "]]]]]", $start);
}
$i = 1;
while ($end > 0)
{
$param = substr($a_html, $start + 9, $end - $start - 9);
$param = explode(";", $param);
if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2]))
{
include_once("./Services/Maps/classes/class.ilMapUtil.php");
$map_gui = ilMapUtil::getMapGUI();
$map_gui->setMapId("map_".$i)
->setLatitude($param[0])
->setLongitude($param[1])
->setZoom($param[2])
->setWidth($param[3]."px")
->setHeight($param[4]."px")
->setEnableTypeControl(true)
->setEnableNavigationControl(true)
->setEnableCentralMarker(true);
$h2 = substr($a_html, 0, $start).
$map_gui->getHtml().
substr($a_html, $end + 5);
$a_html = $h2;
$i++;
}
$start = strpos($a_html, "[[[[[Map;", $start + 5);
$end = 0;
if (is_int($start))
{
$end = strpos($a_html, "]]]]]", $start);
}
}
return $a_html;
}

+ Here is the call graph for this function:

ilPCMap::setCaption (   $a_caption)

Set Caption.

Parameters
string$a_captionCaption

Definition at line 237 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 61 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 162 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 94 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 32 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 127 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::$map_node

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


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