aboutsummaryrefslogtreecommitdiffstats
path: root/admin/page
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2021-07-24 22:51:44 +0200
committerThomas Lange <code@nerdmind.de>2021-07-24 22:51:44 +0200
commitcff7f23029e37e5e9c458aaf6f10110c7bd577a7 (patch)
tree3f00d42a0e02616cd904aa706c8ed588b2f19d4c /admin/page
parent3037af3a80246870284e7c1ab52f407a081f5ffd (diff)
downloadblog-cff7f23029e37e5e9c458aaf6f10110c7bd577a7.tar.gz
blog-cff7f23029e37e5e9c458aaf6f10110c7bd577a7.tar.xz
blog-cff7f23029e37e5e9c458aaf6f10110c7bd577a7.zip
Show message if search was not successful
Show a message in the administration area's post and page search form if the search query returned no results.
Diffstat (limited to 'admin/page')
-rw-r--r--admin/page/search.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/admin/page/search.php b/admin/page/search.php
index a88ab15..c9a39cf 100644
--- a/admin/page/search.php
+++ b/admin/page/search.php
@@ -31,7 +31,12 @@ $offset = ($currentSite-1) * $site_size;
#===============================================================================
if($search = HTTP::GET('q')) {
try {
- foreach($PageRepository->search($search, [], $site_size, $offset) as $Page) {
+ if(!$pages = $PageRepository->search($search, [], $site_size, $offset)) {
+ $messages[] = Application::getLanguage()->text(
+ 'search_no_results', htmlspecialchars($search));
+ }
+
+ foreach($pages as $Page) {
$User = $UserRepository->find($Page->get('user'));
$templates[] = generatePageItemTemplate($Page, $User);
}