@@ -70,7 +70,7 @@ |
||
70 | 70 | |
71 | 71 | $top10 = DB::table('hit_counter') |
72 | 72 | ->where('gedcom_id', '=', $tree->id()) |
73 | - ->whereIn('page_name', ['individual.php','family.php','source.php','repo.php','note.php','mediaviewer.php']) |
|
73 | + ->whereIn('page_name', ['individual.php', 'family.php', 'source.php', 'repo.php', 'note.php', 'mediaviewer.php']) |
|
74 | 74 | ->orderByDesc('page_count') |
75 | 75 | ->limit((int) $num) |
76 | 76 | ->pluck('page_count', 'page_parameter'); |
@@ -103,7 +103,7 @@ |
||
103 | 103 | $pages = []; |
104 | 104 | |
105 | 105 | // Escape the query for MySQL and PHP, converting spaces to wildcards. |
106 | - $like_query = strtr($query, [ |
|
106 | + $like_query = strtr($query, [ |
|
107 | 107 | '_' => '\\_', |
108 | 108 | '%' => '\\%', |
109 | 109 | ' ' => '%', |
@@ -185,15 +185,15 @@ |
||
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
188 | - * Search for sources by name. |
|
189 | - * |
|
190 | - * @param Tree $tree |
|
191 | - * @param string $search |
|
192 | - * @param int $offset |
|
193 | - * @param int $limit |
|
194 | - * |
|
195 | - * @return Collection|Source[] |
|
196 | - */ |
|
188 | + * Search for sources by name. |
|
189 | + * |
|
190 | + * @param Tree $tree |
|
191 | + * @param string $search |
|
192 | + * @param int $offset |
|
193 | + * @param int $limit |
|
194 | + * |
|
195 | + * @return Collection|Source[] |
|
196 | + */ |
|
197 | 197 | public function searchSourcesByName(Tree $tree, string $search, int $offset = 0, int $limit = PHP_INT_MAX): Collection |
198 | 198 | { |
199 | 199 | $query = DB::table('sources') |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | public const RECORD_TYPE = 'SOUR'; |
30 | 30 | |
31 | - protected const ROUTE_NAME = 'source'; |
|
31 | + protected const ROUTE_NAME = 'source'; |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * A closure which will create a record from a database row. |
@@ -401,19 +401,19 @@ |
||
401 | 401 | private function faqsExist(Tree $tree, string $language): bool |
402 | 402 | { |
403 | 403 | return DB::table('block') |
404 | - ->join('block_setting', 'block_setting.block_id', '=', 'block.block_id') |
|
405 | - ->where('module_name', '=', $this->getName()) |
|
406 | - ->where('setting_name', '=', 'languages') |
|
407 | - ->where(function (Builder $query) use ($tree): void { |
|
408 | - $query |
|
409 | - ->whereNull('gedcom_id') |
|
410 | - ->orWhere('gedcom_id', '=', $tree->id()); |
|
411 | - }) |
|
412 | - ->select(['setting_value AS languages']) |
|
413 | - ->get() |
|
414 | - ->filter(function (stdClass $faq) use ($language): bool { |
|
415 | - return $faq->languages === '' || in_array($language, explode(',', $faq->languages)); |
|
416 | - }) |
|
404 | + ->join('block_setting', 'block_setting.block_id', '=', 'block.block_id') |
|
405 | + ->where('module_name', '=', $this->getName()) |
|
406 | + ->where('setting_name', '=', 'languages') |
|
407 | + ->where(function (Builder $query) use ($tree): void { |
|
408 | + $query |
|
409 | + ->whereNull('gedcom_id') |
|
410 | + ->orWhere('gedcom_id', '=', $tree->id()); |
|
411 | + }) |
|
412 | + ->select(['setting_value AS languages']) |
|
413 | + ->get() |
|
414 | + ->filter(function (stdClass $faq) use ($language): bool { |
|
415 | + return $faq->languages === '' || in_array($language, explode(',', $faq->languages)); |
|
416 | + }) |
|
417 | 417 | ->isNotEmpty(); |
418 | 418 | } |
419 | 419 | } |