You are here

function epub_preprocess_html in Epub 7

File

./epub.module, line 328

Code

function epub_preprocess_html(&$variables) {
  if (arg(0) == 'file' && is_numeric(arg(1)) && arg(2) == '') {
    if ($file = file_load(arg(1))) {
      if (file_entity_access('view', $file) && $file->filemime == 'application/epub+zip') {
        $parameters = drupal_get_query_parameters();
        if (isset($parameters['fullscreen'])) {
          $variables['theme_hook_suggestions'][] = 'epub_js_reader';
          $variables['file'] = $file;
          $variables['unzipped'] = TRUE;
        }
      }
    }
  }

  /*
  if (isset($variables['page']['content']['system_main']['file'])) {
    if ($variables['page']['content']['system_main']['file']['#theme'] == 'epub_formatter_epubjs_reader') {
      $parameters = drupal_get_query_parameters();
      if (isset($parameters['fullscreen'])) {
        $variables['theme_hook_suggestions'][] = 'epub_js_reader';
        $variables['file'] = $variables['page']['content']['system_main']['#file'];
        $variables['unzipped'] = $variables['page']['content']['system_main']['file']['#unzipped'];
      }
    }
  }
  */
}