Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / member / what-subids.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 10/06/2012 *
4  * ===================                          Last change: 10/06/2012 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : what-subids.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Lists and manages member's own sub ids           *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Auflisten und verwalten der Mitglied-SubIds      *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
22  * This program is free software; you can redistribute it and/or modify *
23  * it under the terms of the GNU General Public License as published by *
24  * the Free Software Foundation; either version 2 of the License, or    *
25  * (at your option) any later version.                                  *
26  *                                                                      *
27  * This program is distributed in the hope that it will be useful,      *
28  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
29  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
30  * GNU General Public License for more details.                         *
31  *                                                                      *
32  * You should have received a copy of the GNU General Public License    *
33  * along with this program; if not, write to the Free Software          *
34  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         exit();
41 } elseif (!isMember()) {
42         redirectToIndexMemberOnlyModule();
43 }
44
45 // Add description as navigation point
46 addYouAreHereLink('member', __FILE__);
47
48 // Continue only if the proper extension is active (admins can always continue)
49 if ((!isExtensionActive('user')) && (!isAdmin())) {
50         // Required extension ext-user not active
51         displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}');
52
53         // Abort here
54         return;
55 } // END - if
56
57 // By default show the list...
58 $show = true;
59
60 // Check for 'url_id' element
61 //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isFormSent()=' . intval(isFormSent('add_subid')) . ',ifPostContainsSelections()=' . intval(ifPostContainsSelections()) . ',countRequestPost()=' . countRequestPost());
62 if ((countRequestPost() > 0) && (!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countRequestPost() == 0))) {
63         // Not found so output message
64         displayMessage('{--MEMBER_SUBID_NO_SELECTIONS--}');
65
66         // Abort here
67         return;
68 } // END - if
69
70 // Edit or delete button hit?
71 if (isFormSent('add_subid')) {
72         // Add new sub id
73         showEntriesByXmlCallback('member_add_do_subid');
74 } elseif (isFormSent('edit')) {
75         // Show entries for editing
76         showEntriesByXmlCallback('member_edit_show_subid');
77
78         // Do not show the list of URLs after this template
79         $show = false;
80 } elseif (isFormSent('do_edit')) {
81         // Change data of entries
82         showEntriesByXmlCallback('member_edit_do_subid');
83 } elseif (isFormSent('delete')) {
84         // Show entries for deletion
85         showEntriesByXmlCallback('member_delete_show_subid');
86
87         // Do not show the list of URLs after this template
88         $show = false;
89 } elseif (isFormSent('do_delete')) {
90         // Remove entries from database
91         showEntriesByXmlCallback('member_delete_do_subid');
92 }
93
94 // Show entries?
95 if ($show === false) {
96         // No, a form has already been show
97         return false;
98 } // END - if
99
100 // List all campaigns
101 showEntriesByXmlCallback('member_list_subid');
102
103 // Display form for adding a sub id
104 loadTemplate('member_add_subid');
105
106 // [EOF]
107 ?>