* 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 *
* 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();
}
// Add description as navigation point
-ADD_DESCR('admin', __FILE__);
+addMenuDescription('admin', __FILE__);
-if (IS_FORM_SENT()) {
+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')));
+ setRequestPostElement('beg_points' , convertCommaToDot(postRequestElement('beg_points') ));
+ setRequestPostElement('beg_points_max' , convertCommaToDot(postRequestElement('beg_points_max') ));
+ setRequestPostElement('beg_notify_bonus', convertCommaToDot(postRequestElement('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' , postRequestElement('beg_rallye'));
+ setConfigEntry('beg_ral_en_notify', postRequestElement('beg_ral_en_notify'));
+ setConfigEntry('beg_ral_di_notify', postRequestElement('beg_ral_di_notify'));
} else {
// Prepare constants for the template
- define('__BEG_POINTS' , translateComma(getConfig('beg_points') , false));
- define('__BEG_POINTS_MAX' , translateComma(getConfig('beg_points_max') , false));
- define('__BEG_NOTIFY_BONUS' , translateComma(getConfig('beg_notify_bonus'), false));
- define('__BEG_TIMEOUT' , createTimeSelections(getConfig('beg_timeout') , "beg_timeout" , "Dhm"));
- define('__BEG_UID_TIMEOUT' , createTimeSelections(getConfig('beg_uid_timeout'), "beg_uid_timeout", "Dhm"));
- define('__BEG_REMOTE_IP_TIMEOUT', createTimeSelections(getConfig('beg_ip_timeout') , "beg_ip_timeout" , "Dhm"));
- define('__WAIT_SELECTION' , createTimeSelections(getConfig('beg_notify_wait'), "beg_notify_wait", "ms" ));
- define('__BEG_RANKS' , getConfig('beg_ranks'));
-
- // Activate / Deactivate beg rallye (Y/N)
- switch (getConfig('beg_rallye'))
- {
- case 'Y':
- define('__BEG_RALLYE_Y', ' chkecked="checked"');
- define('__BEG_RALLYE_N', '');
- break;
-
- case 'N':
- define('__BEG_RALLYE_Y', '');
- define('__BEG_RALLYE_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_active'))
- {
- case 'Y':
- define('__BEG_ACTIVE_Y', ' chkecked="checked"');
- define('__BEG_ACTIVE_N', '');
- break;
-
- case 'N':
- define('__BEG_ACTIVE_Y', '');
- define('__BEG_ACTIVE_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_mode'))
- {
- case "DIRECT":
- define('__BEG_MODE_DIRECT', ' chkecked="checked"');
- define('__BEG_MODE_REF' , '');
- break;
-
- case "REF":
- define('__BEG_MODE_DIRECT', '');
- define('__BEG_MODE_REF' , ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_ral_en_notify'))
- {
- case 'Y':
- define('__BEG_RAL_EN_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_RAL_EN_NOTIFY_N', '');
- break;
-
- case 'N':
- define('__BEG_RAL_EN_NOTIFY_Y', '');
- define('__BEG_RAL_EN_NOTIFY_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_ral_di_notify'))
- {
- case 'Y':
- define('__BEG_RAL_DI_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_RAL_DI_NOTIFY_N', '');
- break;
-
- case 'N':
- define('__BEG_RAL_DI_NOTIFY_Y', '');
- define('__BEG_RAL_DI_NOTIFY_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_new_mem_notify'))
- {
- case 'Y':
- define('__BEG_NEW_MEMBER_NOTIFY_Y', ' chkecked="checked"');
- define('__BEG_NEW_MEMBER_NOTIFY_N', '');
- break;
-
- case 'N':
- define('__BEG_NEW_MEMBER_NOTIFY_Y', '');
- define('__BEG_NEW_MEMBER_NOTIFY_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_include_own'))
- {
- case 'Y':
- define('__BEG_INCLUDE_OWN_Y', ' chkecked="checked"');
- define('__BEG_INCLUDE_OWN_N', '');
- break;
-
- case 'N':
- define('__BEG_INCLUDE_OWN_Y', '');
- define('__BEG_INCLUDE_OWN_N', ' chkecked="checked"');
- break;
- }
-
- switch (getConfig('beg_pay_mode')) {
- case "IMG":
- define('__BEG_PAY_MODE_IMG' , ' selected="selected"');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "JS":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , ' selected="selected"');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "BOTH":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', ' selected="selected"');
- define('__BEG_PAY_MODE_NONE', '');
- break;
-
- case "NONE":
- define('__BEG_PAY_MODE_IMG' , '');
- define('__BEG_PAY_MODE_JS' , '');
- define('__BEG_PAY_MODE_BOTH', '');
- define('__BEG_PAY_MODE_NONE', ' selected="selected"');
- break;
- }
-
- // Add data to constant __MEMBER_SELECTION
- define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('beg_uid'), false, true, true, "beg_uid"));
+ $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['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','activate','mode','ral_en_notify','ral_di_notify','new_mem_notify','include_own') as $entry) {
+ $content[$entry . '_y'] = '';
+ $content[$entry . '_n'] = '';
+ $content[$entry . '_' . strtolower(getConfig('rallye_' . $entry))] = ' checked="checked"';
+ } // END - foreach
+
+ // Init elements
+ foreach (array('pay_mode_img','pay_mode_js','pay_mode_both','pay_mode_none') as $key) {
+ $content[$entry] = '';
+ } // END - foreach
+
+ // Set pay mode
+ $content['pay_mode_'.strtolower(getConfig('beg_pay_mode'))] = ' selected="selected"';
+
+ // Member selection box
+ $content['member_selection'] = addMemberSelectionBox(getConfig('beg_userid'), false, true, true, 'beg_userid');
// Load form template
- LOAD_TEMPLATE("admin_config_beg");
+ loadTemplate('admin_config_beg', false, $content);
}
-//
+// [EOF]
?>