mirror of
https://github.com/standardebooks/web.git
synced 2025-07-21 23:04:57 -04:00
Improve how collections are organized and internally and printed to HTML
This commit is contained in:
parent
c8cacc4ace
commit
aed7db7fc1
4 changed files with 23 additions and 15 deletions
|
@ -163,16 +163,16 @@ class Library{
|
|||
|
||||
// Create the collections cache
|
||||
foreach($ebook->Collections as $collection){
|
||||
$lcCollection = strtolower(Formatter::RemoveDiacritics($collection->Name));
|
||||
if(!array_key_exists($lcCollection, $collections)){
|
||||
$collections[$lcCollection] = [];
|
||||
$urlSafeCollection = Formatter::MakeUrlSafe($collection->Name);
|
||||
if(!array_key_exists($urlSafeCollection, $collections)){
|
||||
$collections[$urlSafeCollection] = [];
|
||||
}
|
||||
|
||||
if($collection->SequenceNumber !== null){
|
||||
$collections[$lcCollection][$collection->SequenceNumber] = $ebook;
|
||||
$collections[$urlSafeCollection][$collection->SequenceNumber] = $ebook;
|
||||
}
|
||||
else{
|
||||
$collections[$lcCollection][] = $ebook;
|
||||
$collections[$urlSafeCollection][] = $ebook;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue