<?php
/************************************************************************
- * MXChange v0.2.1 Start: 01/09/2005 *
- * ================ Last change: 01/09/2005 *
+ * Mailer v0.2.1-FINAL Start: 01/09/2005 *
+ * =================== Last change: 01/09/2005 *
* *
* -------------------------------------------------------------------- *
* File : what-config_beg.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 (isFormSent()) {
// Translate german decimal commas to computer decimal dots
- REQUEST_SET_POST('beg_points' , convertCommaToDot(REQUEST_POST('beg_points') ));
- REQUEST_SET_POST('beg_points_max' , convertCommaToDot(REQUEST_POST('beg_points_max') ));
- REQUEST_SET_POST('beg_notify_bonus', convertCommaToDot(REQUEST_POST('beg_notify_bonus')));
+ setPostRequestParameter('beg_points' , convertCommaToDot(postRequestParameter('beg_points') ));
+ setPostRequestParameter('beg_points_max' , convertCommaToDot(postRequestParameter('beg_points_max') ));
+ setPostRequestParameter('beg_notify_bonus', convertCommaToDot(postRequestParameter('beg_notify_bonus')));
// Save settings
- ADMIN_SAVE_SETTINGS_POST();
+ adminSaveSettingsFromPostData();
// Remember new settings
- setConfigEntry('beg_rallye' , REQUEST_POST('beg_rallye'));
- setConfigEntry('beg_ral_en_notify', REQUEST_POST('beg_ral_en_notify'));
- setConfigEntry('beg_ral_di_notify', REQUEST_POST('beg_ral_di_notify'));
+ setConfigEntry('beg_rallye' , postRequestParameter('beg_rallye'));
+ setConfigEntry('beg_rallye_enable_notify' , postRequestParameter('beg_rallye_enable_notify'));
+ setConfigEntry('beg_rallye_disable_notify', postRequestParameter('beg_rallye_disable_notify'));
} else {
// Prepare constants for the template
$content['points'] = translateComma(getConfig('beg_points') , false);
$content['points_max'] = translateComma(getConfig('beg_points_max') , false);
$content['notify_bonus'] = translateComma(getConfig('beg_notify_bonus'), false);
- $content['timeout'] = createTimeSelections(getConfig('beg_timeout') , 'beg_timeout' , 'Dhm');
- $content['uid_timeout'] = createTimeSelections(getConfig('beg_uid_timeout'), 'beg_uid_timeout', 'Dhm');
- $content['ip_timeout'] = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
- $content['wait_selection'] = createTimeSelections(getConfig('beg_notify_wait'), 'beg_notify_wait', 'ms' );
- $content['ranks'] = getConfig('beg_ranks');
-
- // Activate / Deactivate beg rallye (Y/N)
- switch (getConfig('beg_rallye'))
- {
- case 'Y':
- $content['rallye_yes'] = ' checked="checked"';
- $content['rallye_no'] = '';
- break;
-
- case 'N':
- $content['rallye_yes'] = '';
- $content['rallye_no'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_active'))
- {
- case 'Y':
- $content['active_yes'] = ' checked="checked"';
- $content['active_no'] = '';
- break;
-
- case 'N':
- $content['active_yes'] = '';
- $content['active_no'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_mode'))
- {
- case 'DIRECT':
- $content['mode_direct'] = ' checked="checked"';
- $content['mode_ref'] = '';
- break;
-
- case 'REF':
- $content['mode_direct'] = '';
- $content['mode_ref'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_ral_en_notify'))
- {
- case 'Y':
- $content['ral_enable_notify_yes'] = ' checked="checked"';
- $content['ral_enable_notify_no'] = '';
- break;
-
- case 'N':
- $content['ral_enable_notify_yes'] = '';
- $content['ral_enable_notify_no'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_ral_di_notify'))
- {
- case 'Y':
- $content['ral_disable_notify_yes'] = ' checked="checked"';
- $content['ral_disable_notify_no'] = '';
- break;
-
- case 'N':
- $content['ral_disable_notify_yes'] = '';
- $content['ral_disable_notify_no'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_new_mem_notify'))
- {
- case 'Y':
- $content['new_member_notify_yes'] = ' checked="checked"';
- $content['new_member_notify_no'] = '';
- break;
-
- case 'N':
- $content['new_member_notify_yes'] = '';
- $content['new_member_notify_no'] = ' checked="checked"';
- break;
- }
-
- switch (getConfig('beg_include_own'))
- {
- case 'Y':
- $content['include_own_yes'] = ' checked="checked"';
- $content['include_own_no'] = '';
- break;
-
- case 'N':
- $content['include_own_yes'] = '';
- $content['include_own_no'] = ' checked="checked"';
- break;
- }
-
- // Init elements
- $content['pay_mode_img'] = '';
- $content['pay_mode_js'] = '';
- $content['pay_mode_both'] = '';
- $content['pay_mode_none'] = '';
-
- // Set pay mode
- $content['pay_mode_'.strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
+ $content['timeout'] = createTimeSelections(getConfig('beg_timeout') , 'beg_timeout' , 'Dhm');
+ $content['userid_timeout'] = createTimeSelections(getConfig('beg_userid_timeout'), 'beg_userid_timeout', 'Dhm');
+ $content['ip_timeout'] = createTimeSelections(getConfig('beg_ip_timeout') , 'beg_ip_timeout' , 'Dhm');
+ $content['wait_selection'] = createTimeSelections(getConfig('beg_notify_wait') , 'beg_notify_wait' , 'ms' );
+
+ // Init all Y/N selections
+ foreach (array('rallye', 'active', 'mode', 'rallye_enable_notify', 'rallye_disable_notify', 'new_member_notify', 'include_own') as $entry) {
+ $content[$entry . '_y'] = '';
+ $content[$entry . '_n'] = '';
+ $content[$entry . '_' . strtolower(getConfig('beg_' . $entry))] = ' checked="checked"';
+ } // END - foreach
+
+ // Init elements for faker-mode
+ foreach (array('pay_mode_img','pay_mode_js','pay_mode_both','pay_mode_none') as $entry) {
+ $content[$entry] = '';
+ } // END - foreach
+
+ // Set default faker-mode
+ $content['pay_mode_' . strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
+
+ // Init beg_mode elements
+ foreach (array('direct', 'ref') as $entry) {
+ $content['beg_mode_' . $entry] = '';
+ } // END - foreach
+
+ // Set default mode
+ $content['beg_mode_' . strtolower(getConfig('beg_mode'))] = ' checked="checked"';
// Member selection box
- $content['member_selection'] = ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, 'beg_uid');
+ $content['form_selection'] = addMemberSelectionBox(getConfig('beg_userid'), false, true, true, 'beg_userid');
// Load form template
- LOAD_TEMPLATE('admin_config_beg', false, $content);
+ loadTemplate('admin_config_beg', false, $content);
}
-//
+// [EOF]
?>