You are here

function theme_epub_formatter_toc in Epub 7

1 theme call to theme_epub_formatter_toc()
epub_field_formatter_view in includes/epub.field.inc
Implements hook_field_formatter_view().

File

includes/epub.field.inc, line 311

Code

function theme_epub_formatter_toc($variables) {
  $file_url = file_create_url($variables['file']->uri);
  $filename = $variables['file']->filename;
  $dir = 'public://epub_content/' . $variables['file']->fid;
  if (file_entity_access('download', $variables['file'])) {
    $download_link = t('Download: ') . l($filename, $file_url);
  }
  return $download_link . epub_get_toc($dir, '_blank');
}