2 /************************************************************************
3 * MXChange v0.2.1 Start: 03/22/2004 *
4 * ================ Last change: 06/28/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-theme.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Theme Management *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Theme-Management *
12 * -------------------------------------------------------------------- *
14 * -------------------------------------------------------------------- *
15 * Copyright (c) 2003 - 2008 by Roland Haeder *
16 * For more information visit: http://www.mxchange.org *
18 * This program is free software; you can redistribute it and/or modify *
19 * it under the terms of the GNU General Public License as published by *
20 * the Free Software Foundation; either version 2 of the License, or *
21 * (at your option) any later version. *
23 * This program is distributed in the hope that it will be useful, *
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
26 * GNU General Public License for more details. *
28 * You should have received a copy of the GNU General Public License *
29 * along with this program; if not, write to the Free Software *
30 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
32 ************************************************************************/
34 // Some security stuff...
35 if (!defined('__SECURITY')) {
36 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
41 EXT_SET_VERSION("0.0.8");
43 // Version history array (add more with , "0.1" and so on)
44 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"));
46 switch ($EXT_LOAD_MODE)
48 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
49 // SQL commands to run
52 case "remove": // Do stuff when removing extension
54 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
57 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4");
59 // Delete guest menu entries
60 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1");
62 // Delete member menu entries
63 ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2");
66 case "activate": // Do stuff when admin activates this extension
67 // SQL commands to run
71 case "deactivate": // Do stuff when admin deactivates this extension
72 // SQL commands to run
76 case "update": // Update an extension
79 case "0.0.1": // SQL queries for v0.0.1
80 // Update notes (these will be set as task text!)
81 EXT_SET_UPDATE_NOTES("HTML-Code für ein Zeilen-Template ausgelagert.");
84 case "0.0.2": // SQL queries for v0.0.2
85 // Update notes (these will be set as task text!)
86 EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
89 case "0.0.3": // SQL queries for v0.0.3
90 // Update notes (these will be set as task text!)
91 EXT_SET_UPDATE_NOTES("Im Menüpunkt "Prüfen" wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.");
94 case "0.0.4": // SQL queries for v0.0.4
95 // Update notes (these will be set as task text!)
96 EXT_SET_UPDATE_NOTES("Sicherheitsupdate für die Include-Befehle.");
99 case "0.0.5": // SQL queries for v0.0.5
100 // Update notes (these will be set as task text!)
101 EXT_SET_UPDATE_NOTES("<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
104 case "0.0.6": // SQL queries for v0.0.6
105 // Update notes (these will be set as task text!)
106 EXT_SET_UPDATE_NOTES("Variablen-Handling skriptglobal geändert.");
109 case "0.0.7": // SQL queries for v0.0.7
110 // Update notes (these will be set as task text!)
111 EXT_SET_UPDATE_NOTES("Ungültiges Update.");
114 case "0.0.8": // SQL queries for v0.0.8
116 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
117 ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_themes` (
118 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
119 theme_path VARCHAR(255) NOT NULL DEFAULT '',
120 theme_name VARCHAR(255) NOT NULL DEFAULT '',
121 theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
122 theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
124 UNIQUE KEY (`theme_path`),
125 INDEX (`theme_active`)
126 ) TYPE=MyISAM COMMENT='Themes'");
129 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)");
130 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)");
131 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)");
132 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)");
135 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')");
138 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')");
139 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')");
140 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='8' WHERE `action`='themes' LIMIT 1");
141 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='account', `sort`='1', `title`='Designs' WHERE `what`='themes' LIMIT 1");
144 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'");
146 // Update notes (these will be set as task text!)
147 EXT_SET_UPDATE_NOTES("Update von <u>sql_patches</u> übertragen. (Kann Fehlermeldungen verursacht haben!)");
152 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
155 default: // Do stuff when extension is loaded