1 |
<?php |
---|
2 |
|
---|
3 |
|
---|
4 |
|
---|
5 |
|
---|
6 |
|
---|
7 |
|
---|
8 |
|
---|
9 |
|
---|
10 |
|
---|
11 |
|
---|
12 |
|
---|
13 |
|
---|
14 |
|
---|
15 |
|
---|
16 |
|
---|
17 |
|
---|
18 |
|
---|
19 |
|
---|
20 |
|
---|
21 |
|
---|
22 |
|
---|
23 |
|
---|
24 |
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 |
|
---|
29 |
|
---|
30 |
include_once(dirname(__FILE__)."/../Widget.php"); |
---|
31 |
include_once(dirname(__FILE__)."/../Button.php"); |
---|
32 |
include_once(dirname(__FILE__)."/../Popup.php"); |
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 |
|
---|
38 |
|
---|
39 |
class LegendTemplate extends CWCWidget |
---|
40 |
{ |
---|
41 |
var $mszTemplate; |
---|
42 |
|
---|
43 |
var $moButton; |
---|
44 |
var $moPopup; |
---|
45 |
var $mbControlVisibility = true; |
---|
46 |
var $mbEmbedded = true; |
---|
47 |
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 |
|
---|
52 |
|
---|
53 |
|
---|
54 |
function LegendTemplate() |
---|
55 |
{ |
---|
56 |
$this->mszLanguageResource = str_replace("\\","/",dirname(__FILE__))."/LegendPopup.dbf"; |
---|
57 |
|
---|
58 |
|
---|
59 |
parent::CWCWidget(); |
---|
60 |
|
---|
61 |
|
---|
62 |
$this->szWidgetDescription = <<<EOT |
---|
63 |
The Legend widget allows the user display a legend based on a legend template. |
---|
64 |
The Legend can either be embedded in the same page or displayed in a separate window. |
---|
65 |
EOT; |
---|
66 |
$this->maAttributes["TEMPLATE"] = new StringAttribute( "TEMPLATE", true ); |
---|
67 |
$this->maAttributes['CONTROLVISIBILITY'] = new BooleanAttribute( 'CONTROLVISIBILITY', false ); |
---|
68 |
$this->maAttributes['EMBEDDED'] = new BooleanAttribute( 'EMBEDDED', false ); |
---|
69 |
|
---|
70 |
$this->moButton = new CWCButton( $this ); |
---|
71 |
$this->moPopup = new CWCPopup( $this ); |
---|
72 |
|
---|
73 |
$this->mnMaturityLevel = MATURITY_TECHNICALRELEASE; |
---|
74 |
} |
---|
75 |
|
---|
76 |
|
---|
77 |
|
---|
78 |
function InitDefaults() |
---|
79 |
{ |
---|
80 |
parent::InitDefaults(); |
---|
81 |
|
---|
82 |
if (isset($this->maParams['CONTROLVISIBILITY'])) |
---|
83 |
{ |
---|
84 |
$this->mbControlVisibility = ($this->maParams['CONTROLVISIBILITY'] == "true") ? true : false; |
---|
85 |
} |
---|
86 |
|
---|
87 |
|
---|
88 |
$this->maParams["TOOLSET"] = ""; |
---|
89 |
if (isset($this->maParams["EMBEDDED"])) |
---|
90 |
{ |
---|
91 |
$this->mbEmbedded = (strcasecmp($this->maParams["EMBEDDED"], "FALSE") == 0) ? false : true; |
---|
92 |
} |
---|
93 |
|
---|
94 |
$this->moPopup->InitDefaults(); |
---|
95 |
|
---|
96 |
if (!$this->mbEmbedded) |
---|
97 |
{ |
---|
98 |
$this->moButton->InitDefaults(); |
---|
99 |
$this->moButton->SetOnClick("LegendTemplatePopup", $this->mnId); |
---|
100 |
$szVisibility = "&controlvisibility=".($this->mbControlVisibility ? '1' : '0'); |
---|
101 |
$this->moPopup->mszLink = $_SESSION['gszCoreWebPath']."widgets/LegendTemplate/LegendTemplatePopup.phtml?widgetId='+widgetId+'".$szVisibility; |
---|
102 |
} |
---|
103 |
else |
---|
104 |
{ |
---|
105 |
|
---|
106 |
$this->moButton = null; |
---|
107 |
$this->moPopup->mszLink = $_SESSION['gszCoreWebPath']."/widgets/LegendTemplate/LegendInfo.phtml?layerName='+layername+'"; |
---|
108 |
} |
---|
109 |
|
---|
110 |
if (isset($_SESSION['LEGENDTEMPLATE'.$this->mnId]) && isset($this->maParams['TEMPLATE']) ) |
---|
111 |
{ |
---|
112 |
if( basename( $_SESSION['LEGENDTEMPLATE'.$this->mnId]) !== trim($this->maParams["TEMPLATE"] ) ) |
---|
113 |
{ |
---|
114 |
unset( $_SESSION['LEGENDTEMPLATE'.$this->mnId] ); |
---|
115 |
} |
---|
116 |
} |
---|
117 |
|
---|
118 |
if (!isset($_SESSION['LEGENDTEMPLATE'.$this->mnId])) |
---|
119 |
{ |
---|
120 |
if (isset($this->maParams["TEMPLATE"])) |
---|
121 |
{ |
---|
122 |
$this->mszTemplate = trim($this->maParams["TEMPLATE"]); |
---|
123 |
if (strtoupper(substr($this->mszTemplate, 0, 7)) == "HTTP://" || |
---|
124 |
strtoupper(substr($this->mszTemplate, 0, 8)) == "HTTPS://") |
---|
125 |
{ |
---|
126 |
$aszFile = file($this->mszTemplate); |
---|
127 |
$szTmpName = tempnam($_SESSION['gszTmpPath'], "legendtemplate").".html"; |
---|
128 |
$fh = fopen($szTmpName, "w"); |
---|
129 |
|
---|
130 |
$nbLine = count($aszFile); |
---|
131 |
|
---|
132 |
for($i=0; $i<$nbLine; $i++) |
---|
133 |
{ |
---|
134 |
fwrite($fh, $aszFile[$i]); |
---|
135 |
} |
---|
136 |
fclose($fh); |
---|
137 |
|
---|
138 |
$this->mszTemplate = $szTmpName; |
---|
139 |
} |
---|
140 |
else |
---|
141 |
{ |
---|
142 |
$oApp= GetChameleonApplication(); |
---|
143 |
|
---|
144 |
if (get_class($oApp) == "serviceinstanceapp" && |
---|
145 |
!$oApp->IsAbsolutePath( $this->mszTemplate)) |
---|
146 |
{ |
---|
147 |
|
---|
148 |
|
---|
149 |
$szAppTemplate = $oApp->GetCurrentTemplate(); |
---|
150 |
if ($szAppTemplate !== false) |
---|
151 |
{ |
---|
152 |
$this->mszTemplate = dirname( $szAppTemplate ) . "/" . $this->mszTemplate; |
---|
153 |
$szLocalTemplate = $oApp->getRemoteFile( $this->mszTemplate, "html"); |
---|
154 |
if ($szLocalTemplate === false) |
---|
155 |
{ |
---|
156 |
|
---|
157 |
$_SESSION['gErrorManager']->setError(ERR_WARNING, $this->mszTemplate." could not be found relative to ".dirname($szAppTemplate)); |
---|
158 |
$this->mszTemplate = ""; |
---|
159 |
} |
---|
160 |
else |
---|
161 |
$this->mszTemplate = $szLocalTemplate; |
---|
162 |
} |
---|
163 |
else |
---|
164 |
{ |
---|
165 |
$_SESSION['gErrorManager']->setError(ERR_WARNING, $this->mszTemplate." could not be found relative to ".dirname($szAppTemplate)); |
---|
166 |
|
---|
167 |
} |
---|
168 |
} |
---|
169 |
else |
---|
170 |
{ |
---|
171 |
$this->mszTemplate = $oApp->resolvePath2($this->mszTemplate, $GLOBALS['gszAppPath'] ); |
---|
172 |
} |
---|
173 |
|
---|
174 |
} |
---|
175 |
} |
---|
176 |
$_SESSION['LEGENDTEMPLATE'.$this->mnId] = $this->mszTemplate; |
---|
177 |
} |
---|
178 |
else |
---|
179 |
$this->mszTemplate = $_SESSION['LEGENDTEMPLATE'.$this->mnId]; |
---|
180 |
} |
---|
181 |
|
---|
182 |
function GetJavascriptInitFunctions() |
---|
183 |
{ |
---|
184 |
if (!$this->mbEmbedded) |
---|
185 |
{ |
---|
186 |
return $this->moButton->GetJavascriptInitFunctions(); |
---|
187 |
} |
---|
188 |
else |
---|
189 |
return array(); |
---|
190 |
} |
---|
191 |
|
---|
192 |
function GetJavascriptVariables() |
---|
193 |
{ |
---|
194 |
$aResult = array(); |
---|
195 |
|
---|
196 |
if (!$this->mbEmbedded) |
---|
197 |
{ |
---|
198 |
$aResult = $this->moButton->GetJavascriptVariables(); |
---|
199 |
} |
---|
200 |
|
---|
201 |
|
---|
202 |
} |
---|
203 |
|
---|
204 |
function GetJavascriptIncludeFunctions() |
---|
205 |
{ |
---|
206 |
if (!$this->mbEmbedded) |
---|
207 |
{ |
---|
208 |
return $this->moButton->GetJavascriptIncludeFunctions(); |
---|
209 |
} |
---|
210 |
else |
---|
211 |
return array(); |
---|
212 |
} |
---|
213 |
|
---|
214 |
|
---|
215 |
|
---|
216 |
|
---|
217 |
|
---|
218 |
function GetJavascriptFunctions() |
---|
219 |
{ |
---|
220 |
$poMap = $this->moMapObject->oMap; |
---|
221 |
|
---|
222 |
$aReturn = array(); |
---|
223 |
|
---|
224 |
$aReturn = parent::GetJavascriptFunctions(); |
---|
225 |
|
---|
226 |
$url_sid = SID; |
---|
227 |
if (isset($_SESSION['gszCoreWebPath'])) |
---|
228 |
{ |
---|
229 |
$szWidgetPath = $_SESSION['gszCoreWebPath'] . "/widgets/LegendTemplate/"; |
---|
230 |
} |
---|
231 |
else |
---|
232 |
{ |
---|
233 |
$szWidgetPath = "widgets/LegendTemplate/"; |
---|
234 |
} |
---|
235 |
|
---|
236 |
|
---|
237 |
$szLayers = "aLayers = new Array();\n"; |
---|
238 |
$oMap = $this->moMapObject->oMap; |
---|
239 |
|
---|
240 |
$icounter = 0; |
---|
241 |
|
---|
242 |
for( $i=0; $i< $oMap->numlayers; $i++) |
---|
243 |
{ |
---|
244 |
$oLayer = $oMap->getLayer( $i ); |
---|
245 |
if ($oLayer->status == MS_DELETE) { } |
---|
246 |
else |
---|
247 |
{ |
---|
248 |
$oLayer->setmetadata( "layer_index", $icounter ); |
---|
249 |
$szLayers .= 'aLayers['.$icounter.'] = "'.$oLayer->name.'";'."\n"; |
---|
250 |
$icounter++; |
---|
251 |
} |
---|
252 |
} |
---|
253 |
|
---|
254 |
$szJsFunctionName = "LegendTemplateGetLayerName"; |
---|
255 |
$szFunction = <<<EOT |
---|
256 |
function {$szJsFunctionName}( index ) |
---|
257 |
{ |
---|
258 |
{$szLayers} |
---|
259 |
return aLayers[index]; |
---|
260 |
} |
---|
261 |
|
---|
262 |
EOT; |
---|
263 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
264 |
|
---|
265 |
if ($this->mbEmbedded) |
---|
266 |
{ |
---|
267 |
$szJsFunctionName = "LegendTemplateLayerInfo"; |
---|
268 |
$szButtonJS = $this->moPopup->DrawPublish(); |
---|
269 |
$szFunction = <<<EOT |
---|
270 |
/** |
---|
271 |
* {$szJsFunctionName} |
---|
272 |
* called to popup infos on the layer into a separate window |
---|
273 |
*/ |
---|
274 |
function {$szJsFunctionName}(layername) |
---|
275 |
{ |
---|
276 |
{$szButtonJS} |
---|
277 |
} |
---|
278 |
EOT; |
---|
279 |
|
---|
280 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
281 |
} |
---|
282 |
|
---|
283 |
if (!$this->mbEmbedded) |
---|
284 |
{ |
---|
285 |
$szJsFunctionName = "LegendTemplatePopup"; |
---|
286 |
$szFunction = "function $szJsFunctionName( button, widgetId )\n" . |
---|
287 |
"{\n". |
---|
288 |
$this->moPopup->DrawPublish()."\n". |
---|
289 |
"return;\n" . |
---|
290 |
"}\n"; |
---|
291 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
292 |
} |
---|
293 |
|
---|
294 |
|
---|
295 |
if (isset($this->maSharedResourceWidgets["CWCJSAPI"])) |
---|
296 |
$bCWCJSAPI = 1; |
---|
297 |
else |
---|
298 |
$bCWCJSAPI = 0; |
---|
299 |
|
---|
300 |
if ($bCWCJSAPI) |
---|
301 |
{ |
---|
302 |
$szJsFunctionName = "LegendTemplateWRegisterForEvent"; |
---|
303 |
$szFunction = <<<EOT |
---|
304 |
/** |
---|
305 |
* {$szJsFunctionName} |
---|
306 |
* called to register events when the layers change (JSAPI) |
---|
307 |
*/ |
---|
308 |
function {$szJsFunctionName}() |
---|
309 |
{ |
---|
310 |
goCWCJSAPI.RegisterEvent(LAYER_STATUS_CHANGED, "LegendTemplateWLayersChanged"); |
---|
311 |
goCWCJSAPI.RegisterEvent(LAYER_ORDER_CHANGED, "LegendTemplateWLayersChanged"); |
---|
312 |
goCWCJSAPI.RegisterEvent(MAP_NEW_LAYER_ADDED, "LegendTemplateWLayersChanged"); |
---|
313 |
} |
---|
314 |
EOT; |
---|
315 |
|
---|
316 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
317 |
$szJsFunctionName = "LegendTemplateWLayersChanged"; |
---|
318 |
$szFunction = <<<EOT |
---|
319 |
/** |
---|
320 |
* {$szJsFunctionName} |
---|
321 |
* called when the layers are changed(JSAPI) |
---|
322 |
*/ |
---|
323 |
function {$szJsFunctionName}() |
---|
324 |
{ |
---|
325 |
goCWCJSAPI.ProcessLegendTemplate({$this->mnId}); |
---|
326 |
} |
---|
327 |
EOT; |
---|
328 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
329 |
|
---|
330 |
} |
---|
331 |
|
---|
332 |
|
---|
333 |
|
---|
334 |
return $aReturn; |
---|
335 |
} |
---|
336 |
|
---|
337 |
|
---|
338 |
|
---|
339 |
|
---|
340 |
|
---|
341 |
|
---|
342 |
function GetJavascriptOnLoadFunctions() |
---|
343 |
{ |
---|
344 |
if (!$this->mbEmbedded) |
---|
345 |
{ |
---|
346 |
$aReturn = $this->moButton->GetJavascriptOnLoadFunctions(); |
---|
347 |
} |
---|
348 |
else |
---|
349 |
$aReturn = parent::GetJavascriptOnLoadFunctions(); |
---|
350 |
|
---|
351 |
if (isset($this->maSharedResourceWidgets["CWCJSAPI"])) |
---|
352 |
{ |
---|
353 |
$szJsFunctionName = "LegendTemplateWRegisterForEvent"; |
---|
354 |
$szFunction = "$szJsFunctionName();\n"; |
---|
355 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
356 |
} |
---|
357 |
|
---|
358 |
return $aReturn; |
---|
359 |
} |
---|
360 |
|
---|
361 |
|
---|
362 |
|
---|
363 |
|
---|
364 |
|
---|
365 |
|
---|
366 |
function ParseURL() |
---|
367 |
{ |
---|
368 |
if (!$this->mbControlVisibility) |
---|
369 |
return true; |
---|
370 |
|
---|
371 |
|
---|
372 |
$oMap = $this->moMapObject->oMap; |
---|
373 |
|
---|
374 |
if ($this->mbEmbedded) |
---|
375 |
{ |
---|
376 |
if ($this->isVarSet("LEGENDTEMPLATE_LAYERS")) |
---|
377 |
{ |
---|
378 |
$aLayers = explode( "~~", $this->getVar("LEGENDTEMPLATE_LAYERS") ); |
---|
379 |
} |
---|
380 |
else |
---|
381 |
{ |
---|
382 |
$aLayers = array(); |
---|
383 |
} |
---|
384 |
|
---|
385 |
if ($this->isVarSet("LEGENDTEMPLATE_RESET") && $this->getVar("LEGENDTEMPLATE_RESET") != "") |
---|
386 |
{ |
---|
387 |
} |
---|
388 |
elseif ($this->isVarSet("legendlayername") || (!$this->isVarSet("legendgroupname") && count($aLayers) > 0 )) |
---|
389 |
{ |
---|
390 |
if ($this->isVarSet("legendlayername")) |
---|
391 |
$aLegendLayers = $this->getVar("legendlayername"); |
---|
392 |
else |
---|
393 |
$aLegendLayers = array(); |
---|
394 |
$nLayers = count($aLegendLayers); |
---|
395 |
|
---|
396 |
for ($i=0; $i<$oMap->numlayers; $i++) |
---|
397 |
{ |
---|
398 |
$oLayer = @$oMap->getlayer($i); |
---|
399 |
if ($oLayer->status == MS_DELETE) |
---|
400 |
continue; |
---|
401 |
|
---|
402 |
if (in_array($oLayer->name, $aLegendLayers)) |
---|
403 |
{ |
---|
404 |
$oLayer->set("status", MS_ON); |
---|
405 |
} |
---|
406 |
else |
---|
407 |
{ |
---|
408 |
if (in_array($oLayer->name, $aLayers )) |
---|
409 |
{ |
---|
410 |
if (!($oLayer->status == MS_DEFAULT)) |
---|
411 |
{ |
---|
412 |
$oLayer->set("status", MS_OFF); |
---|
413 |
} |
---|
414 |
} |
---|
415 |
} |
---|
416 |
} |
---|
417 |
} |
---|
418 |
elseif ($this->isVarSet("legendgroupname") || count($aLayers) > 0 ) |
---|
419 |
{ |
---|
420 |
if ($this->isVarSet("legendgroupname")) |
---|
421 |
$aLegendGroups = $this->getVar("legendgroupname"); |
---|
422 |
else |
---|
423 |
$aLegendGroups = array(); |
---|
424 |
$nLegendGroups = count($aLegendGroups); |
---|
425 |
$aAllGroups = $oMap->getAllGroupNames(); |
---|
426 |
for ($i=0; $i<$oMap->numlayers; $i++) |
---|
427 |
{ |
---|
428 |
$oLayer = @$oMap->getlayer($i); |
---|
429 |
if (in_array($oLayer->name, $aLayers ) && in_array($oLayer->group, $aAllGroups)) |
---|
430 |
{ |
---|
431 |
$oLayer->set("status", MS_OFF); |
---|
432 |
} |
---|
433 |
} |
---|
434 |
|
---|
435 |
for ($i=0; $i<$nLegendGroups; $i++) |
---|
436 |
{ |
---|
437 |
if (in_array($aLegendGroups[$i], $aAllGroups)) |
---|
438 |
{ |
---|
439 |
$aLayerInGroup = |
---|
440 |
$oMap->getLayersIndexByGroup($aLegendGroups[$i]); |
---|
441 |
$nLayerInGroup = count($aLayerInGroup); |
---|
442 |
for ($j=0; $j<$nLayerInGroup; $j++) |
---|
443 |
{ |
---|
444 |
$oLayer = @$oMap->getlayer($aLayerInGroup[$j]); |
---|
445 |
if ($oLayer->status == MS_DELETE) |
---|
446 |
continue; |
---|
447 |
if (in_array($oLayer->name, $aLayers )) |
---|
448 |
{ |
---|
449 |
$oLayer->set("status", MS_ON); |
---|
450 |
} |
---|
451 |
} |
---|
452 |
} |
---|
453 |
} |
---|
454 |
} |
---|
455 |
} |
---|
456 |
|
---|
457 |
|
---|
458 |
return true; |
---|
459 |
} |
---|
460 |
|
---|
461 |
function GetHTMLHiddenVariables() |
---|
462 |
{ |
---|
463 |
if (!$this->mbEmbedded) |
---|
464 |
{ |
---|
465 |
$aReturn = $this->moButton->GetHTMLHiddenVariables(); |
---|
466 |
} |
---|
467 |
else |
---|
468 |
{ |
---|
469 |
$aReturn = array(); |
---|
470 |
} |
---|
471 |
|
---|
472 |
$szVariable = "LEGENDTEMPLATE_RESET"; |
---|
473 |
$szValue = " <INPUT TYPE=HIDDEN NAME=$szVariable VALUE=\"\">\n"; |
---|
474 |
$aReturn[$szVariable] = $szValue; |
---|
475 |
|
---|
476 |
|
---|
477 |
$szLayerNames = ""; |
---|
478 |
$szSep = ""; |
---|
479 |
$oMap = $this->moMapObject->oMap; |
---|
480 |
for ($i=0; $i<$oMap->numlayers; $i++) |
---|
481 |
{ |
---|
482 |
$oLayer = $oMap->getlayer($i); |
---|
483 |
|
---|
484 |
if( $oLayer->status != MS_DELETE ) |
---|
485 |
{ |
---|
486 |
$szLayerNames .= $szSep . $oLayer->name; |
---|
487 |
$szSep = "~~"; |
---|
488 |
} |
---|
489 |
} |
---|
490 |
|
---|
491 |
$szVariable = "LEGENDTEMPLATE_LAYERS"; |
---|
492 |
$szValue = " <INPUT TYPE=\"HIDDEN\" NAME=\"$szVariable\" VALUE=\"$szLayerNames\">\n"; |
---|
493 |
$aReturn[$szVariable] = $szValue; |
---|
494 |
|
---|
495 |
return $aReturn; |
---|
496 |
} |
---|
497 |
|
---|
498 |
|
---|
499 |
|
---|
500 |
|
---|
501 |
|
---|
502 |
|
---|
503 |
|
---|
504 |
|
---|
505 |
function DrawPublish() |
---|
506 |
{ |
---|
507 |
$poMap = $this->moMapObject->oMap; |
---|
508 |
$szOldTemplate = $poMap->legend->template; |
---|
509 |
$poMap->legend->set("template",$this->mszTemplate); |
---|
510 |
if (!$this->mbVisible) |
---|
511 |
return "<!-- LegendTemplateWidget is hidden -->"; |
---|
512 |
|
---|
513 |
|
---|
514 |
if ($this->mszTemplate != "") |
---|
515 |
{ |
---|
516 |
|
---|
517 |
|
---|
518 |
|
---|
519 |
|
---|
520 |
|
---|
521 |
|
---|
522 |
|
---|
523 |
|
---|
524 |
|
---|
525 |
|
---|
526 |
$nLayers = $poMap->numlayers; |
---|
527 |
for ($i=0; $i<$nLayers; $i++) |
---|
528 |
{ |
---|
529 |
$poLayer = $poMap->getlayer($i); |
---|
530 |
$poLayer->setMetaData("LEGEND_ORDER", $i); |
---|
531 |
} |
---|
532 |
if ($this->mbEmbedded) |
---|
533 |
{ |
---|
534 |
$szLegendTemp = @$poMap->processLegendTemplate( array()); |
---|
535 |
|
---|
536 |
if (!$szLegendTemp) |
---|
537 |
{ |
---|
538 |
$_SESSION['gErrorManager']->setError( ERR_FILE_IO, 'ERROR: MapScript cannot find legend template file '.$poMap->legend->template."." ); |
---|
539 |
|
---|
540 |
} |
---|
541 |
|
---|
542 |
|
---|
543 |
|
---|
544 |
if (isset($this->maSharedResourceWidgets["CWCJSAPI"])) |
---|
545 |
$szReturn = "<div name=\"legendTemplateDiv\" id=\"legendTemplateDiv\"><table>".$szLegendTemp."</table></div>"; |
---|
546 |
else |
---|
547 |
$szReturn = $szLegendTemp; |
---|
548 |
|
---|
549 |
|
---|
550 |
return $szReturn; |
---|
551 |
} |
---|
552 |
else |
---|
553 |
{ |
---|
554 |
$szReturn = $this->moButton->DrawPublish(); |
---|
555 |
|
---|
556 |
return $szReturn; |
---|
557 |
} |
---|
558 |
} |
---|
559 |
else |
---|
560 |
{ |
---|
561 |
$_SESSION['gErrorManager']->setError(ERR_WARNING, trim($this->moMLT->get("1", "No Template found for Legend widget."))); |
---|
562 |
} |
---|
563 |
if ($szOldTemplate != "" && |
---|
564 |
$szOldTemplate != $poMap->legend->template ) |
---|
565 |
$poMap->legend->set("template",$szOldTemplate); |
---|
566 |
|
---|
567 |
} |
---|
568 |
|
---|
569 |
} |
---|
570 |
?> |
---|
571 |
|
---|