Convert ebook SORT_ constants to an enum

This commit is contained in:
Mike Colagrosso 2024-01-29 23:34:48 -07:00 committed by Alex Cabal
parent 94dce1009a
commit 980ed8cea9
5 changed files with 17 additions and 16 deletions

View file

@ -17,10 +17,10 @@ $allSelected = sizeof($tags) == 0 || in_array('all', $tags);
<span>Sort</span>
<span>
<select name="sort">
<option value="<?= SORT_NEWEST ?>"<? if($sort == SORT_NEWEST){ ?> selected="selected"<? } ?>>S.E. release date (new &#x2192; old)</option>
<option value="<?= SORT_AUTHOR_ALPHA ?>"<? if($sort == SORT_AUTHOR_ALPHA){ ?> selected="selected"<? } ?>>Author name (a &#x2192; z)</option>
<option value="<?= SORT_READING_EASE ?>"<? if($sort == SORT_READING_EASE){ ?> selected="selected"<? } ?>>Reading ease (easy &#x2192; hard)</option>
<option value="<?= SORT_LENGTH ?>"<? if($sort == SORT_LENGTH){ ?> selected="selected"<? } ?>>Length (short &#x2192; long)</option>
<option value="<?= EbookSort::Newest->value ?>"<? if($sort == EbookSort::Newest->value){ ?> selected="selected"<? } ?>>S.E. release date (new &#x2192; old)</option>
<option value="<?= EbookSort::AuthorAlpha->value ?>"<? if($sort == EbookSort::AuthorAlpha->value){ ?> selected="selected"<? } ?>>Author name (a &#x2192; z)</option>
<option value="<?= EbookSort::ReadingEase->value ?>"<? if($sort == EbookSort::ReadingEase->value){ ?> selected="selected"<? } ?>>Reading ease (easy &#x2192; hard)</option>
<option value="<?= EbookSort::Length->value ?>"<? if($sort == EbookSort::Length->value){ ?> selected="selected"<? } ?>>Length (short &#x2192; long)</option>
</select>
</span>
</label>