Copyright (c) 2002, DM Solutions Group Inc. * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ include_once(dirname(__FILE__)."/../Widget.php"); include_once(dirname(__FILE__)."/../Button.php"); /** * UpdateMap * * @desc Display a clickable image that will navigate the map to one * of the points on the edge of the image */ class UpdateMap extends CWCWidget { var $moButton; /** * UpdateMap * * Constructor for the UpdateMap */ function UpdateMap() { // invoke constructor of parent parent::CWCWidget(); // set the description for this widget $this->szWidgetDescription = <<moButton = new CWCButton($this); $this->mnMaturityLevel = MATURITY_TECHNICALRELEASE; } function InitDefaults() { parent::InitDefaults(); //this widget should never belong to a toolset $this->maParams["TOOLSET"] = ""; $this->moButton->InitDefaults(); $this->moButton->SetOnClick( "clickUpdateMap" ); } /** * GetHTMLHiddenVariables * * Return HTML hidden variables. */ function GetHTMLHiddenVariables() { $aReturn = $this->moButton->GetHTMLHiddenVariables(); $szVariable = "UPDATE_MAP"; $szValue = " "; $aReturn[$szVariable] = $szValue; return $aReturn; } function GetJavascriptVariables() { if ($this->mbVisible) return $this->moButton->GetJavascriptVariables(); else return array(); } function GetJavascriptInitFunctions() { if ($this->mbVisible) return $this->moButton->GetJavascriptInitFunctions(); else return array(); } function GetJavascriptOnLoadFunctions() { if ($this->mbVisible) $aReturn = $this->moButton->GetJavascriptOnLoadFunctions(); else $aReturn = array(); return $aReturn; } function GetJavascriptIncludeFunctions() { if ($this->mbVisible) $aReturn = $this->moButton->GetJavascriptIncludeFunctions(); else $aReturn = array(); return $aReturn; } /** * GetJavascriptFunctions * * Return the Javacriptfunctions needed by the widget. */ function GetJavascriptFunctions() { $aReturn = array(); $bCWCJSAPI = (isset($this->maSharedResourceWidgets["CWCJSAPI"])) ? 1 : 0; //$bCWCJSAPI = 0; $szJsFunctionName = "clickUpdateMap"; $szFunction = <<mszHTMLForm}.NAV_CMD.value = ''; {$this->mszHTMLForm}.UPDATE_MAP.value = "1"; if ({$bCWCJSAPI}) { {$this->mszHTMLForm}.MAP_EXTENTS_MINX.value = goCWCJSAPI.oMap.minx; {$this->mszHTMLForm}.MAP_EXTENTS_MAXX.value = goCWCJSAPI.oMap.maxx; {$this->mszHTMLForm}.MAP_EXTENTS_MINY.value = goCWCJSAPI.oMap.miny; {$this->mszHTMLForm}.MAP_EXTENTS_MAXY.value = goCWCJSAPI.oMap.maxy; {$this->mszHTMLForm}.NAV_CMD.value = ""; } {$this->mszHTMLForm}.submit(); return; } EOT; $aReturn[$szJsFunctionName] = $szFunction; return $aReturn; } /** * DrawPublish * * Return the HTML code using the name in the map file and the * parameters of the CWC tag. */ function DrawPublish() { if (!$this->mbVisible) return ""; return $this->moButton->DrawPublish(); } } ?>