Huge script change, see http://forum.mxchange.org/topic-458.html for details:
[mailer.git] / inc / extensions / ext-support.php
index a427f489bbfc86df349d8dda21d0d4e9b215d21b..958a7d8ae39cff3eede3559dd16aef71bb72f04d 100644 (file)
@@ -17,7 +17,7 @@
  * Needs to be in all Files and every File needs "svn propset           *
  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
- * Copyright (c) 2003 - 2008 by Roland Haeder                           *
+ * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * For more information visit: http://www.mxchange.org                  *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
 
 // Some security stuff...
 if (!defined('__SECURITY')) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
-       require($INC);
+       die();
 }
 
 // Version number
-EXT_SET_VERSION('0.1.2');
+setThisExtensionVersion('0.1.2');
 
 // Version history array (add more with , '0.1.0' and so on)
-EXT_SET_VER_HISTORY(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2'));
+setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2'));
 
-switch ($EXT_LOAD_MODE)
-{
+switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
                // SQL commands to run
-               ADD_EXT_SQL('');
+               addExtensionSql('');
                break;
 
        case 'remove': // Do stuff when removing extension
                // SQL commands to run
-               ADD_EXT_SQL('');
+               addExtensionSql('');
                break;
 
        case 'activate': // Do stuff when admin activates this extension
                // SQL commands to run
-               ADD_EXT_SQL('');
+               addExtensionSql('');
                break;
 
        case 'deactivate': // Do stuff when admin deactivates this extension
                // SQL commands to run
-               ADD_EXT_SQL('');
+               addExtensionSql('');
                break;
 
        case 'update': // Update an extension
-               switch ($EXT_VER)
-               {
+               switch (getCurrentExtensionVersion()) {
                        case '0.0.2': // SQL queries for v0.0.2
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
+                               setExtensionUpdateNotes("Fehlende Abfrage im Mitlieder-Modul, on Erweiterung auch aktiviert ist.");
                                break;
 
                        case '0.0.3': // SQL queries for v0.0.3
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+                               setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
                                break;
 
                        case '0.0.4': // SQL queries for v0.0.4
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
+                               setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
                                break;
 
                        case '0.0.5': // SQL queries for v0.0.5
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
+                               setExtensionUpdateNotes("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.");
                                break;
 
                        case '0.0.6': // SQL queries for v0.0.6
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Seit <a href=\"#\">Patch 340</a> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
+                               setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
                                break;
 
                        case '0.0.7': // SQL queries for v0.0.7
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
+                               setExtensionUpdateNotes("IP-Nummer und Browserbezeichnung wird in Admin-Mails eingesetzt.");
                                break;
 
                        case '0.0.8': // SQL queries for v0.0.8
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("W&ouml;rter <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> sind austauschbar.");
+                               setExtensionUpdateNotes("W&ouml;rter <strong>Mailtausch</strong>, <strong>Mailtausches</strong> und <strong>Mailtauscher</strong> sind austauschbar.");
                                break;
 
                        case '0.0.9': // SQL queries for v0.0.9
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Dateiamenskonflikt zwischen den Erweiterungen <strong>support</strong> und <strong>order</strong> behoben.");
+                               setExtensionUpdateNotes("Dateiamenskonflikt zwischen den Erweiterungen <strong>support</strong> und <strong>order</strong> behoben.");
                                break;
 
                        case '0.1.0': // SQL queries for v0.2.1
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Sicherheitsupdate vom 27.08.2005.");
+                               setExtensionUpdateNotes("Sicherheitsupdate vom 27.08.2005.");
                                break;
 
                        case '0.1.1': // SQL queries for v0.1.1
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Abspeichern der Support-Anfrage repariert und Mail wird an Mitglied wieder versendet.");
+                               setExtensionUpdateNotes("Abspeichern der Support-Anfrage repariert und Mail wird an Mitglied wieder versendet.");
                                break;
 
                        case '0.1.2': // SQL queries for v0.1.2
                                // Update notes (these will be set as task text!)
-                               EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
+                               setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
                                break;
-               }
+               } // END - switch
                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;
-}
+       case 'init': // Do stuff when extension is initialized
+               break;
+
+       default: // Unknown extension mode
+               DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+               break;
+} // END - switch
 
-//
+// [EOF]
 ?>