| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
|
| 4 |
//////////////////////////////////////////////////////////////////////////////
|
| 5 |
// Skype Status settings form
|
| 6 |
|
| 7 |
function skype_status_admin_settings() {
|
| 8 |
$form = array();
|
| 9 |
|
| 10 |
$fields = array();
|
| 11 |
$result = db_query("SELECT * FROM {profile_fields} WHERE type = 'textfield' ORDER BY category, weight");
|
| 12 |
while ($field = db_fetch_object($result)) {
|
| 13 |
$fields[$field->name] = t('%category - @title', array('%category' => $field->category, '@title' => $field->title));
|
| 14 |
}
|
| 15 |
|
| 16 |
$form['profile'] = array('#type' => 'fieldset', '#title' => t('User profiles'));
|
| 17 |
$form['profile']['skype_status_profile_field'] = array('#type' => 'radios', '#title' => t('Profile field for Skype ID'), '#options' => $fields, '#default_value' => SKYPE_STATUS_PROFILE_FIELD, '#required' => TRUE, '#description' => t('Select the custom profile field that contains users\' Skype IDs. Note that users who have not filled out this profile field will be ignored when updating status information from Skype\'s web presence service API.'));
|
| 18 |
|
| 19 |
$form['cache'] = array('#type' => 'fieldset', '#title' => t('Cache status information'));
|
| 20 |
$period = drupal_map_assoc(array(60, 180, 300, 600, 900, 1800, 2700, 3600), 'format_interval');
|
| 21 |
$form['cache']['skype_status_cache_lifetime'] = array('#type' => 'select', '#title' => t('Cache statuses for'), '#default_value' => SKYPE_STATUS_CACHE_LIFETIME, '#options' => $period, '#description' => t('To avoid unnecessarily burdening both your Drupal site and Skype\'s web presence service API, users\' online status information is cached locally for a set duration before being re-requested. This option determines the minimum cache lifetime, that is, the minimum amount of time that will elapse before an individual user\'s status can be re-requested. A larger cache lifetime offers better performance at the risk of somewhat stale status information.'));
|
| 22 |
|
| 23 |
$form['reset'] = array('#type' => 'fieldset', '#title' => t('Reset cache'), '#description' => t('To reset the cached online status information for all users, press the button below. This will cause the users\' status to be retrieved on-demand the next time it is needed for display purposes.'));
|
| 24 |
$form['reset']['clear'] = array('#type' => 'submit', '#value' => t('Clear cached statuses'), '#submit' => array('skype_status_clear_cache'));
|
| 25 |
|
| 26 |
return system_settings_form($form);
|
| 27 |
}
|