-$EXT_VERSION = "0.1.6";
-
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
-
-// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.51", "0.0.52", "0.0.6", "0.0.7", "0.0.8", "0.0.9", "0.1.0", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6");
-
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD html ENUM('Y','N') NOT NULL DEFAULT 'Y'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','html_mail','HTML-Empfang','3','Y','Y')";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP html";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_bonus DROP html_msg";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_pool DROP html_msg";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='html_mail' LIMIT 1";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='html_mail' LIMIT 1";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='html_mail' LIMIT 1";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.6": // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Der erstellte HTML-Code wird noch kompiliert (eigene HTML-Codes umgewandelt).";
- break;
-
- case "0.0.8": // SQL queries for v0.0.8
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
+setThisExtensionVersion('0.1.6');
+
+// Version history array (add more with , '0.1.0' and so on)
+setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.51', '0.0.52', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6'));
+
+switch (getExtensionMode()) {
+ case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ // SQL commands to run
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD html ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_pool` ADD html_msg ENUM('Y','N') NOT NULL DEFAULT 'N'");
+ addMemberMenuSql('main','html_mail','HTML-Empfang','N','Y',3);