<?php
/************************************************************************
- * MXChange v0.2.1 Start: 09/22/2004 *
- * ================ Last change: 09/22/2004 *
+ * Mailer v0.2.1-FINAL Start: 09/22/2004 *
+ * =================== Last change: 09/22/2004 *
* *
* -------------------------------------------------------------------- *
* File : what-config_order.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 *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009, 2010 by Mailer Developer Team *
* For more information visit: http://www.mxchange.org *
* *
* This program is free software; you can redistribute it and/or modify *
************************************************************************/
// Some security stuff...
-if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
- $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
- require($INC);
-}
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
// Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+addMenuDescription('admin', __FILE__);
-if (IS_FORM_SENT()) {
+if (isFormSent()) {
// Save data
- ADMIN_SAVE_SETTINGS_POST();
+ adminSaveSettingsFromPostData();
} else {
- // Prepare constants for the template
- switch (getConfig('order_max_full'))
- {
- case "ORDER":
- define('__ORDER_DEFAULT', " checked=\"checked\"");
- define('__MAX_DEFAULT' , "");
- break;
-
- case "MAX":
- define('__ORDER_DEFAULT', "");
- define('__MAX_DEFAULT' , " checked=\"checked\"");
- break;
- }
-
- // Minimum mails / order
- define('__MIN_VALUE', getConfig('order_min'));
-
- // Sorting mode (ascending / descending)
- switch (getConfig('order_mode'))
- {
- case "ASC":
- define('__ASC_DEFAULT' , " selected=\"selected\"");
- define('__DESC_DEFAULT', "");
- break;
-
- case "DESC":
- define('__ASC_DEFAULT' , "");
- define('__DESC_DEFAULT', " selected=\"selected\"");
- break;
- }
-
- // Transfer other config data into constants for the template
- define('_CFG_UNCONFIRMED' , getConfig('unconfirmed'));
- define('_CFG_MAX_TLENGTH' , getConfig('max_tlength'));
+ // Init all selection entries
+ foreach (array('order_max_full_order', 'order_max_full_max', 'order_mode_asc', 'order_mode_desc', 'allow_url_in_text_y', 'allow_url_in_text_n', 'allow_url_in_subject_y', 'allow_url_in_subject_n', 'url_blacklist_y', 'url_blacklist_n', 'repay_deleted_mails_repay', 'repay_deleted_mails_jackpot', 'repay_deleted_mails_shred') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
- if (getConfig('test_text') != "Y") {
- define('_CFG_TEST_TEXT_N', " checked=\"checked\"");
- define('_CFG_TEST_TEXT_Y', "");
- } else {
- define('_CFG_TEST_TEXT_N', "");
- define('_CFG_TEST_TEXT_Y', " checked=\"checked\"");
- }
+ // Set all default checks
+ foreach (array('order_max_full', 'order_mode', 'allow_url_in_text', 'allow_url_in_subject', 'url_blacklist') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
+ } // END - foreach
- switch (getConfig('repay_deleted_mails')) {
- case "REPAY":
- define('_CFG_REPAY_POINTS_REPAY' , " selected=\"selected\"");
- define('_CFG_REPAY_POINTS_JACKPOT', "");
- define('_CFG_REPAY_POINTS_SHRED' , "");
- break;
-
- case "JACKPOT":
- define('_CFG_REPAY_POINTS_REPAY' , "");
- define('_CFG_REPAY_POINTS_JACKPOT', " selected=\"selected\"");
- define('_CFG_REPAY_POINTS_SHRED' , "");
- break;
-
- case "SHRED":
- define('_CFG_REPAY_POINTS_REPAY' , "");
- define('_CFG_REPAY_POINTS_JACKPOT', "");
- define('_CFG_REPAY_POINTS_SHRED' , " selected=\"selected\"");
- break;
- }
-
- if (getConfig('test_subj') != "Y") {
- define('_CFG_TEST_SUBJ_N', " checked=\"checked\"");
- define('_CFG_TEST_SUBJ_Y', "");
- } else {
- define('_CFG_TEST_SUBJ_N', "");
- define('_CFG_TEST_SUBJ_Y', " checked=\"checked\"");
- }
-
- if (getConfig('url_blacklist') != "Y") {
- define('_CFG_URL_BLIST_N', " checked=\"checked\"");
- define('_CFG_URL_BLIST_Y', "");
- } else {
- define('_CFG_URL_BLIST_N', "");
- define('_CFG_URL_BLIST_Y', " checked=\"checked\"");
- }
+ // Set all default selections
+ foreach (array('repay_deleted_mails') as $entry) {
+ $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"';
+ } // END - foreach
// Selection list
- define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST(getConfig('order_select')));
+ $content['order_selection'] = addOrderSelectionOptions(getConfig('order_select'));
// Load template
- LOAD_TEMPLATE("admin_config_order");
+ loadTemplate('admin_config_order', false, $content);
}
-//
+
+// [EOF]
?>