aboutsummaryrefslogtreecommitdiffstats
path: root/admin/page/search.php
diff options
context:
space:
mode:
Diffstat (limited to 'admin/page/search.php')
-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);
}