From ea3da650de80e612bd49a98bb20c307744cf9758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Fri, 30 Aug 2013 15:52:28 +0200 Subject: [PATCH] Working with cops --HG-- extra : rebase_source : 66639c415fc1286e8df50c255d83b0e8f92777d3 --- epubfs.php | 20 +++++++++++++------- epubreader.php | 26 ++++++++++++++++---------- resources/php-epub-meta/epub.php | 8 ++++++++ 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/epubfs.php b/epubfs.php index e34c79e..587e05f 100644 --- a/epubfs.php +++ b/epubfs.php @@ -1,5 +1,8 @@ getFilePath ("EPUB", $idData)); + $book->initSpineComponent (); $component = $_GET["comp"]; @@ -22,14 +31,14 @@ try { $data = $book->component ($component); $directory = dirname ($component); - $callback = function ($m) use ($book, $component) { + $callback = function ($m) use ($book, $component, $add) { $method = $m[1]; $path = $m[2]; if (preg_match ("/^#/", $path)) { return $path; } $comp = $book->getComponentName ($component, $path); - return "$method'epubfs.php?comp=$comp'"; + return "$method'epubfs.php?{$add}comp=$comp'"; }; $data = preg_replace_callback ("/(src=)[\"']([^:]*?)[\"']/", $callback, $data); @@ -42,7 +51,4 @@ try { catch (Exception $e) { error_log ($e); notFound (); -} - - -?> \ No newline at end of file +} \ No newline at end of file diff --git a/epubreader.php b/epubreader.php index f865914..7b916bb 100644 --- a/epubreader.php +++ b/epubreader.php @@ -1,27 +1,33 @@ + + getFilePath ("EPUB", $idData)); $book->initSpineComponent (); ?> - - COPS's Epub Reader - - - - " media="screen" /> - " media="screen" /> + + + + " media="screen" /> + " media="screen" />