Add more type hints and work on some code formatting

This commit is contained in:
Alex Cabal 2024-11-08 13:50:59 -06:00
parent 06b82cdaaa
commit c3c588cc1b
35 changed files with 343 additions and 167 deletions

View file

@ -1,12 +1,19 @@
<?
$allSelected = sizeof($tags) == 0 || in_array('all', $tags);
/**
* @var array<string> $tags
* @var EbookSortType $sort
* @var ViewType $view
* @var int $perPage
*/
$isAllSelected = sizeof($tags) == 0 || in_array('all', $tags);
?>
<form action="/ebooks" method="get" rel="search">
<label class="tags">Subjects
<select <? if(!Template::IsEreaderBrowser()){ ?> multiple="multiple"<? } ?> name="tags[]" size="1">
<option value="all">All</option>
<? foreach(Library::GetTags() as $tag){ ?>
<option value="<?= $tag->UrlName ?>"<? if(!$allSelected && in_array($tag->UrlName, $tags)){ ?> selected="selected"<? } ?>><?= Formatter::EscapeHtml($tag->Name) ?></option>
<option value="<?= $tag->UrlName ?>"<? if(!$isAllSelected && in_array($tag->UrlName, $tags)){ ?> selected="selected"<? } ?>><?= Formatter::EscapeHtml($tag->Name) ?></option>
<? } ?>
</select>
</label>