Skip to content
Snippets Groups Projects
Commit efb56d76 authored by Patrick Dawkins's avatar Patrick Dawkins
Browse files

Added (crude) export of image and file fields for candidates.

parent 32a04f06
No related branches found
No related tags found
No related merge requests found
...@@ -381,11 +381,20 @@ function _election_candidate_download_format_property(stdClass $candidate, $prop ...@@ -381,11 +381,20 @@ function _election_candidate_download_format_property(stdClass $candidate, $prop
return check_plain($value); return check_plain($value);
} }
break; break;
// Commonly, fields contain a value in field_name['und'][0]['value']. case 'file':
case 'image':
if (is_array($value) && isset($value['und'][0]['uri'])) {
return file_create_url($value['und'][0]['uri']);
}
break;
default: default:
// @todo find out how to i18n this. if (is_array($value)) {
if (is_array($value) && isset($value['und'][0]['value'])) { if (isset($value['und'][0]['safe_value'])) {
return $value['und'][0]['value']; return $value['und'][0]['safe_value'];
}
else if (isset($value['und'][0]['value'])) {
return check_plain($value['und'][0]['value']);
}
} }
} }
} }
\ No newline at end of file
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