/[drupal]/contributions/modules/plazes/plazes.module
ViewVC logotype

Diff of /contributions/modules/plazes/plazes.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1, Fri Nov 11 20:56:31 2005 UTC revision 1.2, Sat Nov 12 22:50:30 2005 UTC
# Line 9  function plazes_help($section) { Line 9  function plazes_help($section) {
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    
# Line 32  function plazes_api_whereami($username, Line 41  function plazes_api_whereami($username,
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) {
# Line 71  function plazes_user($op, &$edit, &$user Line 90  function plazes_user($op, &$edit, &$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    }    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.2