X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-country.php;h=e54e5e7b79b1775f06b1f13608b3655994907027;hb=ae3dec50dc9e51c8cc08939017763839493f7064;hp=58c20692383059c6615afba01b4c63c1ba3d5c21;hpb=7b0f17cd637e388049d2167811e4332cec1e979b;p=mailer.git diff --git a/inc/extensions/ext-country.php b/inc/extensions/ext-country.php index 58c2069238..e54e5e7b79 100644 --- a/inc/extensions/ext-country.php +++ b/inc/extensions/ext-country.php @@ -50,10 +50,10 @@ EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4')); switch ($EXT_LOAD_MODE) { -case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called) - // SQL commands to run - ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"); - ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_countries` ( + case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called) + // SQL commands to run + ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"); + ADD_EXT_SQL("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', @@ -61,65 +61,65 @@ is_active ENUM('Y','N') NOT NULL DEFAULT 'N', KEY(code), PRIMARY KEY(id) ) TYPE={!_TABLE_TYPE!}"); - ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); - - // Admin menu - ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {!MT_WORD!} anmelden können.', 8)"); - ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1)"); - - // Add entry to user table - ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"); - break; - -case 'remove': // Do stuff when removing extension - // SQL commands to run - ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"); - ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country'"); - break; - -case 'activate': // Do stuff when admin activates this extension - // SQL commands to run - ADD_EXT_SQL(""); - break; - -case 'deactivate': // Do stuff when admin deactivates this extension - // SQL commands to run - ADD_EXT_SQL(""); - break; - -case 'update': // Update an extension - switch ($EXT_VER) - { - case '0.0.1': // SQL queries for v0.0.1 - // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES("SQL-Dateien hinzugefügt, die Sie mit z.B. phpMyAdmin einspielen können. (DOCS/country/README.de lesen!)"); + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')"); + + // Admin menu + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {!MT_WORD!} anmelden können.', 8)"); + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1)"); + + // Add entry to user table + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD country_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 1"); + break; + + case 'remove': // Do stuff when removing extension + // SQL commands to run + ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_countries`"); + ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='country'"); break; - case '0.0.2': // SQL queries for v0.0.2 - // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES("Sicherheitsupdate: SQL-Anweisungen geschützt."); + case 'activate': // Do stuff when admin activates this extension + // SQL commands to run + ADD_EXT_SQL(''); break; - case '0.0.3': // SQL queries for v0.0.3 - // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert."); + case 'deactivate': // Do stuff when admin deactivates this extension + // SQL commands to run + ADD_EXT_SQL(''); break; - case '0.0.4': // SQL queries for v0.0.4 - // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES("Sicherheitsupdate für die Include-Befehle."); + case 'update': // Update an extension + switch ($EXT_VER) + { + case '0.0.1': // SQL queries for v0.0.1 + // Update notes (these will be set as task text!) + EXT_SET_UPDATE_NOTES("SQL-Dateien hinzugefügt, die Sie mit z.B. phpMyAdmin einspielen können. (DOCS/country/README.de lesen!)"); + break; + + case '0.0.2': // SQL queries for v0.0.2 + // Update notes (these will be set as task text!) + EXT_SET_UPDATE_NOTES("Sicherheitsupdate: SQL-Anweisungen geschützt."); + break; + + case '0.0.3': // SQL queries for v0.0.3 + // Update notes (these will be set as task text!) + EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert."); + break; + + case '0.0.4': // SQL queries for v0.0.4 + // Update notes (these will be set as task text!) + EXT_SET_UPDATE_NOTES("Sicherheitsupdate für die Include-Befehle."); + break; + } break; - } - break; -case 'modify': // When the extension got modified - 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. - break; + case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. + break; -default: // Do stuff when extension is loaded - break; + default: // Do stuff when extension is loaded + break; } // Keep this extension always active!