X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-country.php;h=aa357dc1e099534ed93d423118e72405697a1095;hb=e5527fd38a6585c8466dc28d013f12d21eb7c07a;hp=170328812d56cd70e3b840ad6cbb96869c556cf9;hpb=55ccdea89c02e48dde9cc397ea723c8836331815;p=mailer.git diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 170328812d..aa357dc1e0 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -16,7 +16,7 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * Copyright (c) 2009 - 2013 by Mailer Developer Team * * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * @@ -50,7 +50,7 @@ setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0 setExtensionAlwaysActive('Y'); switch (getExtensionMode()) { - case 'register': // Do stuff when installation is running + case 'setup': // Do stuff when installation is running // SQL commands to run addDropTableSql('countries'); addCreateTableSql('countries', " @@ -59,11 +59,11 @@ switch (getExtensionMode()) { `descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland', `is_active` ENUM('Y','N') NOT NULL DEFAULT 'N', PRIMARY KEY (`id`), -UNIQUE (`code`)", +UNIQUE INDEX (`code`)", 'Country codes and their full-length descriptions'); // Insert first (Germany) country - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); + 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 {OPEN_CONFIG}mt_word{CLOSE_CONFIG} anmelden können.', 8); @@ -73,7 +73,7 @@ UNIQUE (`code`)", addExtensionDependency('user'); // Add entry to user table - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `country_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"); + addExtensionAddTableColumnSql('user_data', 'country_code', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1'); break; case 'remove': // Do stuff when removing extension @@ -82,7 +82,7 @@ UNIQUE (`code`)", addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'"); // Unregister filter - unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun()); + unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', TRUE, isExtensionDryRun()); break; case 'activate': // Do stuff when admin activates this extension @@ -119,7 +119,7 @@ UNIQUE (`code`)", case '0.0.5': // SQL queries for v0.0.5 // Register a filter - registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun()); + registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'COUNTRY_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun()); // This depends on ext-register addExtensionDependency('register'); @@ -140,7 +140,7 @@ UNIQUE (`code`)", break; default: // Unknown extension mode - logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName())); + reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName())); break; } // END - switch