A lot CSS classes rewritten, please update all your themes.
[mailer.git] / inc / modules / admin / what-config_refid.php
index 5262427d9ba36aa16e4526c5daeec75495371578..614200bb554379314a6a9362f641fcf184f05538 100644 (file)
@@ -1,23 +1,24 @@
 <?php
 /************************************************************************
- * MXChange v0.2.1                                    Start: 11/23/2004 *
- * ================                             Last change: 11/23/2004 *
+ * Mailer v0.2.1-FINAL                                Start: 11/23/2004 *
+ * ===================                          Last change: 11/23/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-config_refid.php                            *
  * -------------------------------------------------------------------- *
- * Short description : Setup default referal ID                         *
+ * Short description : Setup default referal id                         *
  * -------------------------------------------------------------------- *
- * Kurzbeschreibung  : Standart Referal-ID einstellen                   *
+ * Kurzbeschreibung  : Standart Referal-Id einstellen                   *
  * -------------------------------------------------------------------- *
- * $Revision:: 856                                                    $ *
- * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009)             $ *
+ * $Revision::                                                        $ *
+ * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
- * $Author:: stelzi                                                   $ *
+ * $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();
 }
 
 // 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 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['form_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]