ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilPCMap Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

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

Public Member Functions

 init ()
 Init object. More...
 
 create (ilPageObject $a_pg_obj, string $a_hier_id, string $a_pc_id="")
 
 setLatitude (?float $a_lat=null)
 
 getLatitude ()
 
 setLongitude (?float $a_long=null)
 
 getLongitude ()
 
 setZoom (?int $a_zoom)
 
 getZoom ()
 
 setLayout (?int $a_width, ?int $a_height, string $a_horizontal_align)
 
 getWidth ()
 
 getHeight ()
 
 getHorizontalAlign ()
 
 setCaption (string $a_caption)
 
 getCaption ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
- Public Member Functions inherited from ilPageContent
 __construct (ilPageObject $a_pg_obj, ?PageManagerInterface $page_manager=null, ?ObjectAdapterInterface $object_adapter=null)
 
 setPage (ilPageObject $a_val)
 
 getPage ()
 
 init ()
 Init object. More...
 
 getType ()
 
 getDomNode ()
 
 getDomDoc ()
 
 setDomNode (DOMNode $node)
 
 getChildNode ()
 
 getJavascriptFiles (string $a_mode)
 
 getCssFiles (string $a_mode)
 
 getOnloadCode (string $a_mode)
 
 setHierId (string $a_hier_id)
 
 getHierId ()
 
 lookupHierId ()
 
 readHierId ()
 
 setPcId (string $a_pcid)
 
 getPCId ()
 
 setFileDownloadLink (string $a_download_link)
 
 getFileDownloadLink ()
 
 setProfileBackUrl (string $url)
 
 getProfileBackUrl ()
 
 setFullscreenLink (string $a_fullscreen_link)
 
 getFullscreenLink ()
 
 setSourcecodeDownloadScript (string $script_name)
 
 getSourcecodeDownloadScript ()
 
 readPCId ()
 
 writePCId (string $a_pc_id)
 
 setEnabled (string $value)
 Set Enabled value for page content component. More...
 
 enable ()
 
 disable ()
 
 isEnabled ()
 
 createPageContentNode (bool $a_set_this_node=true)
 Create page content node (always use this method first when adding a new element) More...
 
 getNewPageContentNode ()
 
 modifyPageContentPostXsl (string $a_output, string $a_mode, bool $a_abstract_only=false)
 Modify page content after xsl. More...
 
 getModel ()
 Get model as needed for the front-end editor. More...
 

Static Public Member Functions

static handleCaptionInput (string $a_text)
 
static handleCaptionFormOutput (string $a_text)
 
- Static Public Member Functions inherited from ilPageContent
static sortHierIds (array $a_array)
 Sort an array of Hier IDS in ascending order. More...
 
static isGreaterHierId (string $a, string $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, bool $a_self_ass=true, bool $a_clone_mobs=false, int $new_parent_id=0, int $obj_copy_id=0)
 Handle copied content. More...
 
static afterPageUpdate (ilPageObject $a_page, DOMDocument $a_domdoc, string $a_xml, bool $a_creation)
 After page has been updated (or created) More...
 
static beforePageDelete (ilPageObject $a_page)
 Before page is being deleted. More...
 
static afterRepositoryCopy (ilPageObject $page, array $mapping, int $source_ref_id)
 After repository (container) copy action. More...
 
static afterPageHistoryEntry (ilPageObject $a_page, DOMDocument $a_old_domdoc, string $a_old_xml, int $a_old_nr)
 After page history entry has been created. More...
 
static deleteHistoryLowerEqualThan (string $parent_type, int $page_id, string $lang, int $delete_lower_than_nr)
 Overwrite in derived classes, if old history entries are being deleted. More...
 

Additional Inherited Members

- Data Fields inherited from ilPageContent
string $hier_id = ""
 
DOMNode $dom_node = null
 
string $page_lang = ""
 
- Protected Member Functions inherited from ilPageContent
 getPageManager ()
 
 setType (string $a_type)
 Set Type. More...
 
 hasNode ()
 
 createInitialChildNode (string $hier_id, string $pc_id, string $child, array $child_attributes=[])
 
- Protected Attributes inherited from ilPageContent
DOMDocument $dom_doc
 
ILIAS COPage InternalDomainService $domain
 
string $pcid
 
string $type = ""
 
ilPageObject $pg_obj
 
string $file_download_link = ''
 
string $fullscreen_link = ''
 
string $sourcecode_download_script = ''
 
ilLogger $log
 
string $profile_back_url = ""
 
ILIAS COPage Dom DomUtil $dom_util
 
PageManagerInterface $page_manager = null
 
ObjectAdapterInterface $object = null
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilPCMap Map content object (see ILIAS DTD)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ create()

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

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

35 : void {
37 $a_hier_id,
38 $a_pc_id,
39 "Map",
40 ["Latitude" => "0","Longitude" => "0","Zoom" => "3"]
41 );
42 }
createInitialChildNode(string $hier_id, string $pc_id, string $child, array $child_attributes=[])

◆ getCaption()

ilPCMap::getCaption ( )

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

173 : string
174 {
175 if (is_object($this->getChildNode())) {
176 foreach ($this->getChildNode()->childNodes as $child) {
177 if ($child->nodeName == "MapCaption") {
178 return $this->dom_util->getContent($child);
179 }
180 }
181 }
182 return "";
183 }

◆ getHeight()

ilPCMap::getHeight ( )

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

133 : ?int
134 {
135 if (is_object($this->getChildNode())) {
136 foreach ($this->getChildNode()->childNodes as $child) {
137 if ($child->nodeName == "Layout") {
138 $h = $child->getAttribute("Height")
139 ? (int) $child->getAttribute("Height")
140 : null;
141 return $h;
142 }
143 }
144 }
145 return null;
146 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getHorizontalAlign()

ilPCMap::getHorizontalAlign ( )

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

148 : string
149 {
150 if (is_object($this->getChildNode())) {
151 foreach ($this->getChildNode()->childNodes as $child) {
152 if ($child->nodeName == "Layout") {
153 return $child->getAttribute("HorizontalAlign");
154 }
155 }
156 }
157 return "";
158 }

◆ getLatitude()

ilPCMap::getLatitude ( )

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

55 : ?float
56 {
57 if (is_object($this->getChildNode())) {
58 return (float) $this->getChildNode()->getAttribute("Latitude");
59 }
60 return null;
61 }

◆ getLongitude()

ilPCMap::getLongitude ( )

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

74 : ?float
75 {
76 if (is_object($this->getChildNode())) {
77 return (float) $this->getChildNode()->getAttribute("Longitude");
78 }
79 return null;
80 }

◆ getWidth()

ilPCMap::getWidth ( )

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

118 : ?int
119 {
120 if (is_object($this->getChildNode())) {
121 foreach ($this->getChildNode()->childNodes as $child) {
122 if ($child->nodeName == "Layout") {
123 $w = $child->getAttribute("Width")
124 ? (int) $child->getAttribute("Width")
125 : null;
126 return $w;
127 }
128 }
129 }
130 return null;
131 }

References ILIAS\Repository\int().

+ Here is the call graph for this function:

◆ getZoom()

ilPCMap::getZoom ( )

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

93 : ?int
94 {
95 if (is_object($this->getChildNode())) {
96 return (int) $this->getChildNode()->getAttribute("Zoom");
97 }
98 return null;
99 }

◆ handleCaptionFormOutput()

static ilPCMap::handleCaptionFormOutput ( string  $a_text)
static

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

197 : string {
198 $a_text = str_replace("<br />", "\n", $a_text);
199 $a_text = str_replace("<br/>", "\n", $a_text);
200
201 return $a_text;
202 }

Referenced by ilPCMapGUI\getValues().

+ Here is the caller graph for this function:

◆ handleCaptionInput()

static ilPCMap::handleCaptionInput ( string  $a_text)
static

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

187 : string {
188 $a_text = str_replace(chr(13) . chr(10), "<br />", $a_text);
189 $a_text = str_replace(chr(13), "<br />", $a_text);
190 $a_text = str_replace(chr(10), "<br />", $a_text);
191
192 return $a_text;
193 }

◆ init()

ilPCMap::init ( )

Init object.

This function must be overwritten and at least set the content type.

Reimplemented from ilPageContent.

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

26 : void
27 {
28 $this->setType("map");
29 }
setType(string $a_type)
Set Type.

References ilPageContent\setType().

+ Here is the call graph for this function:

◆ modifyPageContentPostXsl()

ilPCMap::modifyPageContentPostXsl ( string  $a_output,
string  $a_mode,
bool  $a_abstract_only = false 
)

Modify page content after xsl.

Reimplemented from ilPageContent.

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

208 : string {
209 $end = 0;
210 $start = strpos($a_output, "[[[[[Map;");
211 if (is_int($start)) {
212 $end = strpos($a_output, "]]]]]", $start);
213 }
214 $i = 1;
215 while ($end > 0) {
216 $param = substr($a_output, $start + 9, $end - $start - 9);
217
218 $param = explode(";", $param);
219 if (is_numeric($param[0]) && is_numeric($param[1]) && is_numeric($param[2])) {
220 $map_gui = ilMapUtil::getMapGUI();
221 $map_gui->setMapId("map_" . $i)
222 ->setLatitude($param[0])
223 ->setLongitude($param[1])
224 ->setZoom($param[2])
225 ->setWidth($param[3] . "px")
226 ->setHeight($param[4] . "px")
227 ->setEnableTypeControl(true)
228 ->setEnableNavigationControl(true)
229 ->setEnableCentralMarker(true);
230 $h2 = substr($a_output, 0, $start) .
231 $map_gui->getHtml() .
232 substr($a_output, $end + 5);
233 $a_output = $h2;
234 $i++;
235 }
236 $start = strpos($a_output, "[[[[[Map;", $start + 5);
237 $end = 0;
238 if (is_int($start)) {
239 $end = strpos($a_output, "]]]]]", $start);
240 }
241 }
242
243 return $a_output;
244 }
static getMapGUI()
Get an instance of the GUI class.
$param
Definition: xapitoken.php:46

◆ setCaption()

ilPCMap::setCaption ( string  $a_caption)

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

160 : void
161 {
162 if (is_object($this->getChildNode())) {
163 $this->dom_util->setFirstOptionalElement(
164 $this->getChildNode(),
165 "MapCaption",
166 array(),
167 $a_caption,
168 array()
169 );
170 }
171 }

◆ setLatitude()

ilPCMap::setLatitude ( ?float  $a_lat = null)

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

44 : void
45 {
46 if (!is_null($a_lat)) {
47 $this->getChildNode()->setAttribute("Latitude", (string) $a_lat);
48 } else {
49 if ($this->getChildNode()->hasAttribute("Latitude")) {
50 $this->getChildNode()->removeAttribute("Latitude");
51 }
52 }
53 }

◆ setLayout()

ilPCMap::setLayout ( ?int  $a_width,
?int  $a_height,
string  $a_horizontal_align 
)

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

105 : void {
106 if (is_object($this->getChildNode())) {
107 $this->dom_util->setFirstOptionalElement(
108 $this->getChildNode(),
109 "Layout",
110 array("MapCaption"),
111 "",
112 array("Width" => (string) $a_width,
113 "Height" => (string) $a_height, "HorizontalAlign" => $a_horizontal_align)
114 );
115 }
116 }

◆ setLongitude()

ilPCMap::setLongitude ( ?float  $a_long = null)

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

63 : void
64 {
65 if (!is_null($a_long)) {
66 $this->getChildNode()->setAttribute("Longitude", $a_long);
67 } else {
68 if ($this->getChildNode()->hasAttribute("Longitude")) {
69 $this->getChildNode()->removeAttribute("Longitude");
70 }
71 }
72 }

◆ setZoom()

ilPCMap::setZoom ( ?int  $a_zoom)

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

82 : void
83 {
84 //if (!empty($a_zoom)) {
85 $this->getChildNode()->setAttribute("Zoom", (int) $a_zoom);
86 /*} else {
87 if ($this->map_node->has_attribute("Zoom")) {
88 $this->map_node->remove_attribute("Zoom");
89 }
90 }*/
91 }

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