ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 237 of file class.ilPCMap.php.

238 {
239 if (is_object($this->map_node)) {
240 $childs = $this->map_node->child_nodes();
241 foreach ($childs as $child) {
242 if ($child->node_name() == "MapCaption") {
243 return $child->get_content();
244 }
245 }
246 }
247 }

◆ getHeight()

ilPCMap::getHeight ( )

Get Height.

Returns
integer Height

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

185 {
186 if (is_object($this->map_node)) {
187 $childs = $this->map_node->child_nodes();
188 foreach ($childs as $child) {
189 if ($child->node_name() == "Layout") {
190 return $child->get_attribute("Height");
191 }
192 }
193 }
194 }

◆ getHorizontalAlign()

ilPCMap::getHorizontalAlign ( )

Get Horizontal Alignment.

Returns
string Horizontal Alignment

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

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

◆ getLatitude()

ilPCMap::getLatitude ( )

Get latitude of map.

Returns
string latitude

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

78 {
79 if (is_object($this->map_node)) {
80 return $this->map_node->get_attribute("Latitude");
81 }
82 }

◆ getLongitude()

ilPCMap::getLongitude ( )

Get longitude of map.

Returns
string longitude

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

106 {
107 if (is_object($this->map_node)) {
108 return $this->map_node->get_attribute("Longitude");
109 }
110 }

◆ getWidth()

ilPCMap::getWidth ( )

Get Width.

Returns
integer Width

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

168 {
169 if (is_object($this->map_node)) {
170 $childs = $this->map_node->child_nodes();
171 foreach ($childs as $child) {
172 if ($child->node_name() == "Layout") {
173 return $child->get_attribute("Width");
174 }
175 }
176 }
177 }

◆ getZoom()

ilPCMap::getZoom ( )

Get zoom of map.

Returns
string zoom

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

134 {
135 if (is_object($this->map_node)) {
136 return $this->map_node->get_attribute("Zoom");
137 }
138 }

◆ handleCaptionFormOutput()

static ilPCMap::handleCaptionFormOutput (   $a_text)
static

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

259 {
260 $a_text = str_replace("<br />", "\n", $a_text);
261 $a_text = str_replace("<br/>", "\n", $a_text);
262
263 return $a_text;
264 }

◆ handleCaptionInput()

static ilPCMap::handleCaptionInput (   $a_text)
static

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

250 {
251 $a_text = str_replace(chr(13) . chr(10), "<br />", $a_text);
252 $a_text = str_replace(chr(13), "<br />", $a_text);
253 $a_text = str_replace(chr(10), "<br />", $a_text);
254
255 return $a_text;
256 }

◆ 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 272 of file class.ilPCMap.php.

273 {
274 $c_pos = 0;
275 $start = strpos($a_html, "[[[[[Map;");
276 if (is_int($start)) {
277 $end = strpos($a_html, "]]]]]", $start);
278 }
279 $i = 1;
280 while ($end > 0) {
281 $param = substr($a_html, $start + 9, $end - $start - 9);
282
283 $param = explode(";", $param);
284 if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2])) {
285 include_once("./Services/Maps/classes/class.ilMapUtil.php");
286 $map_gui = ilMapUtil::getMapGUI();
287 $map_gui->setMapId("map_" . $i)
288 ->setLatitude($param[0])
289 ->setLongitude($param[1])
290 ->setZoom($param[2])
291 ->setWidth($param[3] . "px")
292 ->setHeight($param[4] . "px")
293 ->setEnableTypeControl(true)
294 ->setEnableNavigationControl(true)
295 ->setEnableCentralMarker(true);
296 $h2 = substr($a_html, 0, $start) .
297 $map_gui->getHtml() .
298 substr($a_html, $end + 5);
299 $a_html = $h2;
300 $i++;
301 }
302 $start = strpos($a_html, "[[[[[Map;", $start + 5);
303 $end = 0;
304 if (is_int($start)) {
305 $end = strpos($a_html, "]]]]]", $start);
306 }
307 }
308
309 return $a_html;
310 }
static getMapGUI()
Get an instance of the GUI class.
$i
Definition: disco.tpl.php:19
$start
Definition: bench.php:8

References $end, $i, $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 218 of file class.ilPCMap.php.

219 {
220 if (is_object($this->map_node)) {
221 ilDomUtil::setFirstOptionalElement(
222 $this->dom,
223 $this->map_node,
224 "MapCaption",
225 array(),
226 $a_caption,
227 array()
228 );
229 }
230 }

◆ 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 $this->map_node->set_attribute("Latitude", $a_lat);
65 } else {
66 if ($this->map_node->has_attribute("Latitude")) {
67 $this->map_node->remove_attribute("Latitude");
68 }
69 }
70 }

◆ 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 147 of file class.ilPCMap.php.

148 {
149 if (is_object($this->map_node)) {
150 ilDomUtil::setFirstOptionalElement(
151 $this->dom,
152 $this->map_node,
153 "Layout",
154 array("MapCaption"),
155 "",
156 array("Width" => $a_width,
157 "Height" => $a_height, "HorizontalAlign" => $a_horizontal_align)
158 );
159 }
160 }

◆ setLongitude()

ilPCMap::setLongitude (   $a_long)

Set longitude of map.

Parameters
string$a_longlongitude

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

90 {
91 if (!empty($a_long)) {
92 $this->map_node->set_attribute("Longitude", $a_long);
93 } else {
94 if ($this->map_node->has_attribute("Longitude")) {
95 $this->map_node->remove_attribute("Longitude");
96 }
97 }
98 }

◆ 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 117 of file class.ilPCMap.php.

118 {
119 if (!empty($a_zoom)) {
120 $this->map_node->set_attribute("Zoom", $a_zoom);
121 } else {
122 if ($this->map_node->has_attribute("Zoom")) {
123 $this->map_node->remove_attribute("Zoom");
124 }
125 }
126 }

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: