| 9 |
} |
} |
| 10 |
|
|
| 11 |
function plazes_settings() { |
function plazes_settings() { |
| 12 |
$form = ''; |
$form = array(); |
| 13 |
$form .= form_select(t('Cache time'), 'plazes_cache_time', variable_get('plazes_cache_time', 30), |
|
| 14 |
array( |
$form['plazes_cache_time'] = array( |
| 15 |
1 => format_plural(1, '%count minute', '%count minutes'), |
'#type' => 'select', '#title' => t('Cache time'), |
| 16 |
5 => format_plural(5, '%count minute', '%count minutes'), |
'#default_value' => variable_get('plazes_cache_time', 30), |
| 17 |
10 => format_plural(10, '%count minute', '%count minutes'), |
'#options' => array( |
| 18 |
30 => format_plural(30, '%count minute', '%count minutes'), |
1 => format_plural(1, '%count minute', '%count minutes'), |
| 19 |
60 => format_plural(1, '%count hour', '%count hours'), |
5 => format_plural(5, '%count minute', '%count minutes'), |
| 20 |
120 => format_plural(2, '%count hour', '%count hours'), |
10 => format_plural(10, '%count minute', '%count minutes'), |
| 21 |
), t('The time for caching of plazes data.')); |
30 => format_plural(30, '%count minute', '%count minutes'), |
| 22 |
$form .= form_textarea(t('Message shown on user profile'), 'plazes_profile_message', variable_get('plazes_profile_message', '%username can be found here: <a href="%plazeurl">%plazename</a>.'), 50, 6, t('Here you can setup the text that will be shown on the profile page with the Plazes info. You can use substitution variables here, like %plazeurl and %plazename.')); |
60 => format_plural(1, '%count hour', '%count hours'), |
| 23 |
|
120 => format_plural(2, '%count hour', '%count hours'), |
| 24 |
|
), '#description' => t('The time for caching of plazes data.'), |
| 25 |
|
); |
| 26 |
|
$form['plazes_profile_message'] = array( |
| 27 |
|
'#type' => 'textarea', '#title' => t('Message shown on user profile'), |
| 28 |
|
'#default_value' => variable_get('plazes_profile_message', '%username can be found here: <a href="%plazeurl">%plazename</a>.'), 50, 6, t('Here you can setup the text that will be shown on the profile page with the Plazes info. You can use substitution variables here, like %plazeurl and %plazename.'), |
| 29 |
|
'#rows' => 8, |
| 30 |
|
); |
| 31 |
|
|
| 32 |
return $form; |
return $form; |
| 33 |
} |
} |
| 34 |
|
|
| 41 |
return xmlrpc(_plazes_location(), 'plazes.whereami', $username, md5('PLAZES'. $passwd)); |
return xmlrpc(_plazes_location(), 'plazes.whereami', $username, md5('PLAZES'. $passwd)); |
| 42 |
} |
} |
| 43 |
|
|
| 44 |
function plazes_user_form($user) { |
function plazes_user_form($user) { |
| 45 |
$output = ''; |
$form = array(); |
| 46 |
$output .= form_textfield(t('Plazes login'), 'plazes_user', $user->plazes_user, 30, 255); |
|
| 47 |
$output .= form_password(t('Password'), 'plazes_passwd', $user->plazes_passwd, 30, 255); |
$form['plazes'] = array( |
| 48 |
|
'#type' => 'fieldset', '#title' => t('Plazes'), '#weight' => 4 |
| 49 |
|
); |
| 50 |
|
$form['plazes']['plazes_user'] = array( |
| 51 |
|
'#type' => 'textfield', '#title' => t('Plazes login'), '#size' => 30, |
| 52 |
|
'#maxlength' => 255, '#default_value' => $user->plazes_user |
| 53 |
|
); |
| 54 |
|
$form['plazes']['plazes_passwd'] = array( |
| 55 |
|
'#type' => 'password', '#title' => t('Password'), '#size' => 30, |
| 56 |
|
'#maxlength' => 255, '#default_value' => $user->plazes_passwd |
| 57 |
|
); |
| 58 |
|
|
| 59 |
return $output; |
return $form; |
| 60 |
} |
} |
| 61 |
|
|
| 62 |
function plazes_user_update(&$user) { |
function plazes_user_update(&$user) { |
| 90 |
break; |
break; |
| 91 |
case 'form': |
case 'form': |
| 92 |
if ($category == 'account') { |
if ($category == 'account') { |
| 93 |
return array( |
return plazes_user_form($user); |
|
array( |
|
|
'title' => t('Plazes'), |
|
|
'data' => plazes_user_form($user), |
|
|
'weight' => 0 |
|
|
) |
|
|
); |
|
| 94 |
} |
} |
| 95 |
break; |
break; |
| 96 |
} |
} |