* -------------------------------------------------------------------- *
* Kurzbeschreibung : Theme-Management *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * 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();
+} // END - if
// Version number
-$EXT_VERSION = "0.0.7";
-
-// 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.6", "0.0.7");
-
-switch ($EXT_LOAD_MODE)
-{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
- // SQL commands to run
- $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('theme', 'theme_check', 'Prüfen', 'Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3)";
- break;
-
-case "remove": // Do stuff when removing extension
- // SQL commands to run
- $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='theme_check' LIMIT 1";
- break;
-
-case "activate": // Do stuff when admin activates this extension
- // SQL commands to run
- $SQLs[] = "";
- break;
-
-case "deactivate": // Do stuff when admin deactivates this extension
- // SQL commands to run
- $SQLs[] = "";
- 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!)
- $UPDATE_NOTES = "HTML-Code für ein Zeilen-Template ausgelagert.";
- break;
+setThisExtensionVersion('0.0.9');
- case "0.0.2": // SQL queries for v0.0.2
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
- break;
+// 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.6', '0.0.7', '0.0.8', '0.0.9'));
- case "0.0.3": // SQL queries for v0.0.3
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Im Menüpunkt "Prüfen" wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.";
+switch (getExtensionMode()) {
+ case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ // SQL commands to run
break;
- case "0.0.4": // SQL queries for v0.0.4
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle.";
+ case 'remove': // Do stuff when removing extension
+ // Drop theme table
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
+
+ // Delete admin menu
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='theme'");
+
+ // Delete guest menu entries
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='themes'");
+
+ // Delete member menu entries
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='themes' OR `what`='themes'");
break;
- case "0.0.5": // SQL queries for v0.0.5
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "<STRONG>set_session()</STRONG> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+ case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ addExtensionSql('');
break;
- case "0.0.6": // SQL queries for v0.0.6
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Variablen-Handling skriptglobal geändert.";
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ addExtensionSql('');
break;
- case "0.0.7": // SQL queries for v0.0.7
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_themes ADD theme_name VARCHAR(255) NOT NULL DEFAULT ''";
+ case 'update': // Update an extension
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.1': // SQL queries for v0.0.1
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("HTML-Code für ein Zeilen-Template ausgelagert.");
+ break;
+
+ case '0.0.2': // SQL queries for v0.0.2
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
+ break;
+
+ case '0.0.3': // SQL queries for v0.0.3
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Im Menüpunkt "Prüfen" wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.");
+ break;
+
+ case '0.0.4': // SQL queries for v0.0.4
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Sicherheitsupdate für die Include-Befehle.");
+ break;
+
+ case '0.0.5': // SQL queries for v0.0.5
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
+ break;
+
+ case '0.0.6': // SQL queries for v0.0.6
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Variablen-Handling scripteweit geändert.");
+ break;
+
+ case '0.0.7': // SQL queries for v0.0.7
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Ungültiges Update.");
+ break;
+
+ case '0.0.8': // SQL queries for v0.0.8
+ // Theme table
+ addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
+ addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`theme_path` VARCHAR(255) NOT NULL DEFAULT '',
+`theme_name` VARCHAR(255) NOT NULL DEFAULT '',
+`theme_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
+`theme_ver` VARCHAR(255) NOT NULL DEFAULT '0.0',
+PRIMARY KEY (`id`),
+UNIQUE KEY (`theme_path`),
+INDEX (`theme_active`)
+) TYPE={?_TABLE_TYPE?} COMMENT='Themes'");
+
+ // Admin menu
+ addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8);
+ addAdminMenuSql('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1);
+ addAdminMenuSql('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2);
+ addAdminMenuSql('theme','theme_check','Prüfen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3);
+
+ // Guest menu
+ addGuestMenuSql('themes',NULL,'Design-Auswahl','Y','N',4);
+
+ // Memember menu
+ addMemberMenuSql('themes',NULL,'Design-Auswahl','N','Y',3);
+ addMemberMenuSql('main','themes','Designs','N','Y',6);
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=8 WHERE `action`='themes' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`=1, `title`='Designs' WHERE `what`='themes' LIMIT 1");
+
+ // User data
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `curr_theme` VARCHAR(255) NOT NULL DEFAULT 'default'");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Update von <u>sql_patches</u> übertragen. (Kann Fehlermeldungen verursacht haben!)");
+ break;
+
+ case '0.0.9': // SQL queries for v0.0.9
+ // Config SQL
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `default_theme` VARCHAR(255) NOT NULL DEFAULT 'default'");
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Fehlende Konfiguration hinzugefügt.");
+ break;
+ }
+ break;
- // Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Designname (von Menschen lesbar) hinzugefügt.";
+ case 'modify': // When the extension got modified
break;
- }
- break;
-default: // Do stuff when extension is loaded
- break;
-}
+ case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
-// Language file prefix
-$EXT_LANG_PREFIX = "theme";
+ case 'init': // Do stuff when extension is initialized
+ break;
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
+ default: // Unknown extension mode
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+ break;
+} // END - swich
//
?>