-PRIMARY KEY(id)
-) TYPE=MyISAM";
-
- // Add default values to config
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD holiday_max bigint(20) not null default '30'";
-
- // Add member menu
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort, visible, locked) VALUES ('main', 'holiday', 'Urlaubsschaltung', '4', 'Y', 'Y')";
-
- // Add admin menus
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday', '', 'Urlaubsmanagement', '4', 'Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday', 'list_holiday', 'Auflisten', '1', 'Alle Urlaubsschaltungen auflisten.')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday', 'del_holiday', 'Urlaub beenden', '2', 'Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!')";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('holiday', 'config_holiday', 'Einstellungen', '3', 'Maximale Tage für Urlaub usw. einstellen.')";
-
- // Remove 0 max mails per day
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_holidays";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_member_menu WHERE what='holiday' LIMIT 1";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE action='holiday' LIMIT 4";
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_max_receive WHERE value='0' LIMIT 1";
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_max_receive (value, comment) VALUES('0', 'Urlaub')";
- 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 action='main' AND what='holiday' LIMIT 1";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='Y' WHERE action='main' AND what='holiday' LIMIT 1";
- break;
-
-case "update": // Update an extension
- switch ($EXT_VER)
- {
- case "0.0.2": // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.";
- break;
+PRIMARY KEY (id)
+) TYPE={?_TABLE_TYPE?}");
+
+ // Add default values to config
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD holiday_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '30'");
+
+ // Add member menu
+ addMemberMenuSql('main','holiday','Urlaubsschaltung','Y','Y',4);
+
+ // Add admin menus
+ addAdminMenuSql('holiday', NULL, 'Urlaubsmanagement','Hier können Sie Urlaubsschaltungen Ihrer Mitglieder auflisten oder auch wieder aufheben.',4);
+ addAdminMenuSql('holiday','list_holiday','Auflisten','Alle Urlaubsschaltungen auflisten.',1);
+ addAdminMenuSql('holiday','del_holiday','Urlaub beenden','Urlaubsschaltungen aufheben. Geben Sie bitte mehr als nur "Verstoss gegen unsere AGBs" ein!',2);
+ addAdminMenuSql('holiday','config_holiday','Einstellungen','Maximale Tage für Urlaub usw. einstellen.',3);