ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilPCMap Class Reference

Class ilPCMap. More...

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

Public Member Functions

 init ()
 Init page content component. More...
 
 setNode ($a_node)
 Set node. More...
 
 create (&$a_pg_obj, $a_hier_id, $a_pc_id="")
 Create map node in xml. More...
 
 setLatitude ($a_lat)
 Set latitude of map. More...
 
 getLatitude ()
 Get latitude of map. More...
 
 setLongitude ($a_long)
 Set longitude of map. More...
 
 getLongitude ()
 Get longitude of map. More...
 
 setZoom ($a_zoom)
 Set zoom of map. More...
 
 getZoom ()
 Get zoom of map. More...
 
 setLayout ($a_width, $a_height, $a_horizontal_align)
 Set Layout. More...
 
 getWidth ()
 Get Width. More...
 
 getHeight ()
 Get Height. More...
 
 getHorizontalAlign ()
 Get Horizontal Alignment. More...
 
 setCaption ($a_caption)
 Set Caption. More...
 
 getCaption ()
 Get Caption. More...
 
 modifyPageContentPostXsl ($a_html, $a_mode)
 Modify page content after xsl. More...
 
- Public Member Functions inherited from ilPageContent
 __construct ($a_pg_obj)
 Constructor. More...
 
 setPage ($a_val)
 Set page. More...
 
 getPage ()
 Get page. More...
 
 init ()
 Init object. More...
 
 getType ()
 Get type of page content. More...
 
 setNode ($a_node)
 Set xml node of page content. More...
 
getNode ()
 Get xml node of page content. More...
 
 getJavascriptFiles ($a_mode)
 Get Javascript files. More...
 
 getCssFiles ($a_mode)
 Get css files. More...
 
 getOnloadCode ($a_mode)
 Get on load code. More...
 
 setHierId ($a_hier_id)
 Set hierarchical ID in xml structure. More...
 
 getHierId ()
 Get hierarchical id. More...
 
 lookupHierId ()
 Get hierarchical id from dom. More...
 
 readHierId ()
 Read PC Id. More...
 
 setPcId ($a_pcid)
 Set PC Id. More...
 
 getPCId ()
 Get PC Id. More...
 
 setFileDownloadLink ($a_download_link)
 Set file download link. More...
 
 getFileDownloadLink ()
 Get file download link. More...
 
 setFullscreenLink ($a_fullscreen_link)
 Set fullscreen link. More...
 
 getFullscreenLink ()
 Get fullscreen link. More...
 
 setSourcecodeDownloadScript ($script_name)
 Set sourcecode download script. More...
 
 getSourcecodeDownloadScript ()
 Get sourcecode download script. More...
 
 readPCId ()
 Read PC Id. More...
 
 writePCId ($a_pc_id)
 Write pc id. More...
 
 setEnabled ($value)
 Set Enabled value for page content component. More...
 
 enable ()
 Enable page content. More...
 
 disable ()
 Disable page content. More...
 
 isEnabled ()
 Check whether page content is enabled. More...
 
 createPageContentNode ($a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 modifyPageContentPostXsl ($a_output, $a_mode)
 Modify page content after xsl. More...
 

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) More...
 
static decEdId ($ed_id)
 Decreases an hierarchical editing id at lowest level (last number) More...
 
static haveSameContainer ($ed_id1, $ed_id2)
 Check, if two ids are in same container. More...
 
static sortHierIds ($a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId ($a, $b)
 Check whether Hier ID $a is greater than Hier ID $b. More...
 
static getLangVars ()
 Get lang vars needed for editing. More...
 
static handleCopiedContent (DOMDocument $a_domdoc, $a_self_ass=true, $a_clone_mobs=false)
 Handle copied content. More...
 
static afterPageUpdate ($a_page, DOMDocument $a_domdoc, $a_xml, $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete ($a_page)
 Before page is being deleted. More...
 
static afterPageHistoryEntry ($a_page, DOMDocument $a_old_domdoc, $a_old_xml, $a_old_nr)
 After page history entry has been created. More...
 

Data Fields

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

Additional Inherited Members

- Protected Member Functions inherited from ilPageContent
 setType ($a_type)
 Set Type. More...
 
- Protected Attributes inherited from ilPageContent
 $file_download_link
 
 $fullscreen_link
 
 $sourcecode_download_script
 
 $log
 

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

◆ create()

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.

45 {
46 $this->node = $this->createPageContentNode();
47
48 $a_pg_obj->insertContent($this, $a_hier_id, IL_INSERT_AFTER, $a_pc_id);
49 $this->map_node = $this->dom->create_element("Map");
50 $this->map_node = $this->node->append_child($this->map_node);
51 $this->map_node->set_attribute("Latitude", "0");
52 $this->map_node->set_attribute("Longitude", "0");
53 $this->map_node->set_attribute("Zoom", "3");
54 }
const IL_INSERT_AFTER
createPageContentNode($a_set_this_node=true)
Create page content node (always use this method first when adding a new element)

References ilPageContent\createPageContentNode(), and IL_INSERT_AFTER.

+ Here is the call graph for this function:

◆ getCaption()

ilPCMap::getCaption ( )

Get Caption.

Returns
string Caption

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

252 {
253 if (is_object($this->map_node))
254 {
255 $childs = $this->map_node->child_nodes();
256 foreach($childs as $child)
257 {
258 if ($child->node_name() == "MapCaption")
259 {
260 return $child->get_content();
261 }
262 }
263 }
264 }

◆ getHeight()

ilPCMap::getHeight ( )

Get Height.

Returns
integer Height

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

198 {
199 if (is_object($this->map_node))
200 {
201 $childs = $this->map_node->child_nodes();
202 foreach($childs as $child)
203 {
204 if ($child->node_name() == "Layout")
205 {
206 return $child->get_attribute("Height");
207 }
208 }
209 }
210 }

◆ getHorizontalAlign()

ilPCMap::getHorizontalAlign ( )

Get Horizontal Alignment.

Returns
string Horizontal Alignment

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

218 {
219 if (is_object($this->map_node))
220 {
221 $childs = $this->map_node->child_nodes();
222 foreach($childs as $child)
223 {
224 if ($child->node_name() == "Layout")
225 {
226 return $child->get_attribute("HorizontalAlign");
227 }
228 }
229 }
230 }

◆ getLatitude()

ilPCMap::getLatitude ( )

Get latitude of map.

Returns
string latitude

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

82 {
83 if (is_object($this->map_node))
84 {
85 return $this->map_node->get_attribute("Latitude");
86 }
87 }

◆ getLongitude()

ilPCMap::getLongitude ( )

Get longitude of map.

Returns
string longitude

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

115 {
116 if (is_object($this->map_node))
117 {
118 return $this->map_node->get_attribute("Longitude");
119 }
120 }

◆ getWidth()

ilPCMap::getWidth ( )

Get Width.

Returns
integer Width

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

178 {
179 if (is_object($this->map_node))
180 {
181 $childs = $this->map_node->child_nodes();
182 foreach($childs as $child)
183 {
184 if ($child->node_name() == "Layout")
185 {
186 return $child->get_attribute("Width");
187 }
188 }
189 }
190 }

◆ getZoom()

ilPCMap::getZoom ( )

Get zoom of map.

Returns
string zoom

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

148 {
149 if (is_object($this->map_node))
150 {
151 return $this->map_node->get_attribute("Zoom");
152 }
153 }

◆ handleCaptionFormOutput()

static ilPCMap::handleCaptionFormOutput (   $a_text)
static

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

276 {
277 $a_text = str_replace("<br />", "\n", $a_text);
278 $a_text = str_replace("<br/>", "\n", $a_text);
279
280 return $a_text;
281 }

◆ handleCaptionInput()

static ilPCMap::handleCaptionInput (   $a_text)
static

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

267 {
268 $a_text = str_replace(chr(13).chr(10),"<br />",$a_text);
269 $a_text = str_replace(chr(13),"<br />", $a_text);
270 $a_text = str_replace(chr(10),"<br />", $a_text);
271
272 return $a_text;
273 }

◆ init()

ilPCMap::init ( )

Init page content component.

Reimplemented from ilPageContent.

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

25 {
26 $this->setType("map");
27 }
setType($a_type)
Set Type.

References ilPageContent\setType().

+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

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.

290 {
291 $c_pos = 0;
292 $start = strpos($a_html, "[[[[[Map;");
293 if (is_int($start))
294 {
295 $end = strpos($a_html, "]]]]]", $start);
296 }
297 $i = 1;
298 while ($end > 0)
299 {
300 $param = substr($a_html, $start + 9, $end - $start - 9);
301
302 $param = explode(";", $param);
303 if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2]))
304 {
305 include_once("./Services/Maps/classes/class.ilMapUtil.php");
306 $map_gui = ilMapUtil::getMapGUI();
307 $map_gui->setMapId("map_".$i)
308 ->setLatitude($param[0])
309 ->setLongitude($param[1])
310 ->setZoom($param[2])
311 ->setWidth($param[3]."px")
312 ->setHeight($param[4]."px")
313 ->setEnableTypeControl(true)
314 ->setEnableNavigationControl(true)
315 ->setEnableCentralMarker(true);
316 $h2 = substr($a_html, 0, $start).
317 $map_gui->getHtml().
318 substr($a_html, $end + 5);
319 $a_html = $h2;
320 $i++;
321 }
322 $start = strpos($a_html, "[[[[[Map;", $start + 5);
323 $end = 0;
324 if (is_int($start))
325 {
326 $end = strpos($a_html, "]]]]]", $start);
327 }
328 }
329
330 return $a_html;
331 }
static getMapGUI()
Get an instance of the GUI class.

References $start, and ilMapUtil\getMapGUI().

+ Here is the call graph for this function:

◆ setCaption()

ilPCMap::setCaption (   $a_caption)

Set Caption.

Parameters
string$a_captionCaption

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

238 {
239 if (is_object($this->map_node))
240 {
241 ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
242 "MapCaption", array(), $a_caption, array());
243 }
244 }

◆ setLatitude()

ilPCMap::setLatitude (   $a_lat)

Set latitude of map.

Parameters
string$a_latlatitude

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

62 {
63 if (!empty($a_lat))
64 {
65 $this->map_node->set_attribute("Latitude", $a_lat);
66 }
67 else
68 {
69 if ($this->map_node->has_attribute("Latitude"))
70 {
71 $this->map_node->remove_attribute("Latitude");
72 }
73 }
74 }

◆ setLayout()

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.

163 {
164 if (is_object($this->map_node))
165 {
166 ilDomUtil::setFirstOptionalElement($this->dom, $this->map_node,
167 "Layout", array("MapCaption"), "", array("Width" => $a_width,
168 "Height" => $a_height, "HorizontalAlign" => $a_horizontal_align));
169 }
170 }

◆ setLongitude()

ilPCMap::setLongitude (   $a_long)

Set longitude of map.

Parameters
string$a_longlongitude

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

95 {
96 if (!empty($a_long))
97 {
98 $this->map_node->set_attribute("Longitude", $a_long);
99 }
100 else
101 {
102 if ($this->map_node->has_attribute("Longitude"))
103 {
104 $this->map_node->remove_attribute("Longitude");
105 }
106 }
107 }

◆ setNode()

ilPCMap::setNode (   $a_node)

Set node.

Reimplemented from ilPageContent.

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

33 {
34 parent::setNode($a_node); // this is the PageContent node
35 $this->map_node = $a_node->first_child(); // this is the Map node
36 }

◆ setZoom()

ilPCMap::setZoom (   $a_zoom)

Set zoom of map.

Parameters
string$a_zoomzoom

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

128 {
129 if (!empty($a_zoom))
130 {
131 $this->map_node->set_attribute("Zoom", $a_zoom);
132 }
133 else
134 {
135 if ($this->map_node->has_attribute("Zoom"))
136 {
137 $this->map_node->remove_attribute("Zoom");
138 }
139 }
140 }

Field Documentation

◆ $map_node

ilPCMap::$map_node

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


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