From 90cfeb57c1680d97262f2d4354cddcd20be3abb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Sat, 14 Dec 2013 10:44:48 +0100 Subject: [PATCH] Simplify a little the code to get the title of the search page. re #127 --- base.php | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/base.php b/base.php index 8001dbd..404cea9 100644 --- a/base.php +++ b/base.php @@ -724,24 +724,16 @@ class PageQueryResult extends Page { global $config; $scope = getURLParam ("scope"); - switch ($scope) { - case self::SCOPE_AUTHOR : - $this->title = str_format (localize ("search.result.author"), $this->query); - break; - case self::SCOPE_TAG : - $this->title = str_format (localize ("search.result.tag"), $this->query); - break; - case self::SCOPE_SERIES : - $this->title = str_format (localize ("search.result.series"), $this->query); - break; - case self::SCOPE_BOOK : - $this->title = str_format (localize ("search.result.book"), $this->query); - break; - case self::SCOPE_PUBLISHER : - $this->title = str_format (localize ("search.result.publisher"), $this->query); - break; - default: - $this->title = str_format (localize ("search.result"), $this->query); + if (empty ($scope)) { + $this->title = str_format (localize ("search.result"), $this->query); + } else { + // Comment to help the perl i18n script + // str_format (localize ("search.result.author"), $this->query) + // str_format (localize ("search.result.tag"), $this->query) + // str_format (localize ("search.result.series"), $this->query) + // str_format (localize ("search.result.book"), $this->query) + // str_format (localize ("search.result.publisher"), $this->query) + $this->title = str_format (localize ("search.result.{$scope}"), $this->query); } $crit = "%" . $this->query . "%";