]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-send_bonus.php
Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
[mailer.git] / inc / modules / admin / what-send_bonus.php
index 20514fd4ac11b58f13b240f5b52faf9c6d456a08..710ac3def0af6e5c97ead2a6de05d72b165124b6 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009 - 2011 by Mailer Developer Team                   *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2015 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 *
@@ -44,31 +44,40 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addYouAreHereLink('admin', __FILE__);
 
 if (!isExtensionActive('order')) {
-       displayMessage(generateExtensionInactiveNotInstalledMessage('order'));
+       displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=order%}');
        return;
 } // END - if
 
-// 'mode' is not set by default
-if (!isGetRequestParameterSet('mode')) {
-       // Set empty mode to "select"
-       setGetRequestParameter('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(), getRequestParameter('mode'));
+       addNewBonusMail(postRequestArray(), getRequestElement('mail_mode'));
 } else {
        // Store send mode
-       $content['mode'] = getRequestParameter('mode');
+       $content['mail_mode'] = getRequestElement('mail_mode');
 
        $content['html_select'] = '';
        if (isExtensionActive('html_mail')) {
                // If HTML extension is active
-               $content['html_select'] = loadTemplate('admin_send_bonus_html', true);
+               $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(getRequestParameter('mode')) {
+       switch(getRequestElement('mail_mode')) {
                case 'html':   // HTML mails
                case 'normal': // Normal mails
                        $template = 'admin_send_bonus_form';
@@ -80,7 +89,7 @@ if (isFormSent()) {
        } // END - switch
 
        // Load template
-       loadTemplate($template, false, $content);
+       loadTemplate($template, FALSE, $content);
 }
 
 // [EOF]