You are here

function epub_block_view in Epub 7

File

./epub.module, line 64

Code

function epub_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'epub':
      if (arg(0) == 'file' && ($file = file_load(arg(1)))) {
        if ($file->filemime == 'application/epub+zip') {
          $path = file_create_url('public://epub_content/' . $file->fid);
          $file_url = file_create_url($file->uri);
          $block['subject'] = t('Contents');
          $block['content'] = epub_get_toc('public://epub_content/' . $file->fid, 'epub');
        }
      }
  }
  return $block;
}