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