48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
/**
|
|
* Item Search Page
|
|
*
|
|
* Search for items across all feeds
|
|
*
|
|
* @author Daniel J. Summers <daniel@bitbadger.solutions>
|
|
* @license MIT
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
include '../start.php';
|
|
|
|
FeedReaderCentral\Security::verifyUser();
|
|
|
|
$search = $_GET['search'] ?? '';
|
|
$items = $_GET['items'] ?? 'all';
|
|
|
|
if ($search !== '') {
|
|
$list = FeedReaderCentral\ItemList::matchingSearch($search, $items === 'bookmarked');
|
|
}
|
|
|
|
page_head('Item Search'); ?>
|
|
<h1>Item Search</h1>
|
|
<article>
|
|
<form method=GET action=/search>
|
|
<label>
|
|
Search Criteria
|
|
<input type=text name=search required autofocus value="<?=htmlspecialchars($search)?>">
|
|
</label>
|
|
<label>
|
|
Items to Search
|
|
<select name=items>
|
|
<option value=all <?=$items === 'all' ? ' selected' : ''?>>All</option>
|
|
<option value=bookmarked <?=$items === 'bookmarked' ? ' selected' : ''?>>Bookmarked</option>
|
|
</select>
|
|
</label>
|
|
<span class=break></span>
|
|
<button type=submit>Search</button>
|
|
</form><?php
|
|
if (isset($list)) { ?>
|
|
<hr><?php
|
|
$list->render();
|
|
} ?>
|
|
</article><?php
|
|
page_foot();
|