Patches from Profi-Concept's branch integrated (except 1599, because it is to large...
[mailer.git] / inc / extensions / ext-menu.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 03/17/2009 *
4  * ===================                          Last change: 03/17/2009 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-menu.php                                     *
8  * -------------------------------------------------------------------- *
9  * Short description : The menu system in admin area (manage)           *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Das Menue-System im Adminbereich (verwalten)     *
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.3');
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'));
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                 // @TODO Convert menu-Id to one coding-standard. admin(edit|_add) => admin_menu_(edit|add), mem(edit|_add) => mem_menu_(edit|add)
54                 addAdminMenuSql('menu',NULL,'Men&uuml;-System','Alle drei Men&uuml;-System bearbeiten (Admin-, Mitglied- und Gast-Men&uuml;)',1);
55                 addAdminMenuSql('menu','admin_add','Admin-Men&uuml; hinzuf&uuml;gen','Weiteren Men&uuml;punkt zum Admin-Bereich hinzuf&uuml;gen',1);
56                 addAdminMenuSql('menu','adminedit','Admin-Men&uuml; editieren','Das Administrationsmen&uuml; mit neuen Men&uuml;s erweitern, bestehende &auml;ndern oder l&ouml;schen. <strong>Vorsicht!</strong> L&ouml;schen Sie nicht das Login-Men&uuml;!',2);
57                 addAdminMenuSql('menu','mem_add','Mitgliedsmen&uuml; hinzuf&uuml;gen','Weiteren Men&uuml;punkt zum Mitgliedsmen&uuml; hinzuf&uuml;gen',3);
58                 addAdminMenuSql('menu','memedit','Mitgliedsmen&uuml; editieren','Mitgliedsmen&uuml; editieren oder l&ouml;schen',4);
59                 addAdminMenuSql('menu','guest_add','G&auml;ste-Men&uuml; hinzuf&uuml;gen','F&uuml;gen Sie weitere Men&uuml;punkte dem G&auml;ste-Men&uuml; hinzu.',5);
60                 addAdminMenuSql('menu','guestedit','G&auml;ste-Men&uuml; editieren','G&auml;ste-Men&uuml; editieren, l&ouml;schen',6);
61                 break;
62
63         case 'remove': // Do stuff when removing extension
64                 // SQL commands to run
65                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='menu'");
66                 break;
67
68         case 'activate': // Do stuff when admin activates this extension
69                 // SQL commands to run
70                 break;
71
72         case 'deactivate': // Do stuff when admin deactivates this extension
73                 // SQL commands to run
74                 break;
75
76         case 'update': // Update an extension
77                 switch (getCurrentExtensionVersion()) {
78                         case '0.0.1': // SQL queries for v0.0.1
79                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `guest_menu_advert_enabled` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
80                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `member_menu_advert_enabled` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
81
82                                 // Insert menu entry
83                                 addAdminMenuSql('menu','config_menu','Einstellungen','Einstellungen an den Gast- und Mitgliedsmen&uuml;s vornehmen.',7);
84
85                                 // Update notes (these will be set as task text!)
86                                 setExtensionUpdateNotes("Gast- und Mitgliedsmen&uuml;s k&ouml;nnen nun Werbung zwischen den Men&uuml;bl&ouml;cken einblenden.");
87                                 break;
88
89                         case '0.0.2': // SQL queries for v0.0.2
90                                 // Load the fix include
91                                 addIncludeToPool('extension', 'inc/fix_menu.php');
92
93                                 // Update notes (these will be set as task text!)
94                                 setExtensionUpdateNotes("Doppelte Men&uuml;punkte bereinigt.");
95                                 break;
96
97                         case '0.0.3': // SQL queries for v0.0.3
98                                 // Change menu-string
99                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title` = 'Admin-Men&uuml; editieren' WHERE `what` = 'adminedit' LIMIT 1");
100
101                                 setExtensionUpdateNotes("Men&uuml;punkt &#39;Vom Admin editieren&#39; in &#39;Admin-Men&uuml; editieren&#39; bei bereits bestehenden Installationen um&auml;ndern.");
102                                 break;
103                 } // END - switch
104                 break;
105
106         case 'modify': // When the extension got modified
107                 break;
108
109         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
110                 break;
111
112         case 'init': // Do stuff when extension is initialized
113                 break;
114
115         default: // Unknown extension mode
116                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
117                 break;
118 } // END - switch
119
120 // [EOF]
121 ?>