Skip to content
Snippets Groups Projects
Commit cbdc2ee5 authored by Oliver Davies's avatar Oliver Davies
Browse files

Add user pictures to candidate ballot items

parent 287dae74
No related branches found
No related tags found
No related merge requests found
......@@ -84,3 +84,22 @@ function bluecheese_menu_local_tasks(&$variables) {
return $output;
}
function bluecheese_election_candidate_ballot_item($variables) {
$candidate = $variables['candidate'];
$account = user_load($candidate->uid);
$picture = theme('image', array(
'path' => isset($account->field_user_picture) ? $account->field_user_picture[LANGUAGE_NONE][0]['url'] : variable_get('user_picture_default'),
'alt' => t('@user’s picture', array('@user' => format_username($account))),
'attributes' => array(
'title' => t('View user picture'),
'class' => array('user-picture'),
),
));
$full_name = theme('election_candidate_full_name', array('candidate' => $candidate));
$link = l($picture . $full_name, election_candidate_uri_path($candidate), array('html' => TRUE));
return '<span class="election-candidate-ballot-item">' . $link . '</span>';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment