]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-country.php
SQLs fixed
[mailer.git] / inc / extensions / ext-country.php
index 6a33d7c23bb133c0afac8d19596586224d95f62c..729594731d6ac49312b262e90ca4964dd0810408 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) 2003 - 2009 by Roland Haeder                           *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
@@ -53,19 +52,19 @@ setExtensionAlwaysActive('Y');
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
-               addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
-               addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-code CHAR(2) NOT NULL DEFAULT 'DE',
-descr VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
-is_active ENUM('Y','N') NOT NULL DEFAULT 'N',
-KEY (code),
-PRIMARY KEY (id)
-) TYPE={?_TABLE_TYPE?}");
+               addDropTableSql('countries');
+               addCreateTableSql('countries', "(
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`code` CHAR(2) NOT NULL DEFAULT 'DE',
+`descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
+`is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
+KEY (`code`),
+PRIMARY KEY (`id`)
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Country codes and their full-length descriptions'");
                addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')");
 
                // Admin menu
-               addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {?mt_word?} anmelden können.', 8);
+               addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {OPEN_CONFIG}mt_word{CLOSE_CONFIG} anmelden können.', 8);
                addAdminMenuSql('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1);
 
                // Add entry to user table
@@ -74,7 +73,7 @@ PRIMARY KEY (id)
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
-               addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
+               addDropTableSql('countries');
                addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'");
                break;
 
@@ -116,14 +115,14 @@ PRIMARY KEY (id)
        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;
 }