From c8cacc4ace03e7bc7e411c5567ac701c127004a1 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Fri, 22 May 2020 15:59:00 -0500 Subject: [PATCH] Add series number to collection headline --- lib/Collection.php | 1 + lib/Ebook.php | 3 +++ www/ebooks/ebook.php | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Collection.php b/lib/Collection.php index 857b3d05..7247cc8f 100644 --- a/lib/Collection.php +++ b/lib/Collection.php @@ -3,6 +3,7 @@ class Collection{ public $Name; public $Url; public $SequenceNumber = null; + public $Type = null; public function __construct(string $name){ $this->Name = $name; diff --git a/lib/Ebook.php b/lib/Ebook.php index 4d1559e5..03a4ba0f 100644 --- a/lib/Ebook.php +++ b/lib/Ebook.php @@ -170,6 +170,9 @@ class Ebook{ foreach($xml->xpath('/package/metadata/meta[@refines="#' . $collection->attributes()->id . '"][@property="group-position"]') ?: [] as $s){ $c->SequenceNumber = (int)$s; } + foreach($xml->xpath('/package/metadata/meta[@refines="#' . $collection->attributes()->id . '"][@property="collection-type"]') ?: [] as $s){ + $c->Type = (string)$s; + } $this->Collections[] = $c; } diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 76332635..3575ea1a 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -79,11 +79,11 @@ catch(\Exception $ex){

ContributorsHtml ?>

Collections) > 0){ ?> -

Part of the +

Collections) == 1 && $ebook->Collections[0]->SequenceNumber !== null){ ?>№ Collections[0]->SequenceNumber) ?> in thePart of the Collections); $i++){ ?> Collections[$i]->Name) ?? '') ?>Collections) > 2){ ?>Collections) - 2){ ?>, and Collections) - 1){ ?>, Collections) - 2){ ?> and - collectionCollections) > 1){ ?>s.

+ Collections) == 1 && $ebook->Collections[0]->Type !== null){ ?>Collections[0]->Name), mb_strtolower($ebook->Collections[0]->Type), -strlen(mb_strtolower($ebook->Collections[0]->Type))) !== 0){ ?>Collections[0]->Type ?>collectionCollections) > 1){ ?>s.