Parser error fixed...
[mailer.git] / inc / extensions / ext-iso3166.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 12/08/2008 *
4  * ===================                          Last change: 12/08/2008 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-iso3166.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Country code list ISO3166                        *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Laendercode-Liste ISO3166                        *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2008 by Wolfgang Stelzhammer                           *
21  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
22  * For more information visit: http://www.mxchange.org                  *
23  *                                                                      *
24  * This program is free software; you can redistribute it and/or modify *
25  * it under the terms of the GNU General Public License as published by *
26  * the Free Software Foundation; either version 2 of the License, or    *
27  * (at your option) any later version.                                  *
28  *                                                                      *
29  * This program is distributed in the hope that it will be useful,      *
30  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
31  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
32  * GNU General Public License for more details.                         *
33  *                                                                      *
34  * You should have received a copy of the GNU General Public License    *
35  * along with this program; if not, write to the Free Software          *
36  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
37  * MA  02110-1301  USA                                                  *
38  ************************************************************************/
39
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
42         die();
43 }
44
45 // Version number
46 setThisExtensionVersion('0.0.1');
47
48 // Version history array (add more with , '0.1.0' and so on)
49 setExtensionVersionHistory(array('0.0', '0.0.1'));
50
51 switch (getExtensionMode()) {
52         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
53                 // SQL commands to run
54                 addExtensionSql('');
55                 break;
56
57         case 'remove': // Do stuff when removing extension
58                 // SQL commands to run
59                 addExtensionSql("DELETE FROM `{?_MYSQL_PREFIX?}_countries` WHERE provider = 'ext-iso3166';");
60                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_countries` DROP `provider`;");
61                 break;
62
63         case 'activate': // Do stuff when admin activates this extension
64                 // SQL commands to run
65                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET is_active = 'Y' WHERE provider = 'ext-iso3166';");
66                 break;
67
68         case 'deactivate': // Do stuff when admin deactivates this extension
69                 // SQL commands to run
70                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET is_active='N' WHERE provider = 'ext-iso3166';");
71                 break;
72
73         case 'update': // Update an extension
74                 switch (getCurrentExtensionVersion()) {
75                         case '0.0.1': // SQL queries for v0.0.2
76                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_countries` ADD `provider` ENUM( 'user', 'ext-iso3166' ) NOT NULL DEFAULT 'user';");
77                                 addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`,`descr`,`provider`)
78 VALUES ('AD', 'Andorra', 'ext-iso3166'),
79 ('AE', 'Vereinigte Arabische Emirate', 'ext-iso3166'),
80 ('AF', 'Afghanistan', 'ext-iso3166'),
81 ('AG', 'Antigua und Barbuda', 'ext-iso3166'),
82 ('AI', 'Anguilla', 'ext-iso3166'),
83 ('AL', 'Albanien', 'ext-iso3166'),
84 ('AM', 'Armenien', 'ext-iso3166'),
85 ('AN', 'Niederl&auml;ndische Antillen', 'ext-iso3166'),
86 ('AO', 'Angola', 'ext-iso3166'),
87 ('AQ', 'Antarktis', 'ext-iso3166'),
88 ('AR', 'Argentinien', 'ext-iso3166'),
89 ('AS', 'Samoa', 'ext-iso3166'),
90 ('AT', '&Ouml;sterreich', 'ext-iso3166'),
91 ('AU', 'Australien', 'ext-iso3166'),
92 ('AW', 'Aruba', 'ext-iso3166'),
93 ('AZ', 'Aserbadmin_idschan', 'ext-iso3166'),
94 ('BA', 'Bosnien-Herzegowina', 'ext-iso3166'),
95 ('BB', 'Barbados', 'ext-iso3166'),
96 ('BD', 'Bangladesh', 'ext-iso3166'),
97 ('BE', 'Belgien', 'ext-iso3166'),
98 ('BF', 'Burkina Faso', 'ext-iso3166'),
99 ('BG', 'Bulgarien', 'ext-iso3166'),
100 ('BH', 'Bahrain', 'ext-iso3166'),
101 ('BI', 'Burundi', 'ext-iso3166'),
102 ('BJ', 'Benin', 'ext-iso3166'),
103 ('BM', 'Bermudas', 'ext-iso3166'),
104 ('BN', 'Brunei', 'ext-iso3166'),
105 ('BO', 'Bolivien', 'ext-iso3166'),
106 ('BR', 'Brasilien', 'ext-iso3166'),
107 ('BS', 'Bahamas', 'ext-iso3166'),
108 ('BT', 'Bhutan', 'ext-iso3166'),
109 ('BV', 'Bouvet-Inseln', 'ext-iso3166'),
110 ('BW', 'Botswana', 'ext-iso3166'),
111 ('BY', 'Wei&szlig;russland', 'ext-iso3166'),
112 ('BZ', 'Belize', 'ext-iso3166'),
113 ('CA', 'Kanada', 'ext-iso3166'),
114 ('CC', 'Kokosinseln', 'ext-iso3166'),
115 ('CD', 'Demokratische Republik Kongo (ehemals ZR: Zaire)', 'ext-iso3166'),
116 ('CF', 'Zentralafrikanische Republik', 'ext-iso3166'),
117 ('CG', 'Kongo', 'ext-iso3166'),
118 ('CH', 'Schweiz', 'ext-iso3166'),
119 ('CI', 'Elfenbeink&uuml;ste', 'ext-iso3166'),
120 ('CK', 'Cook-Inseln', 'ext-iso3166'),
121 ('CL', 'Chile', 'ext-iso3166'),
122 ('CM', 'Kamerun', 'ext-iso3166'),
123 ('CN', 'China', 'ext-iso3166'),
124 ('CO', 'Kolumbien', 'ext-iso3166'),
125 ('CR', 'Costa Rica', 'ext-iso3166'),
126 ('CS', 'Serbien und Montenegro (fr&uuml;her Tschechoslowakei)', 'ext-iso3166'),
127 ('CU', 'Kuba', 'ext-iso3166'),
128 ('CV', 'Kap Verde', 'ext-iso3166'),
129 ('CX', 'Christmas Island', 'ext-iso3166'),
130 ('CY', 'Zypern', 'ext-iso3166'),
131 ('CZ', 'Tschechische Republik', 'ext-iso3166'),
132 ('DJ', 'Djibuti', 'ext-iso3166'),
133 ('DE', 'Deutschland', 'ext-iso3166'),
134 ('DK', 'D&auml;nemark', 'ext-iso3166'),
135 ('DM', 'Dominika', 'ext-iso3166'),
136 ('DO', 'Dominikanische Republik', 'ext-iso3166'),
137 ('DZ', 'Algerien', 'ext-iso3166'),
138 ('EC', 'Ecuador', 'ext-iso3166'),
139 ('EE', 'Estland', 'ext-iso3166'),
140 ('EG', '&Auml;gypten', 'ext-iso3166'),
141 ('EH', 'Westsahara', 'ext-iso3166'),
142 ('ER', 'Eritrea', 'ext-iso3166'),
143 ('ES', 'Spanien', 'ext-iso3166'),
144 ('ET', '&Auml;thiopien', 'ext-iso3166'),
145 ('FI', 'Finnland', 'ext-iso3166'),
146 ('FJ', 'Fidschi-Inseln', 'ext-iso3166'),
147 ('FK', 'Falkland-Inseln', 'ext-iso3166'),
148 ('FM', 'Mikronesien', 'ext-iso3166'),
149 ('FO', 'F&auml;r&ouml;er Inseln', 'ext-iso3166'),
150 ('FR', 'Frankreich', 'ext-iso3166'),
151 ('FX', 'Frankreich (nur Europa)', 'ext-iso3166'),
152 ('GA', 'Gabun', 'ext-iso3166'),
153 ('GB', 'Gro&szlig;britannien (UK)', 'ext-iso3166'),
154 ('GD', 'Grenada', 'ext-iso3166'),
155 ('GE', 'Georgien', 'ext-iso3166'),
156 ('GF', 'franz&ouml;sisch Guyana', 'ext-iso3166'),
157 ('GH', 'Ghana', 'ext-iso3166'),
158 ('GI', 'Gibraltar', 'ext-iso3166'),
159 ('GL', 'Gr&ouml;nland', 'ext-iso3166'),
160 ('GM', 'Gambia', 'ext-iso3166'),
161 ('GN', 'Guinea', 'ext-iso3166'),
162 ('GP', 'Guadeloupe', 'ext-iso3166'),
163 ('GQ', '&Auml;quatorial Guinea', 'ext-iso3166'),
164 ('GR', 'Griechenland', 'ext-iso3166'),
165 ('GS', 'South Georgia und South Sandwich Islands', 'ext-iso3166'),
166 ('GT', 'Guatemala', 'ext-iso3166'),
167 ('GU', 'Guam', 'ext-iso3166'),
168 ('GW', 'Guinea Bissau', 'ext-iso3166'),
169 ('GY', 'Guyana', 'ext-iso3166'),
170 ('HK', 'Hong Kong', 'ext-iso3166'),
171 ('HM', 'Heard und McDonald Islands', 'ext-iso3166'),
172 ('HN', 'Honduras', 'ext-iso3166'),
173 ('HR', 'Kroatien', 'ext-iso3166'),
174 ('HT', 'Haiti', 'ext-iso3166'),
175 ('HU', 'Ungarn', 'ext-iso3166'),
176 ('ID', 'Indonesien', 'ext-iso3166'),
177 ('IE', 'Irland', 'ext-iso3166'),
178 ('IL', 'Israel', 'ext-iso3166'),
179 ('IN', 'Indien', 'ext-iso3166'),
180 ('IO', 'Britisch-Indischer Ozean', 'ext-iso3166'),
181 ('IQ', 'Irak', 'ext-iso3166'),
182 ('IR', 'Iran', 'ext-iso3166'),
183 ('IS', 'Island', 'ext-iso3166'),
184 ('IT', 'Italien', 'ext-iso3166'),
185 ('JM', 'Jamaika', 'ext-iso3166'),
186 ('JO', 'Jordanien', 'ext-iso3166'),
187 ('JP', 'Japan', 'ext-iso3166'),
188 ('KE', 'Kenia', 'ext-iso3166'),
189 ('KG', 'Kirgisistan', 'ext-iso3166'),
190 ('KH', 'Kambodscha', 'ext-iso3166'),
191 ('KI', 'Kiribati', 'ext-iso3166'),
192 ('KM', 'Komoren', 'ext-iso3166'),
193 ('KN', 'St. Kitts Nevis Anguilla', 'ext-iso3166'),
194 ('KP', 'Nordkorea', 'ext-iso3166'),
195 ('KR', 'S&uuml;dkorea', 'ext-iso3166'),
196 ('KW', 'Kuwait', 'ext-iso3166'),
197 ('KY', 'Kaiman-Inseln', 'ext-iso3166'),
198 ('KZ', 'Kasachstan', 'ext-iso3166'),
199 ('LA', 'Laos', 'ext-iso3166'),
200 ('LB', 'Libanon', 'ext-iso3166'),
201 ('LC', 'Saint Lucia', 'ext-iso3166'),
202 ('LI', 'Liechtenstein', 'ext-iso3166'),
203 ('LK', 'Sri Lanka', 'ext-iso3166'),
204 ('LR', 'Liberia', 'ext-iso3166'),
205 ('LS', 'Lesotho', 'ext-iso3166'),
206 ('LT', 'Litauen', 'ext-iso3166'),
207 ('LU', 'Luxemburg', 'ext-iso3166'),
208 ('LV', 'Lettland', 'ext-iso3166'),
209 ('LY', 'Libyen', 'ext-iso3166'),
210 ('MA', 'Marokko', 'ext-iso3166'),
211 ('MC', 'Monaco', 'ext-iso3166'),
212 ('MD', 'Moldavien', 'ext-iso3166'),
213 ('MG', 'Madagaskar', 'ext-iso3166'),
214 ('MH', 'Marshall-Inseln', 'ext-iso3166'),
215 ('MK', 'Mazedonien', 'ext-iso3166'),
216 ('ML', 'Mali', 'ext-iso3166'),
217 ('MM', 'Myanmar', 'ext-iso3166'),
218 ('MN', 'Mongolei', 'ext-iso3166'),
219 ('MO', 'Macao', 'ext-iso3166'),
220 ('MP', 'Marianen', 'ext-iso3166'),
221 ('MQ', 'Martinique', 'ext-iso3166'),
222 ('MR', 'Mauretanien', 'ext-iso3166'),
223 ('MS', 'Montserrat', 'ext-iso3166'),
224 ('MT', 'Malta', 'ext-iso3166'),
225 ('MU', 'Mauritius', 'ext-iso3166'),
226 ('MV', 'Malediven', 'ext-iso3166'),
227 ('MW', 'Malawi', 'ext-iso3166'),
228 ('MX', 'Mexiko', 'ext-iso3166'),
229 ('MY', 'Malaysia', 'ext-iso3166'),
230 ('MZ', 'Mocambique', 'ext-iso3166'),
231 ('NA', 'Namibia', 'ext-iso3166'),
232 ('NC', 'Neukaledonien', 'ext-iso3166'),
233 ('NE', 'Niger', 'ext-iso3166'),
234 ('NF', 'Norfolk-Inseln', 'ext-iso3166'),
235 ('NG', 'Nigeria', 'ext-iso3166'),
236 ('NI', 'Nicaragua', 'ext-iso3166'),
237 ('NL', 'Niederlande', 'ext-iso3166'),
238 ('NO', 'Norwegen', 'ext-iso3166'),
239 ('NP', 'Nepal', 'ext-iso3166'),
240 ('NR', 'Nauru', 'ext-iso3166'),
241 ('NU', 'Niue', 'ext-iso3166'),
242 ('NZ', 'Neuseeland', 'ext-iso3166'),
243 ('OM', 'Oman', 'ext-iso3166'),
244 ('PA', 'Panama', 'ext-iso3166'),
245 ('PE', 'Peru', 'ext-iso3166'),
246 ('PF', 'Franz&ouml;sisch-Polynesien', 'ext-iso3166'),
247 ('PG', 'Papua Neuguinea', 'ext-iso3166'),
248 ('PH', 'Philippinen', 'ext-iso3166'),
249 ('PK', 'Pakistan', 'ext-iso3166'),
250 ('PL', 'Polen', 'ext-iso3166'),
251 ('PM', 'St. Pierre und Miquelon', 'ext-iso3166'),
252 ('PN', 'Pitcairn', 'ext-iso3166'),
253 ('PR', 'Puerto Rico', 'ext-iso3166'),
254 ('PS', 'Pal&auml;stinensische Selbstverwaltungsgebiete', 'ext-iso3166'),
255 ('PT', 'Portugal', 'ext-iso3166'),
256 ('PW', 'Palau', 'ext-iso3166'),
257 ('PY', 'Paraguay', 'ext-iso3166'),
258 ('QA', 'Qatar', 'ext-iso3166'),
259 ('RE', 'Reunion', 'ext-iso3166'),
260 ('RO', 'Rum&auml;nien', 'ext-iso3166'),
261 ('RU', 'Russland', 'ext-iso3166'),
262 ('RW', 'Ruanda', 'ext-iso3166'),
263 ('SA', 'Saudi-Arabien', 'ext-iso3166'),
264 ('SB', 'Solomon-Inseln', 'ext-iso3166'),
265 ('SC', 'Seychellen', 'ext-iso3166'),
266 ('SD', 'Sudan', 'ext-iso3166'),
267 ('SE', 'Schweden', 'ext-iso3166'),
268 ('SG', 'Singapur', 'ext-iso3166'),
269 ('SH', 'St. Helena', 'ext-iso3166'),
270 ('SI', 'Slowenien', 'ext-iso3166'),
271 ('SJ', 'Svalbard und Jan Mayen Islands', 'ext-iso3166'),
272 ('SK', 'Slowakei (Slowakische Republik)', 'ext-iso3166'),
273 ('SL', 'Sierra Leone', 'ext-iso3166'),
274 ('SM', 'San Marino', 'ext-iso3166'),
275 ('SN', 'Senegal', 'ext-iso3166'),
276 ('SO', 'Somalia', 'ext-iso3166'),
277 ('SR', 'Surinam', 'ext-iso3166'),
278 ('ST', 'Sao Tome', 'ext-iso3166'),
279 ('SU', 'Sowjetunion (obsolet)', 'ext-iso3166'),
280 ('SV', 'El Salvador', 'ext-iso3166'),
281 ('SY', 'Syrien', 'ext-iso3166'),
282 ('SZ', 'Swasiland', 'ext-iso3166'),
283 ('TC', 'Turks- und Kaikos-Inseln', 'ext-iso3166'),
284 ('TD', 'Tschad', 'ext-iso3166'),
285 ('TF', 'Franz&ouml;sisches S&uuml;d-Territorium', 'ext-iso3166'),
286 ('TG', 'Togo', 'ext-iso3166'),
287 ('TH', 'Thailand', 'ext-iso3166'),
288 ('TJ', 'Tadschikistan', 'ext-iso3166'),
289 ('TK', 'Tokelau', 'ext-iso3166'),
290 ('TL', 'Ost-Timor', 'ext-iso3166'),
291 ('TM', 'Turkmenistan', 'ext-iso3166'),
292 ('TN', 'Tunesien', 'ext-iso3166'),
293 ('TO', 'Tonga', 'ext-iso3166'),
294 ('TR', 'T&uuml;rkei', 'ext-iso3166'),
295 ('TT', 'Trinidad Tobago', 'ext-iso3166'),
296 ('TV', 'Tuvalu', 'ext-iso3166'),
297 ('TW', 'Taiwan', 'ext-iso3166'),
298 ('TZ', 'Tansania', 'ext-iso3166'),
299 ('UA', 'Ukraine', 'ext-iso3166'),
300 ('UG', 'Uganda', 'ext-iso3166'),
301 ('UK', 'Gro&szlig;britannien', 'ext-iso3166'),
302 ('UM', 'US- kleinere Inseln au&szlig;erhalb', 'ext-iso3166'),
303 ('US', 'Vereinigte Staaten von Amerika', 'ext-iso3166'),
304 ('UY', 'Uruguay', 'ext-iso3166'),
305 ('UZ', 'Usbekistan', 'ext-iso3166'),
306 ('VA', 'Vatikan', 'ext-iso3166'),
307 ('VC', 'St. Vincent', 'ext-iso3166'),
308 ('VE', 'Venezuela', 'ext-iso3166'),
309 ('VG', 'Virgin Island (Brit.)', 'ext-iso3166'),
310 ('VI', 'Virgin Island (USA)', 'ext-iso3166'),
311 ('VN', 'Vietnam', 'ext-iso3166'),
312 ('VU', 'Vanuatu', 'ext-iso3166'),
313 ('WF', 'Wallis et Futuna', 'ext-iso3166'),
314 ('WS', 'Samoa', 'ext-iso3166'),
315 ('YE', 'Jemen', 'ext-iso3166'),
316 ('YT', 'Mayotte', 'ext-iso3166'),
317 ('YU', 'Jugoslawien (obsolet)', 'ext-iso3166'),
318 ('ZA', 'S&uuml;dafrika', 'ext-iso3166'),
319 ('ZM', 'Sambia', 'ext-iso3166'),
320 ('ZW', 'Zimbabwe', 'ext-iso3166');");
321
322                                 // This extension depends on the country extension
323                                 addExtensionUpdateDependency('country');
324
325                                 // Update notes (these will be set as task text!)
326                                 setExtensionUpdateNotes("Erste Liste von 243 L&auml;ndercodes nach ISO 3166. (Quelle: Selfhtml)<br />Alle L&auml;nder sind zuerst deaktiviert. Achtung DE k&ouml;nnte doppelt vorkommen.<br />Ein Aktivieren/Deaktivieren l&auml;sst alle L&auml;nder beim Registrieren anzeigen oder nicht Anzeigen.");
327                                 break;
328
329                 }
330                 break;
331
332         case 'modify': // When the extension got modified
333                 break;
334
335         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
336                 break;
337
338         case 'init': // Do stuff when extension is initialized
339                 break;
340
341         default: // Unknown extension mode
342                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
343                 break;
344 }
345
346 // [EOF]
347 ?>