X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-theme.php;h=d5cc37660b0a70af5bba838491abdb78c8b00510;hb=2a80968b5ade9e62b7b367c63753a70ca2cff1ad;hp=7876bc5860285ad082833eea47c20f6c8b3ec024;hpb=23eb012842e1c027a0f2af20693685caebb5638a;p=mailer.git
diff --git a/inc/extensions/ext-theme.php b/inc/extensions/ext-theme.php
index 7876bc5860..d5cc37660b 100644
--- a/inc/extensions/ext-theme.php
+++ b/inc/extensions/ext-theme.php
@@ -38,34 +38,39 @@ if (!defined('__SECURITY')) {
}
// Version number
-$EXT_VERSION = "0.0.7";
-
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+EXT_SET_VERSION("0.0.8");
// 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");
+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"));
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[] = "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";
+ // Drop theme table
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
+
+ // Delete admin menu
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4");
+
+ // Delete guest menu entries
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1");
+
+ // Delete member menu entries
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2");
break;
case "activate": // Do stuff when admin activates this extension
// SQL commands to run
- $SQLs[] = "";
+ ADD_SQL("");
break;
case "deactivate": // Do stuff when admin deactivates this extension
// SQL commands to run
- $SQLs[] = "";
+ ADD_SQL("");
break;
case "update": // Update an extension
@@ -73,43 +78,83 @@ case "update": // Update an extension
{
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.";
+ EXT_SET_UPDATE_NOTES("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!)
- $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
+ EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
break;
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.";
+ EXT_SET_UPDATE_NOTES("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!)
- $UPDATE_NOTES = "Sicherheitsupdate für die Include-Befehle.";
+ EXT_SET_UPDATE_NOTES("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!)
- $UPDATE_NOTES = "set_session() mit @-Zeichen gegen ungewollte Ausgaben abgesichert.";
+ EXT_SET_UPDATE_NOTES("set_session() 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!)
- $UPDATE_NOTES = "Variablen-Handling skriptglobal geändert.";
+ EXT_SET_UPDATE_NOTES("Variablen-Handling skriptglobal geändert.");
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 ''";
+ // Update notes (these will be set as task text!)
+ EXT_SET_UPDATE_NOTES("Ungültiges Update.");
+ break;
+
+ case "0.0.8": // SQL queries for v0.0.8
+ // Theme table
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
+ ADD_SQL("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
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres Mailtausch-Scriptes.', 8)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('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)");
+ ADD_SQL("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)");
+
+ // Guest menu
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')");
+
+ // Memember menu
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='8' WHERE `action`='themes' LIMIT 1");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='account', `sort`='1', `title`='Designs' WHERE `what`='themes' LIMIT 1");
+
+ // User data
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'");
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "Designname (von Menschen lesbar) hinzugefügt.";
+ EXT_SET_UPDATE_NOTES("Update von sql_patches übertragen. (Kann Fehlermeldungen verursacht haben!)");
break;
}
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;
+
default: // Do stuff when extension is loaded
break;
}