]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-send_bonus.php
Rewrote 'we' word a little, rewrote mail order to use SQL_INSERTID() instead of anoth...
[mailer.git] / inc / modules / admin / what-send_bonus.php
index 785acaa6ca7e7d274f938187b9f5823e78169e32..852457782e3fc21fc9b5a79e925288437cd3dae0 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 09/28/2003 *
- * ===============                              Last change: 08/05/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 09/28/2003 *
+ * ===================                          Last change: 08/05/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-send_bonus.php                              *
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -42,28 +41,31 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 } // END - if
 
 // Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
 
 if (!isExtensionActive('order')) {
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('order'));
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=order%}');
        return;
 } // END - if
 
-// Set empty mode to "select"
-if (!isGetRequestElementSet('mode')) setRequestGetElement('mode', "select");
+// mail_mode is not set by default
+if (!isGetRequestElementSet('mail_mode')) {
+       // Is HTML extension enabled?
+       if (isExtensionInstalled('html_mail')) {
+               // Set empty mode to 'select'
+               setGetRequestElement('mail_mode', 'select');
+       } else {
+               // Set empty mode to 'normal'
+               setGetRequestElement('mail_mode', 'normal');
+       }
+} // END - if
 
 if (isFormSent()) {
        // Deliver bonus mail
-       addNewBonusMail(postRequestArray(), getRequestElement('mode'));
+       addNewBonusMail(postRequestArray(), getRequestElement('mail_mode'));
 } else {
-       // Get all available users
-       $content['all'] = translateComma(getTotalReceivers(getRequestElement('mode')));
-
-       // Prepare option lines
-       $content['options_lines'] = generateCategoryOptionsList(getRequestElement('mode'));
-
        // Store send mode
-       $content['mode'] = getRequestElement('mode');
+       $content['mail_mode'] = getRequestElement('mail_mode');
 
        $content['html_select'] = '';
        if (isExtensionActive('html_mail')) {
@@ -71,8 +73,11 @@ if (isFormSent()) {
                $content['html_select'] = loadTemplate('admin_send_bonus_html', true);
        } // END - if
 
+       // Default template name is an invalid one
+       $template = 'admin_send_bonus_invalid';
+
        // Select template
-       switch(getRequestElement('mode')) {
+       switch(getRequestElement('mail_mode')) {
                case 'html':   // HTML mails
                case 'normal': // Normal mails
                        $template = 'admin_send_bonus_form';
@@ -81,10 +86,10 @@ if (isFormSent()) {
                case 'select': // Selection
                        $template = 'admin_send_bonus_select';
                        break;
-       } // END - if
+       } // END - switch
 
        // Load template
-       loadTemplate($template);
+       loadTemplate($template, false, $content);
 }
 
 // [EOF]