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

Diff of /contributions/modules/pcp/pcp.module

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

revision 1.1, Thu Oct 9 21:49:20 2008 UTC revision 1.2, Mon Dec 8 16:55:55 2008 UTC
# Line 40  function pcp_menu($may_cache) { Line 40  function pcp_menu($may_cache) {
40  function pcp_block($op = 'list', $delta = 0, $edit = array()) {  function pcp_block($op = 'list', $delta = 0, $edit = array()) {
41    switch ($op) {    switch ($op) {
42      case 'list':      case 'list':
43          $blocks = array();
44        $blocks[0]['info'] = t('Profile Complete Percentage');        $blocks[0]['info'] = t('Profile Complete Percentage');
45        return $blocks;        return $blocks;
46        break;        break;
47      case 'view':      case 'view':
48          $block = array();
49        switch ($delta) {        switch ($delta) {
50          case 0:          case 0:
51            global $user;            global $user;
# Line 164  function pcp_admin_settings_form_submit( Line 166  function pcp_admin_settings_form_submit(
166   *    - An indexed array of all (if any) default values for the form.   *    - An indexed array of all (if any) default values for the form.
167   */   */
168  function pcp_admin_settings_form_data() {  function pcp_admin_settings_form_data() {
169      $profile_fields_options = array();
170      $default_values = array();
171    $profile_fields = pcp_get_profile_fields();    $profile_fields = pcp_get_profile_fields();
172    
173    foreach ($profile_fields as $key => $value) {    foreach ($profile_fields as $key => $value) {
174      $profile_fields_options[$value['fid']] = $value['title'];      $profile_fields_options[$value['fid']] = $value['title'];
175    }    }
# Line 172  function pcp_admin_settings_form_data() Line 177  function pcp_admin_settings_form_data()
177    foreach ($tagged_profile_fields as $key => $value) {    foreach ($tagged_profile_fields as $key => $value) {
178      $default_values[] = $value['fid'];      $default_values[] = $value['fid'];
179    }    }
180    
181      $options = array();
182    $options['profile_fields_options'] = $profile_fields_options;    $options['profile_fields_options'] = $profile_fields_options;
183    $options['default_values'] = $default_values;    $options['default_values'] = $default_values;
184    return $options;    return $options;
# Line 235  function pcp_get_complete_percentage_dat Line 242  function pcp_get_complete_percentage_dat
242        $nextpercent = $next * 100;        $nextpercent = $next * 100;
243      }      }
244    }    }
245      $complete_data = array();
246    $complete_data['uid'] = $user->uid;    $complete_data['uid'] = $user->uid;
247    $complete_data['percent'] = $percent;    $complete_data['percent'] = $percent;
248    $complete_data['completed']  = $complete;    $complete_data['completed']  = $complete;

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

  ViewVC Help
Powered by ViewVC 1.1.2