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 |
include_once(dirname(__FILE__)."/../Widget.php"); |
---|
30 |
include_once(dirname(__FILE__)."/../Button.php"); |
---|
31 |
|
---|
32 |
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 |
|
---|
37 |
class ClearQueryResults extends CWCWidget |
---|
38 |
{ |
---|
39 |
|
---|
40 |
|
---|
41 |
|
---|
42 |
|
---|
43 |
|
---|
44 |
|
---|
45 |
function ClearQueryResults( ) |
---|
46 |
{ |
---|
47 |
|
---|
48 |
parent::CWCWidget(); |
---|
49 |
|
---|
50 |
|
---|
51 |
$this->szWidgetDescription = <<<EOT |
---|
52 |
The ClearQueryResults widget allows the user to clear query results on |
---|
53 |
the current page without performing any other navigation. |
---|
54 |
EOT; |
---|
55 |
|
---|
56 |
$this->moButton = new CWCButton($this); |
---|
57 |
$this->mnMaturityLevel = MATURITY_BETA; |
---|
58 |
|
---|
59 |
} |
---|
60 |
|
---|
61 |
function InitDefaults() |
---|
62 |
{ |
---|
63 |
parent::InitDefaults(); |
---|
64 |
|
---|
65 |
$this->maParams["TOOLSET"] = ""; |
---|
66 |
$this->moButton->InitDefaults(); |
---|
67 |
$this->moButton->SetOnClick( "clickClearQueryResults" ); |
---|
68 |
} |
---|
69 |
|
---|
70 |
function GetJavascriptVariables() |
---|
71 |
{ |
---|
72 |
if ($this->mbVisible) |
---|
73 |
return $this->moButton->GetJavascriptVariables(); |
---|
74 |
else return array(); |
---|
75 |
} |
---|
76 |
|
---|
77 |
function GetJavascriptInitFunctions() |
---|
78 |
{ |
---|
79 |
if ($this->mbVisible) |
---|
80 |
return $this->moButton->GetJavascriptInitFunctions(); |
---|
81 |
else return array(); |
---|
82 |
} |
---|
83 |
|
---|
84 |
function GetJavascriptOnLoadFunctions() |
---|
85 |
{ |
---|
86 |
if ($this->mbVisible) |
---|
87 |
$aReturn = $this->moButton->GetJavascriptOnLoadFunctions(); |
---|
88 |
else |
---|
89 |
$aReturn = array(); |
---|
90 |
return $aReturn; |
---|
91 |
} |
---|
92 |
|
---|
93 |
function GetJavascriptIncludeFunctions() |
---|
94 |
{ |
---|
95 |
if ($this->mbVisible) |
---|
96 |
$aReturn = $this->moButton->GetJavascriptIncludeFunctions(); |
---|
97 |
else |
---|
98 |
$aReturn = array(); |
---|
99 |
return $aReturn; |
---|
100 |
} |
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 |
|
---|
105 |
|
---|
106 |
|
---|
107 |
function ParseURL() |
---|
108 |
{ |
---|
109 |
parent::ParseURL(); |
---|
110 |
|
---|
111 |
|
---|
112 |
return true; |
---|
113 |
} |
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|
117 |
|
---|
118 |
|
---|
119 |
|
---|
120 |
function GetHTMLHiddenVariables() |
---|
121 |
{ |
---|
122 |
$aReturn = $this->moButton->GetHTMLHiddenVariables(); |
---|
123 |
|
---|
124 |
return $aReturn; |
---|
125 |
} |
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|
129 |
|
---|
130 |
|
---|
131 |
|
---|
132 |
function GetJavascriptFunctions() |
---|
133 |
{ |
---|
134 |
$aReturn = array(); |
---|
135 |
|
---|
136 |
$szJsFunctionName = "clickClearQueryResults"; |
---|
137 |
$szFunction = <<<EOT |
---|
138 |
/** |
---|
139 |
* {$szJsFunctionName} |
---|
140 |
* called when the user clicks the ClearQueryResults icon |
---|
141 |
*/ |
---|
142 |
function {$szJsFunctionName}() |
---|
143 |
{ |
---|
144 |
var img = CWCDHTML_GetImage( 'MapLayerDivImg' ); |
---|
145 |
var url = gMapDHTMLURL; |
---|
146 |
var d = new Date(); |
---|
147 |
var unique = d.getTime() + '' + Math.floor(1000 * Math.random()); |
---|
148 |
url = url + "&UniqId="+unique; |
---|
149 |
img.src = url + "&gszPersistentQuery=false"; |
---|
150 |
return true; |
---|
151 |
} |
---|
152 |
EOT; |
---|
153 |
$aReturn[$szJsFunctionName] = $szFunction; |
---|
154 |
|
---|
155 |
return $aReturn; |
---|
156 |
} |
---|
157 |
|
---|
158 |
|
---|
159 |
|
---|
160 |
|
---|
161 |
|
---|
162 |
|
---|
163 |
|
---|
164 |
function DrawPublish() |
---|
165 |
{ |
---|
166 |
if (!$this->mbVisible) |
---|
167 |
return "<!-- ClearQueryResults widget hidden -->"; |
---|
168 |
return $this->moButton->DrawPublish(); |
---|
169 |
} |
---|
170 |
} |
---|
171 |
?> |
---|
172 |
|
---|