Mailer used in many places, we still need a good 'selling' title
[mailer.git] / inc / extensions / ext-theme.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                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::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
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 - 2009 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         die();
42 } // END - if
43
44 // Version number
45 setThisExtensionVersion('0.0.9');
46
47 // Version history array (add more with , '0.1.0' and so on)
48 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'));
49
50 switch (getExtensionMode()) {
51         case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
52                 // SQL commands to run
53                 break;
54
55         case 'remove': // Do stuff when removing extension
56                 // Drop theme table
57                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
58
59                 // Delete admin menu
60                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='theme'");
61
62                 // Delete guest menu entries
63                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='themes'");
64
65                 // Delete member menu entries
66                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='themes' OR `what`='themes'");
67                 break;
68
69         case 'activate': // Do stuff when admin activates this extension
70                 // SQL commands to run
71                 addExtensionSql('');
72                 break;
73
74         case 'deactivate': // Do stuff when admin deactivates this extension
75                 // SQL commands to run
76                 addExtensionSql('');
77                 break;
78
79         case 'update': // Update an extension
80                 switch (getCurrentExtensionVersion()) {
81                         case '0.0.1': // SQL queries for v0.0.1
82                                 // Update notes (these will be set as task text!)
83                                 setExtensionUpdateNotes("HTML-Code f&uuml;r ein Zeilen-Template ausgelagert.");
84                                 break;
85
86                         case '0.0.2': // SQL queries for v0.0.2
87                                 // Update notes (these will be set as task text!)
88                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
89                                 break;
90
91                         case '0.0.3': // SQL queries for v0.0.3
92                                 // Update notes (these will be set as task text!)
93                                 setExtensionUpdateNotes("Im Men&uuml;punkt &quot;Pr&uuml;fen&quot; wurden die bereits installierten und auch aktuellen Themes nicht ausgeblendet.");
94                                 break;
95
96                         case '0.0.4': // SQL queries for v0.0.4
97                                 // Update notes (these will be set as task text!)
98                                 setExtensionUpdateNotes("Sicherheitsupdate f&uuml;r die Include-Befehle.");
99                                 break;
100
101                         case '0.0.5': // SQL queries for v0.0.5
102                                 // Update notes (these will be set as task text!)
103                                 setExtensionUpdateNotes("<strong>setSession()</strong> mit @-Zeichen gegen ungewollte Ausgaben abgesichert.");
104                                 break;
105
106                         case '0.0.6': // SQL queries for v0.0.6
107                                 // Update notes (these will be set as task text!)
108                                 setExtensionUpdateNotes("Variablen-Handling scripteweit ge&auml;ndert.");
109                                 break;
110
111                         case '0.0.7': // SQL queries for v0.0.7
112                                 // Update notes (these will be set as task text!)
113                                 setExtensionUpdateNotes("Ung&uuml;ltiges Update.");
114                                 break;
115
116                         case '0.0.8': // SQL queries for v0.0.8
117                                 // Theme table
118                                 addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
119                                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` (
120 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
121 `theme_path` VARCHAR(255) NOT NULL DEFAULT '',
122 `theme_name` VARCHAR(255) NOT NULL DEFAULT '',
123 `theme_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
124 `theme_ver` VARCHAR(255) NOT NULL DEFAULT '0.0',
125 PRIMARY KEY (`id`),
126 UNIQUE KEY (`theme_path`),
127 INDEX (`theme_active`)
128 ) TYPE={?_TABLE_TYPE?} COMMENT='Themes'");
129
130                                 // Admin menu
131                                 addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres {?mt_word2?}.', 8);
132                                 addAdminMenuSql('theme','theme_import','Importieren','Es wird das Verzeichnis &quot;theme&quot; nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1);
133                                 addAdminMenuSql('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);
134                                 addAdminMenuSql('theme','theme_check','Pr&uuml;fen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3);
135
136                                 // Guest menu
137                                 addGuestMenuSql('themes',NULL,'Design-Auswahl','Y','N',4);
138
139                                 // Memember menu
140                                 addMemberMenuSql('themes',NULL,'Design-Auswahl','N','Y',3);
141                                 addMemberMenuSql('main','themes','Designs','N','Y',6);
142                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=8 WHERE `action`='themes' LIMIT 1");
143                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='account', `sort`=1, `title`='Designs' WHERE `what`='themes' LIMIT 1");
144
145                                 // User data
146                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `curr_theme` VARCHAR(255) NOT NULL DEFAULT 'default'");
147
148                                 // Update notes (these will be set as task text!)
149                                 setExtensionUpdateNotes("Update von <u>sql_patches</u> &uuml;bertragen. (Kann Fehlermeldungen verursacht haben!)");
150                                 break;
151
152                         case '0.0.9': // SQL queries for v0.0.9
153                                 // Config SQL
154                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `default_theme` VARCHAR(255) NOT NULL DEFAULT 'default'");
155
156                                 // Update notes (these will be set as task text!)
157                                 setExtensionUpdateNotes("Fehlende Konfiguration hinzugef&uuml;gt.");
158                                 break;
159                 }
160                 break;
161
162         case 'modify': // When the extension got modified
163                 break;
164
165         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
166                 break;
167
168         case 'init': // Do stuff when extension is initialized
169                 break;
170
171         default: // Unknown extension mode
172                 DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
173                 break;
174 } // END - swich
175
176 //
177 ?>