New extension added, ext-uberwach rewritten (unfinished), some fixes
[mailer.git] / inc / extensions / ext-uberwach.php
index 4d25dc9836fc8725558fe2dea63943b0eff19ef7..8c5989b4a4d82b2995ff8e8b1608e5fa074c318e 100644 (file)
@@ -42,10 +42,10 @@ if (!defined('__SECURITY')) {
 }
 
 // Version number
-setThisExtensionVersion('0.0');
+setThisExtensionVersion('0.0.1');
 
 // Version history array (add more with , '0.1.0' and so on)
-setExtensionVersionHistory(array('0.0'));
+setExtensionVersionHistory(array('0.0', '0.0.1'));
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
@@ -53,7 +53,11 @@ switch (getExtensionMode()) {
                break;
 
        case 'remove': // Do stuff when removing extension
-               // SQL commands to run
+               // SQLs commands to run
+               addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_uberwach' LIMIT 1");
+
+               // Unregister filter
+               unregisterFilter('page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', false, true, getExtensionDryRun());
                break;
 
        case 'activate': // Do stuff when admin activates this extension
@@ -67,10 +71,15 @@ switch (getExtensionMode()) {
        case 'update': // Update an extension
                switch (getCurrentExtensionVersion()) {
                        case '0.0.1': // SQL queries for v0.0.1
-                               addExtensionSql('');
+                               registerFilter('page_footer', 'DISPLAY_POLITICIAN_STOP_SNIPPET', false, true, getExtensionDryRun());
 
                                // Update notes (these will be set as task text!)
-                               setExtensionUpdateNotes('');
+                               setExtensionUpdateNotes("Filter zum Anzeigen des Snippets hinzugefügt");
+                               break;
+
+                       case '0.0.2': // SQL queries for v0.0.2
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `uberwach_backlink` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+                               addExtensionAdminMenuSql('config','config_uberwach','Überwach!-Aktion','Einstellungen zur Aktion "Überwach!"', 7);
                                break;
                } // END - switch
                break;