More XHTML-fied and extended header added to templates
[mailer.git] / inc / extensions / ext-theme.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    Start: 03/22/2004 *
4  * ================                             Last change: 06/28/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-theme.php                                    *
8  * -------------------------------------------------------------------- *
9  * Short description : Theme Management                                 *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Theme-Management                                 *
12  * -------------------------------------------------------------------- *
13  * $Revision:: 856                                                    $ *
14  * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009)             $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author:: stelzi                                                   $ *
17  * Needs to be in all Files and every File needs "svn propset           *
18  * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
19  * -------------------------------------------------------------------- *
20  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
21  * For more information visit: http://www.mxchange.org                  *
22  *                                                                      *
23  * This program is free software; you can redistribute it and/or modify *
24  * it under the terms of the GNU General Public License as published by *
25  * the Free Software Foundation; either version 2 of the License, or    *
26  * (at your option) any later version.                                  *
27  *                                                                      *
28  * This program is distributed in the hope that it will be useful,      *
29  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
30  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
31  * GNU General Public License for more details.                         *
32  *                                                                      *
33  * You should have received a copy of the GNU General Public License    *
34  * along with this program; if not, write to the Free Software          *
35  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
36  * MA  02110-1301  USA                                                  *
37  ************************************************************************/
38
39 // Some security stuff...
40 if (!defined('__SECURITY')) {
41         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
42         require($INC);
43 }
44
45 // Version number
46 EXT_SET_VERSION("0.0.8");
47
48 // Version history array (add more with , "0.1" and so on)
49 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"));
50
51 switch ($EXT_LOAD_MODE)
52 {
53 case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
54         // SQL commands to run
55         break;
56
57 case "remove": // Do stuff when removing extension
58         // Drop theme table
59         ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
60
61         // Delete admin menu
62         ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='theme' LIMIT 4");
63
64         // Delete guest menu entries
65         ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_guest_menu` WHERE `action`='themes' LIMIT 1");
66
67         // Delete member menu entries
68         ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='themes' OR `what`='themes' LIMIT 2");
69         break;
70
71 case "activate": // Do stuff when admin activates this extension
72         // SQL commands to run
73         ADD_SQL("");
74         break;
75
76 case "deactivate": // Do stuff when admin deactivates this extension
77         // SQL commands to run
78         ADD_SQL("");
79         break;
80
81 case "update": // Update an extension
82         switch ($EXT_VER)
83         {
84         case "0.0.1": // SQL queries for v0.0.1
85                 // Update notes (these will be set as task text!)
86                 EXT_SET_UPDATE_NOTES("HTML-Code f&uuml;r ein Zeilen-Template ausgelagert.");
87                 break;
88
89         case "0.0.2": // SQL queries for v0.0.2
90                 // Update notes (these will be set as task text!)
91                 EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert.");
92                 break;
93
94         case "0.0.3": // SQL queries for v0.0.3
95                 // Update notes (these will be set as task text!)
96                 EXT_SET_UPDATE_NOTES("Im Men&uuml;punkt &quot;Pr&uuml;fen&quot; wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.");
97                 break;
98
99         case "0.0.4": // SQL queries for v0.0.4
100                 // Update notes (these will be set as task text!)
101                 EXT_SET_UPDATE_NOTES("Sicherheitsupdate f&uuml;r die Include-Befehle.");
102                 break;
103
104         case "0.0.5": // SQL queries for v0.0.5
105                 // Update notes (these will be set as task text!)
106                 EXT_SET_UPDATE_NOTES("<strong>set_session()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
107                 break;
108
109         case "0.0.6": // SQL queries for v0.0.6
110                 // Update notes (these will be set as task text!)
111                 EXT_SET_UPDATE_NOTES("Variablen-Handling skriptglobal ge&auml;ndert.");
112                 break;
113
114         case "0.0.7": // SQL queries for v0.0.7
115                 // Update notes (these will be set as task text!)
116                 EXT_SET_UPDATE_NOTES("Ung&uuml;ltiges Update.");
117                 break;
118
119         case "0.0.8": // SQL queries for v0.0.8
120                 // Theme table
121                 ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_themes`");
122                 ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_themes` (
123 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
124 theme_path VARCHAR(255) NOT NULL DEFAULT '',
125 theme_name VARCHAR(255) NOT NULL DEFAULT '',
126 theme_active ENUM('Y','N') NOT NULL DEFAULT 'N',
127 theme_ver VARCHAR(255) NOT NULL DEFAULT '0.0',
128 PRIMARY KEY (`id`),
129 UNIQUE KEY (`theme_path`),
130 INDEX (`theme_active`)
131 ) TYPE={!_TABLE_TYPE!} COMMENT='Themes'");
132
133                 // Admin menu
134                 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)");
135                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_import','Importieren','Es wird das Verzeichnis &quot;theme&quot; nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1)");
136                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_edit','Modifizieren','&Auml;ndern Sie Titel, Freigaben usw. an den Themes. Sie k&ouml;nnen bis auf das Standart-Theme &quot;default&quot; auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server l&ouml;schen, damit es niht erneut importiert werden kann.', 2)");
137                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('theme','theme_check','Pr&uuml;fen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3)");
138
139                 // Guest menu
140                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_guest_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',4,'Y','N')");
141
142                 // Memember menu
143                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('themes',NULL,'Design-Auswahl',3,'Y','N')");
144                 ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('main','themes','Designs', 6,'Y','N')");
145                 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `sort`='8' WHERE `action`='themes' LIMIT 1");
146                 ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='account', `sort`='1', `title`='Designs' WHERE `what`='themes' LIMIT 1");
147
148                 // User data
149                 ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD curr_theme VARCHAR(255) NOT NULL DEFAULT 'default'");
150
151                 // Update notes (these will be set as task text!)
152                 EXT_SET_UPDATE_NOTES("Update von <u>sql_patches</u> &uuml;bertragen. (Kann Fehlermeldungen verursacht haben!)");
153                 break;
154         }
155         break;
156
157 case "modify": // When the extension got modified
158         break;
159
160 case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
161         break;
162
163 default: // Do stuff when extension is loaded
164         break;
165 }
166
167 //
168 ?>