function svg_embed_file_download in SVG Embed 7
Implements hook_file_download().
File
- ./
svg_embed.module, line 117 - SVG Embed. Provides a filter for text formats that includes and on the fly translates SVG files into text fields.
Code
function svg_embed_file_download($uri) {
global $user;
if (strpos(file_uri_target($uri), 'svg_embed/') === 0) {
if (user_access('translate interface')) {
return array(
'Pragma' => 'public',
'Expires' => 0,
'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0',
'Content-Type' => 'application/force-download',
);
}
else {
return -1;
}
}
return NULL;
}