function panels_profile_fields_content in Panels 6.2
Same name and namespace in other branches
- 5.2 content_types/profile_fields.inc \panels_profile_fields_content()
'Render' callback for the 'profile fields' content type.
1 string reference to 'panels_profile_fields_content'
- panels_profile_fields_panels_content_types in content_types/
profile_fields.inc - Callback function to supply a list of content types.
File
- content_types/
profile_fields.inc, line 27
Code
function panels_profile_fields_content($subtype, $conf, $panel_args, $context) {
$account = isset($context->data) ? drupal_clone($context->data) : NULL;
$block = new stdClass();
$block->module = 'profile fields';
if ($account) {
// Get the category from the options
$category = str_replace("_", " ", $conf['category']);
// Set the subject to the name of the category
$block->subject = $category;
// Put all the fields in the category into an array
profile_view_profile($account);
if (is_array($account->content[$category])) {
foreach ($account->content[$category] as $field) {
if (is_array($field['#attributes'])) {
$vars[$field['#attributes']['class']]['title'] = $field['#title'];
$vars[$field['#attributes']['class']]['value'] = $field['#value'];
}
}
}
if (count($vars) == 0) {
// Output the given empty text
$output = $conf['empty'];
}
else {
// Call the theme function with the field vars
$output = theme('profile_fields_pane', $category, $vars);
}
$block->content = $output;
$block->delta = $account->uid;
}
else {
$block->subject = $conf['category'];
$block->content = t('Profile content goes here.');
$block->delta = 'unknown';
}
return $block;
}