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

Moved candidate picture logic to association_drupalorg_candidate_picture()

parent 3d03194f
No related branches found
No related tags found
No related merge requests found
...@@ -89,21 +89,7 @@ function bluecheese_election_candidate_ballot_item($variables) { ...@@ -89,21 +89,7 @@ function bluecheese_election_candidate_ballot_item($variables) {
$candidate = $variables['candidate']; $candidate = $variables['candidate'];
$account = user_load($candidate->uid); $account = user_load($candidate->uid);
if (!empty($candidate->field_election_picture)) { $picture = association_drupalorg_candidate_picture($candidate, $account);
$picture = theme('image_style', array(
'style_name' => 'candidate_thumbnail',
'path' => $candidate->field_election_picture[LANGUAGE_NONE][0]['uri'],
'alt' => t('@user’s picture', array('@user' => format_username($account))),
'attributes' => array(
'title' => t('View user picture'),
'class' => array('candidate-picture'),
),
));
}
else {
$picture = NULL;
}
$full_name = theme('election_candidate_full_name', array('candidate' => $candidate)); $full_name = theme('election_candidate_full_name', array('candidate' => $candidate));
$link = l($picture . $full_name, election_candidate_uri_path($candidate), array('html' => TRUE)); $link = l($picture . $full_name, election_candidate_uri_path($candidate), array('html' => TRUE));
......
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