]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-config_other.php
More rewrites to configuration:
[mailer.git] / inc / modules / admin / what-config_other.php
index 9ff67bfd1e60c7d1baa54190ef8fd62c40aa7dc9..843050d5d689b59291ec290143d78c122fc3562c 100644 (file)
@@ -16,8 +16,8 @@
  * $Author::                                                          $ *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
- * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
- * For more information visit: http://www.mxchange.org                  *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team                   *
+ * For more information visit: http://mxchange.org                      *
  *                                                                      *
  * This program is free software; you can redistribute it and/or modify *
  * it under the terms of the GNU General Public License as published by *
@@ -43,73 +43,49 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-if (!isExtensionActive('other')) {
-       // Missing extension!
-       loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('other'));
-       return;
-} // END - if
-
 // Stop saving data if one input field is !isset
-if (isFormSent()) {
+if (isFormSent('save_config')) {
        // Calculate stamps and set calculated stamps
-       setPostRequestParameter('online_timeout'       , createTimestampFromSelections('ip_timeout'           , postRequestArray()));
-       setPostRequestParameter('url_tlock'            , createTimestampFromSelections('url_tlock'            , postRequestArray()));
-       setPostRequestParameter('profile_lock'         , createTimestampFromSelections('profile_lock'         , postRequestArray()));
-       setPostRequestParameter('profile_update'       , createTimestampFromSelections('profile_update'       , postRequestArray()));
-       setPostRequestParameter('resend_profile_update', createTimestampFromSelections('resend_profile_update', postRequestArray()));
+       setPostRequestElement('online_timeout'       , createEpocheTimeFromSelections('online_timeout'       , postRequestArray()));
+       setPostRequestElement('url_tlock'            , createEpocheTimeFromSelections('url_tlock'            , postRequestArray()));
 
        // Online-Timeout shall be > 0 or your database will crow and crow and crow...
-       if (!isPostRequestParameterSet('online_timeout'))        { unsetPostRequestParameter('ok'); }
+       if (!isPostRequestElementSet('online_timeout'))        { unsetPostRequestElement('ok'); }
 
        // Chedck other timestamps (which can be zero!)
-       if (!isPostRequestParameterSet('profile_lock'))          { unsetPostRequestParameter('ok'); }
-       if (!isPostRequestParameterSet('url_tlock'))             { unsetPostRequestParameter('ok'); }
-       if (!isPostRequestParameterSet('profile_update'))        { unsetPostRequestParameter('ok'); }
-       if (!isPostRequestParameterSet('resend_profile_update')) { unsetPostRequestParameter('ok'); }
+       if (!isPostRequestElementSet('url_tlock'))             { unsetPostRequestElement('ok'); }
 
        // Check other settings
-       if (!isPostRequestParameterSet('max_send'))              { unsetPostRequestParameter('ok'); }
-       if (!isPostRequestParameterSet('code_length'))           { unsetPostRequestParameter('ok'); }
-       if (!isPostRequestParameterSet('reject_url'))            { unsetPostRequestParameter('ok'); }
+       if (!isPostRequestElementSet('max_send'))              { unsetPostRequestElement('ok'); }
+       if (!isPostRequestElementSet('code_length'))           { unsetPostRequestElement('ok'); }
+       if (!isPostRequestElementSet('reject_url'))            { unsetPostRequestElement('ok'); }
 } // END - if
 
-if (isFormSent()) {
+if (isFormSent('save_config')) {
        // Update stamps directly
        adminSaveSettingsFromPostData();
 } else {
        // Time selection boxes
-       $content['online_timeout']   = createTimeSelections(getConfig('online_timeout'), 'ip_timeout'           , 'ms');
-       $content['url_tlock']        = createTimeSelections(getConfig('url_tlock')     , 'url_tlock'            , 'WDh');
-       $content['profile_lock']     = createTimeSelections(getConfig('profile_lock')  , 'profile_lock'         , 'WDh');
-       $content['profile_update']   = createTimeSelections(getConfig('profile_update'), 'profile_update'       , 'YM');
-       $content['profile_reupdate'] = createTimeSelections(getConfig('resend_profile_update') , 'resend_profile_update', 'MWD');
-
-       // Prepare more Y/N selections
-       foreach (array('show_points_unconfirmed','show_timings','youre_here','member_menu','guest_menu','order_multi_page','autosend_active','send_prof_update','admin_notify','display_debug_sqls','stats_enabled') as $entry) {
-               $content[$entry . '_y'] = '';
-               $content[$entry . '_n'] = '';
-               $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
-       } // END - foreach
+       $content['online_timeout']   = createConfigurationTimeSelections('online_timeout'       , 'ms');
+       $content['url_tlock']        = createConfigurationTimeSelections('url_tlock'            , 'WDh');
 
        // Prepare more
        foreach (array('css_php_direct','css_php_file','css_php_inline','mailid_error_redirect_index','mailid_error_redirect_reject') as $entry) {
                $content[$entry] = '';
        } // END - foreach
 
-       // Set selections
-       foreach (array('css_php','mailid_error_redirect') as $entry) {
-               $content[$entry . '_' . strtolower(getConfig($entry))] = ' checked="checked"';
-       } // END - foreach
-
        for ($i = '0'; $i <= 5; $i++) {
-               $content['comma_def_' . $i] = '';
+               $content['max_comma_' . $i] = '';
        } // END - for
 
+       // Set selections
+       $content = merge_array($content, getCheckedConfig(array('css_php', 'mailid_error_redirect')));
+
        // Set selection
-       $content['comma_def_' . getConfig('max_comma')] = ' selected="selected"';
+       $content = merge_array($content, getSelectedConfig(array('max_comma')));
 
        // Load template
-       loadTemplate('admin_config_other', false, $content);
+       loadTemplate('admin_config_other', FALSE, $content);
 }
 
 // [EOF]