]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-iso3166.php
More '0' to NULL and fix for failing extension deprecation if no admin is logged in
[mailer.git] / inc / extensions / ext-iso3166.php
index 2d3ccd5bf5330038eadebbe381509698c101db04..3a0966950e71277da5191720915eff34ce38eb74 100644 (file)
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2008 by Wolfgang Stelzhammer                           *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2008 by Wolfgang Stelzhammer                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
 // Some security stuff...
 if (!defined('__SECURITY')) {
        die();
-}
+} // END - if
 
 // Version number
 setThisExtensionVersion('0.0.1');
 
-// Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0', '0.0.1'));
+// Version history array (add more with , '0.0.1' and so on)
+setExtensionVersionHistory(array('0.0.0', '0.0.1'));
+
+// This extension is deprecated!
+setExtensionDeprecated('Y');
 
 switch (getExtensionMode()) {
-       case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
-               // SQL commands to run
-               addExtensionSql('');
+       case 'register': // Do stuff when installation is running
                break;
 
        case 'remove': // Do stuff when removing extension
@@ -62,286 +62,34 @@ switch (getExtensionMode()) {
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET is_active = 'Y' WHERE provider = 'ext-iso3166';");
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
-               addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_countries` SET is_active='N' WHERE provider = 'ext-iso3166';");
                break;
 
        case 'update': // Update an extension
                switch (getCurrentExtensionVersion()) {
-                       case '0.0.1': // SQL queries for v0.0.2
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_countries` ADD `provider` ENUM( 'user', 'ext-iso3166' ) NOT NULL DEFAULT 'user';");
-                               addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`,`descr`,`provider`)
-VALUES ('AD', 'Andorra', 'ext-iso3166'),
-('AE', 'Vereinigte Arabische Emirate', 'ext-iso3166'),
-('AF', 'Afghanistan', 'ext-iso3166'),
-('AG', 'Antigua und Barbuda', 'ext-iso3166'),
-('AI', 'Anguilla', 'ext-iso3166'),
-('AL', 'Albanien', 'ext-iso3166'),
-('AM', 'Armenien', 'ext-iso3166'),
-('AN', 'Niederländische Antillen', 'ext-iso3166'),
-('AO', 'Angola', 'ext-iso3166'),
-('AQ', 'Antarktis', 'ext-iso3166'),
-('AR', 'Argentinien', 'ext-iso3166'),
-('AS', 'Samoa', 'ext-iso3166'),
-('AT', 'Österreich', 'ext-iso3166'),
-('AU', 'Australien', 'ext-iso3166'),
-('AW', 'Aruba', 'ext-iso3166'),
-('AZ', 'Aserbadmin_idschan', 'ext-iso3166'),
-('BA', 'Bosnien-Herzegowina', 'ext-iso3166'),
-('BB', 'Barbados', 'ext-iso3166'),
-('BD', 'Bangladesh', 'ext-iso3166'),
-('BE', 'Belgien', 'ext-iso3166'),
-('BF', 'Burkina Faso', 'ext-iso3166'),
-('BG', 'Bulgarien', 'ext-iso3166'),
-('BH', 'Bahrain', 'ext-iso3166'),
-('BI', 'Burundi', 'ext-iso3166'),
-('BJ', 'Benin', 'ext-iso3166'),
-('BM', 'Bermudas', 'ext-iso3166'),
-('BN', 'Brunei', 'ext-iso3166'),
-('BO', 'Bolivien', 'ext-iso3166'),
-('BR', 'Brasilien', 'ext-iso3166'),
-('BS', 'Bahamas', 'ext-iso3166'),
-('BT', 'Bhutan', 'ext-iso3166'),
-('BV', 'Bouvet-Inseln', 'ext-iso3166'),
-('BW', 'Botswana', 'ext-iso3166'),
-('BY', 'Weißrussland', 'ext-iso3166'),
-('BZ', 'Belize', 'ext-iso3166'),
-('CA', 'Kanada', 'ext-iso3166'),
-('CC', 'Kokosinseln', 'ext-iso3166'),
-('CD', 'Demokratische Republik Kongo (ehemals ZR: Zaire)', 'ext-iso3166'),
-('CF', 'Zentralafrikanische Republik', 'ext-iso3166'),
-('CG', 'Kongo', 'ext-iso3166'),
-('CH', 'Schweiz', 'ext-iso3166'),
-('CI', 'Elfenbeinküste', 'ext-iso3166'),
-('CK', 'Cook-Inseln', 'ext-iso3166'),
-('CL', 'Chile', 'ext-iso3166'),
-('CM', 'Kamerun', 'ext-iso3166'),
-('CN', 'China', 'ext-iso3166'),
-('CO', 'Kolumbien', 'ext-iso3166'),
-('CR', 'Costa Rica', 'ext-iso3166'),
-('CS', 'Serbien und Montenegro (früher Tschechoslowakei)', 'ext-iso3166'),
-('CU', 'Kuba', 'ext-iso3166'),
-('CV', 'Kap Verde', 'ext-iso3166'),
-('CX', 'Christmas Island', 'ext-iso3166'),
-('CY', 'Zypern', 'ext-iso3166'),
-('CZ', 'Tschechische Republik', 'ext-iso3166'),
-('DJ', 'Djibuti', 'ext-iso3166'),
-('DE', 'Deutschland', 'ext-iso3166'),
-('DK', 'Dänemark', 'ext-iso3166'),
-('DM', 'Dominika', 'ext-iso3166'),
-('DO', 'Dominikanische Republik', 'ext-iso3166'),
-('DZ', 'Algerien', 'ext-iso3166'),
-('EC', 'Ecuador', 'ext-iso3166'),
-('EE', 'Estland', 'ext-iso3166'),
-('EG', 'Ägypten', 'ext-iso3166'),
-('EH', 'Westsahara', 'ext-iso3166'),
-('ER', 'Eritrea', 'ext-iso3166'),
-('ES', 'Spanien', 'ext-iso3166'),
-('ET', 'Äthiopien', 'ext-iso3166'),
-('FI', 'Finnland', 'ext-iso3166'),
-('FJ', 'Fidschi-Inseln', 'ext-iso3166'),
-('FK', 'Falkland-Inseln', 'ext-iso3166'),
-('FM', 'Mikronesien', 'ext-iso3166'),
-('FO', 'Färöer Inseln', 'ext-iso3166'),
-('FR', 'Frankreich', 'ext-iso3166'),
-('FX', 'Frankreich (nur Europa)', 'ext-iso3166'),
-('GA', 'Gabun', 'ext-iso3166'),
-('GB', 'Großbritannien (UK)', 'ext-iso3166'),
-('GD', 'Grenada', 'ext-iso3166'),
-('GE', 'Georgien', 'ext-iso3166'),
-('GF', 'französisch Guyana', 'ext-iso3166'),
-('GH', 'Ghana', 'ext-iso3166'),
-('GI', 'Gibraltar', 'ext-iso3166'),
-('GL', 'Grönland', 'ext-iso3166'),
-('GM', 'Gambia', 'ext-iso3166'),
-('GN', 'Guinea', 'ext-iso3166'),
-('GP', 'Guadeloupe', 'ext-iso3166'),
-('GQ', 'Äquatorial Guinea', 'ext-iso3166'),
-('GR', 'Griechenland', 'ext-iso3166'),
-('GS', 'South Georgia und South Sandwich Islands', 'ext-iso3166'),
-('GT', 'Guatemala', 'ext-iso3166'),
-('GU', 'Guam', 'ext-iso3166'),
-('GW', 'Guinea Bissau', 'ext-iso3166'),
-('GY', 'Guyana', 'ext-iso3166'),
-('HK', 'Hong Kong', 'ext-iso3166'),
-('HM', 'Heard und McDonald Islands', 'ext-iso3166'),
-('HN', 'Honduras', 'ext-iso3166'),
-('HR', 'Kroatien', 'ext-iso3166'),
-('HT', 'Haiti', 'ext-iso3166'),
-('HU', 'Ungarn', 'ext-iso3166'),
-('ID', 'Indonesien', 'ext-iso3166'),
-('IE', 'Irland', 'ext-iso3166'),
-('IL', 'Israel', 'ext-iso3166'),
-('IN', 'Indien', 'ext-iso3166'),
-('IO', 'Britisch-Indischer Ozean', 'ext-iso3166'),
-('IQ', 'Irak', 'ext-iso3166'),
-('IR', 'Iran', 'ext-iso3166'),
-('IS', 'Island', 'ext-iso3166'),
-('IT', 'Italien', 'ext-iso3166'),
-('JM', 'Jamaika', 'ext-iso3166'),
-('JO', 'Jordanien', 'ext-iso3166'),
-('JP', 'Japan', 'ext-iso3166'),
-('KE', 'Kenia', 'ext-iso3166'),
-('KG', 'Kirgisistan', 'ext-iso3166'),
-('KH', 'Kambodscha', 'ext-iso3166'),
-('KI', 'Kiribati', 'ext-iso3166'),
-('KM', 'Komoren', 'ext-iso3166'),
-('KN', 'St. Kitts Nevis Anguilla', 'ext-iso3166'),
-('KP', 'Nordkorea', 'ext-iso3166'),
-('KR', 'Südkorea', 'ext-iso3166'),
-('KW', 'Kuwait', 'ext-iso3166'),
-('KY', 'Kaiman-Inseln', 'ext-iso3166'),
-('KZ', 'Kasachstan', 'ext-iso3166'),
-('LA', 'Laos', 'ext-iso3166'),
-('LB', 'Libanon', 'ext-iso3166'),
-('LC', 'Saint Lucia', 'ext-iso3166'),
-('LI', 'Liechtenstein', 'ext-iso3166'),
-('LK', 'Sri Lanka', 'ext-iso3166'),
-('LR', 'Liberia', 'ext-iso3166'),
-('LS', 'Lesotho', 'ext-iso3166'),
-('LT', 'Litauen', 'ext-iso3166'),
-('LU', 'Luxemburg', 'ext-iso3166'),
-('LV', 'Lettland', 'ext-iso3166'),
-('LY', 'Libyen', 'ext-iso3166'),
-('MA', 'Marokko', 'ext-iso3166'),
-('MC', 'Monaco', 'ext-iso3166'),
-('MD', 'Moldavien', 'ext-iso3166'),
-('MG', 'Madagaskar', 'ext-iso3166'),
-('MH', 'Marshall-Inseln', 'ext-iso3166'),
-('MK', 'Mazedonien', 'ext-iso3166'),
-('ML', 'Mali', 'ext-iso3166'),
-('MM', 'Myanmar', 'ext-iso3166'),
-('MN', 'Mongolei', 'ext-iso3166'),
-('MO', 'Macao', 'ext-iso3166'),
-('MP', 'Marianen', 'ext-iso3166'),
-('MQ', 'Martinique', 'ext-iso3166'),
-('MR', 'Mauretanien', 'ext-iso3166'),
-('MS', 'Montserrat', 'ext-iso3166'),
-('MT', 'Malta', 'ext-iso3166'),
-('MU', 'Mauritius', 'ext-iso3166'),
-('MV', 'Malediven', 'ext-iso3166'),
-('MW', 'Malawi', 'ext-iso3166'),
-('MX', 'Mexiko', 'ext-iso3166'),
-('MY', 'Malaysia', 'ext-iso3166'),
-('MZ', 'Mocambique', 'ext-iso3166'),
-('NA', 'Namibia', 'ext-iso3166'),
-('NC', 'Neukaledonien', 'ext-iso3166'),
-('NE', 'Niger', 'ext-iso3166'),
-('NF', 'Norfolk-Inseln', 'ext-iso3166'),
-('NG', 'Nigeria', 'ext-iso3166'),
-('NI', 'Nicaragua', 'ext-iso3166'),
-('NL', 'Niederlande', 'ext-iso3166'),
-('NO', 'Norwegen', 'ext-iso3166'),
-('NP', 'Nepal', 'ext-iso3166'),
-('NR', 'Nauru', 'ext-iso3166'),
-('NU', 'Niue', 'ext-iso3166'),
-('NZ', 'Neuseeland', 'ext-iso3166'),
-('OM', 'Oman', 'ext-iso3166'),
-('PA', 'Panama', 'ext-iso3166'),
-('PE', 'Peru', 'ext-iso3166'),
-('PF', 'Französisch-Polynesien', 'ext-iso3166'),
-('PG', 'Papua Neuguinea', 'ext-iso3166'),
-('PH', 'Philippinen', 'ext-iso3166'),
-('PK', 'Pakistan', 'ext-iso3166'),
-('PL', 'Polen', 'ext-iso3166'),
-('PM', 'St. Pierre und Miquelon', 'ext-iso3166'),
-('PN', 'Pitcairn', 'ext-iso3166'),
-('PR', 'Puerto Rico', 'ext-iso3166'),
-('PS', 'Palästinensische Selbstverwaltungsgebiete', 'ext-iso3166'),
-('PT', 'Portugal', 'ext-iso3166'),
-('PW', 'Palau', 'ext-iso3166'),
-('PY', 'Paraguay', 'ext-iso3166'),
-('QA', 'Qatar', 'ext-iso3166'),
-('RE', 'Reunion', 'ext-iso3166'),
-('RO', 'Rumänien', 'ext-iso3166'),
-('RU', 'Russland', 'ext-iso3166'),
-('RW', 'Ruanda', 'ext-iso3166'),
-('SA', 'Saudi-Arabien', 'ext-iso3166'),
-('SB', 'Solomon-Inseln', 'ext-iso3166'),
-('SC', 'Seychellen', 'ext-iso3166'),
-('SD', 'Sudan', 'ext-iso3166'),
-('SE', 'Schweden', 'ext-iso3166'),
-('SG', 'Singapur', 'ext-iso3166'),
-('SH', 'St. Helena', 'ext-iso3166'),
-('SI', 'Slowenien', 'ext-iso3166'),
-('SJ', 'Svalbard und Jan Mayen Islands', 'ext-iso3166'),
-('SK', 'Slowakei (Slowakische Republik)', 'ext-iso3166'),
-('SL', 'Sierra Leone', 'ext-iso3166'),
-('SM', 'San Marino', 'ext-iso3166'),
-('SN', 'Senegal', 'ext-iso3166'),
-('SO', 'Somalia', 'ext-iso3166'),
-('SR', 'Surinam', 'ext-iso3166'),
-('ST', 'Sao Tome', 'ext-iso3166'),
-('SU', 'Sowjetunion (obsolet)', 'ext-iso3166'),
-('SV', 'El Salvador', 'ext-iso3166'),
-('SY', 'Syrien', 'ext-iso3166'),
-('SZ', 'Swasiland', 'ext-iso3166'),
-('TC', 'Turks- und Kaikos-Inseln', 'ext-iso3166'),
-('TD', 'Tschad', 'ext-iso3166'),
-('TF', 'Französisches Süd-Territorium', 'ext-iso3166'),
-('TG', 'Togo', 'ext-iso3166'),
-('TH', 'Thailand', 'ext-iso3166'),
-('TJ', 'Tadschikistan', 'ext-iso3166'),
-('TK', 'Tokelau', 'ext-iso3166'),
-('TL', 'Ost-Timor', 'ext-iso3166'),
-('TM', 'Turkmenistan', 'ext-iso3166'),
-('TN', 'Tunesien', 'ext-iso3166'),
-('TO', 'Tonga', 'ext-iso3166'),
-('TR', 'Türkei', 'ext-iso3166'),
-('TT', 'Trinidad Tobago', 'ext-iso3166'),
-('TV', 'Tuvalu', 'ext-iso3166'),
-('TW', 'Taiwan', 'ext-iso3166'),
-('TZ', 'Tansania', 'ext-iso3166'),
-('UA', 'Ukraine', 'ext-iso3166'),
-('UG', 'Uganda', 'ext-iso3166'),
-('UK', 'Großbritannien', 'ext-iso3166'),
-('UM', 'US- kleinere Inseln außerhalb', 'ext-iso3166'),
-('US', 'Vereinigte Staaten von Amerika', 'ext-iso3166'),
-('UY', 'Uruguay', 'ext-iso3166'),
-('UZ', 'Usbekistan', 'ext-iso3166'),
-('VA', 'Vatikan', 'ext-iso3166'),
-('VC', 'St. Vincent', 'ext-iso3166'),
-('VE', 'Venezuela', 'ext-iso3166'),
-('VG', 'Virgin Island (Brit.)', 'ext-iso3166'),
-('VI', 'Virgin Island (USA)', 'ext-iso3166'),
-('VN', 'Vietnam', 'ext-iso3166'),
-('VU', 'Vanuatu', 'ext-iso3166'),
-('WF', 'Wallis et Futuna', 'ext-iso3166'),
-('WS', 'Samoa', 'ext-iso3166'),
-('YE', 'Jemen', 'ext-iso3166'),
-('YT', 'Mayotte', 'ext-iso3166'),
-('YU', 'Jugoslawien (obsolet)', 'ext-iso3166'),
-('ZA', 'Südafrika', 'ext-iso3166'),
-('ZM', 'Sambia', 'ext-iso3166'),
-('ZW', 'Zimbabwe', 'ext-iso3166');");
-
-                               // This extension depends on the country extension
-                               addExtensionUpdateDependency('country');
-
+                       case '0.0.1': // SQL queries for v0.0.1
                                // Update notes (these will be set as task text!)
-                               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.");
+                               setExtensionUpdateNotes("Nicht mehr ben&ouml;tigtes Update.");
                                break;
-
-               }
+               } // END - switch
                break;
 
        case 'modify': // When the extension got modified
                break;
 
-       case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+       case 'test': // For testing purposes
                break;
 
        case 'init': // Do stuff when extension is initialized
                break;
 
        default: // Unknown extension mode
-               DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
                break;
-}
+} // END - switch
 
 // [EOF]
 ?>