| 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; |
| 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 |
} |
} |
| 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; |
| 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; |