<?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 - 2008 by Roland Haeder *
- * For more information visit: http://www.mxchange.org *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * 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 *
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
- require($INC);
-} elseif (!EXT_IS_ACTIVE('order')) {
- addFatalMessage(__FILE__, __LINE__, generateExtensionInactiveNotInstalledMessage('order'));
- return;
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Add description as navigation point
-ADD_DESCR('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
+
+if (!isExtensionActive('order')) {
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=order%}');
+ return;
+} // END - if
-// Set empty mode to "select"
-if (!REQUEST_ISSET_GET('mode')) REQUEST_SET_GET('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(REQUEST_POST_ARRAY(), REQUEST_GET('mode'));
+ addNewBonusMail(postRequestArray(), getRequestElement('mail_mode'));
} else {
- // Get all available users
- define('__ALL_VALUE', translateComma(getTotalReceivers(REQUEST_GET('mode'))));
-
- // Prepare option lines
- define('__OPTION_LINES', generateCategoryOptionsList(REQUEST_GET('mode')));
-
// Store send mode
- define('__MODE', REQUEST_GET('mode'));
+ $content['mail_mode'] = getRequestElement('mail_mode');
- if (EXT_IS_ACTIVE('html_mail')) {
+ $content['html_select'] = '';
+ if (isExtensionActive('html_mail')) {
// If HTML extension is active
- define('__HTML_SELECT', LOAD_TEMPLATE("admin_send_bonus_html", true));
- } else {
- // And if not
- define('__HTML_SELECT', '');
- }
+ $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(REQUEST_GET('mode')) {
+ switch(getRequestElement('mail_mode')) {
case 'html': // HTML mails
case 'normal': // Normal mails
- $template = "admin_send_bonus_form";
+ $template = 'admin_send_bonus_form';
break;
- case "select": // Selection
- $template = "admin_send_bonus_select";
+ case 'select': // Selection
+ $template = 'admin_send_bonus_select';
break;
- }
+ } // END - switch
// Load template
- LOAD_TEMPLATE($template);
+ loadTemplate($template, FALSE, $content);
}
-//
+// [EOF]
?>