X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-config_refid.php;h=625a5754f45d2b63c57b33575f76e45d1b0d621a;hb=841656d70d60cbd5f0768e12cf73a62aa643cf35;hp=e0c7373048f05064fc8180575ad3e9c199449532;hpb=3afdce4fe00b4af570122ce7b8158ced44aec7d3;p=mailer.git diff --git a/inc/modules/admin/what-config_refid.php b/inc/modules/admin/what-config_refid.php index e0c7373048..625a5754f4 100644 --- a/inc/modules/admin/what-config_refid.php +++ b/inc/modules/admin/what-config_refid.php @@ -17,7 +17,7 @@ * 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 * @@ -37,62 +37,32 @@ ************************************************************************/ // 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 (isFormSent()) { // Save data - ADMIN_SAVE_SETTINGS_POST(); + adminSaveSettingsFromPostData(); } else { - // Prepare contants for the template - define('__MEMBER_SELECTION', ADD_MEMBER_SELECTION_BOX(getConfig('def_refid'), false, true, true, "def_refid")); - - switch (getConfig('refid_target')) { - case 'index': - define('__DEF_RT_INDEX' , ' selected="selected"'); - define('__DEF_RT_REGISTER', ''); - break; - - case 'register': - define('__DEF_RT_INDEX' , ''); - define('__DEF_RT_REGISTER', ' selected="selected"'); - break; - - default: // Invalid config! - DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid refid_target %s detected.", getConfig('refid_target'))); - break; - } // END - switch + // Prepare member selection + $content['member_selection'] = addMemberSelectionBox(getConfig('def_refid'), false, true, true, 'def_refid'); - switch (getConfig('select_user_zero_refid')) { - case 'Y': - define('__RAND_REFID_Y', ' selected="selected"'); - define('__RAND_REFID_N', ''); - break; - - case 'N': - define('__RAND_REFID_Y', ''); - define('__RAND_REFID_N', ' selected="selected"'); - break; - - default: // Invalid config! - DEBUG_LOG(__FILE__, __LINE__, sprintf("Invalid select_user_zero_refid %s detected.", getConfig('select_user_zero_refid'))); - define('__RAND_REFID_Y', ''); - define('__RAND_REFID_N', ''); - break; - } // END - switch + // Prepare contants for the template + foreach (array('refid_target_index','refid_target_register','select_user_zero_refid_y','select_user_zero_refid_n') as $entry) { + $content[$entry] = ''; + } // END - foreach - // Prepare content - $content = array( - 'user_min_confirmed' => getConfig('user_min_confirmed') - ); + // Set all selections + foreach (array('refid_target', 'select_user_zero_refid') as $entry) { + $content[$entry . '_' . strtolower(getConfig($entry))] = ' selected="selected"'; + } // END - foreach // Load template - LOAD_TEMPLATE("admin_config_refid", false, $content); + loadTemplate('admin_config_refid', false, $content); } // [EOF]