| 1 |
<?php |
<?php |
| 2 |
// $Id: xmpp_server.admin.inc,v 1.3 2008/09/25 06:45:41 t0talmeltd0wn Exp $ |
// $Id: xmpp_server.admin.inc,v 1.4 2008/09/26 00:45:41 t0talmeltd0wn Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Form builder. Configure XMPP server settings. |
* Form builder. Configure XMPP server settings. |
| 18 |
'#default_value' => variable_get('xmpp_server_cache_lists', false), |
'#default_value' => variable_get('xmpp_server_cache_lists', false), |
| 19 |
); |
); |
| 20 |
|
|
| 21 |
$running = (variable_get('xmpp_server_ping', 0) > time() - 10) && variable_get('xmpp_server_running', false); |
$frequency = variable_get('xmpp_server_ping_frequency', 15); |
| 22 |
|
$running = (variable_get('xmpp_server_ping', 0) > time() - $frequency) && variable_get('xmpp_server_running', false); |
| 23 |
|
|
| 24 |
$form['xmpp_server_running'] = array( |
$form['xmpp_server_running'] = array( |
| 25 |
'#title' => t('Running'), |
'#title' => t('Running'), |
| 26 |
'#type' => 'checkbox', |
'#type' => 'checkbox', |
|
'#title' => t('Running'), |
|
| 27 |
'#description' => t('Set whether or not the XMPP Server should continue running. (Only for stopping the server.)'), |
'#description' => t('Set whether or not the XMPP Server should continue running. (Only for stopping the server.)'), |
| 28 |
'#default_value' => $running, |
'#default_value' => $running, |
| 29 |
); |
); |
| 30 |
|
|
| 31 |
/* Host Settings */ |
/* Runtime Settings */ |
| 32 |
$form['xmpp_server_host_settings'] = array( |
$form['xmpp_server_host_settings'] = array( |
| 33 |
'#title' => t('XMPP Server host settings'), |
'#title' => t('XMPP Server runtime settings'), |
| 34 |
'#type' => 'fieldset', |
'#type' => 'fieldset', |
| 35 |
'#description' => t('Settings for the XMPP server\'s identity.'), |
'#description' => t('Settings for the XMPP server\'s runtime behavior.'), |
| 36 |
|
); |
| 37 |
|
|
| 38 |
|
$form['xmpp_server_host_settings']['xmpp_server_ping_frequency'] = array( |
| 39 |
|
'#title' => t('Ping frequency'), |
| 40 |
|
'#type' => 'textfield', |
| 41 |
|
'#description' => t('This value controls the number of seconds that the XMPP server will wait before synchronizing it\'s data with the website. Higher values will increase performance at the cost of accuracy.'), |
| 42 |
|
'#default_value' => variable_get('xmpp_server_ping_frequency', 15), |
| 43 |
|
'#size' => 3, |
| 44 |
); |
); |
| 45 |
|
|
| 46 |
$form['xmpp_server_host_settings']['xmpp_server_host'] = array( |
$form['xmpp_server_host_settings']['xmpp_server_host'] = array( |
| 47 |
'#title' => t('XMPP Server Hostname'), |
'#title' => t('XMPP Server Hostname'), |
| 48 |
'#type' => 'textfield', |
'#type' => 'textfield', |
| 49 |
'#title' => t('XMPP Server Hostname'), |
'#description' => t('The hostname that the XMPP Server will identify itself as. WARNING: Changing this could cause XMPP clients to behave poorly.'), |
|
'#description' => t('The hostname that the XMPP Server will identify itself as.'), |
|
| 50 |
'#default_value' => variable_get('xmpp_server_host', $_SERVER['HTTP_HOST']), |
'#default_value' => variable_get('xmpp_server_host', $_SERVER['HTTP_HOST']), |
| 51 |
); |
); |
| 52 |
|
|