Overview
Comment:Fix web search link
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: 1b784acf2edc9e24500889f1b653e9b5487c6907b5efcdd6fb6efcd5e548388c
User & Date: bohwaz on 2021-05-06 02:12:47
Other Links: manifest | tags
Context
2021-05-06
20:01
Fix wiki doc check-in: f0cf68d580 user: bohwaz tags: trunk, stable
14:10
Merge trunk changes check-in: a8800bc992 user: bohwaz tags: dev
02:12
Fix web search link check-in: 1b784acf2e user: bohwaz tags: trunk, stable
2021-05-05
11:12
Fix typo and welcome plugin check-in: 87bc7c956f user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Web/Web.php from [631bb6f7f6] to [8b024968b4].

20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Web
{
	static public function search(string $search): array
	{
		$results = Files::search($search, File::CONTEXT_WEB . '%');

		foreach ($results as &$result) {
			$result->uri = Utils::dirname(substr($result->path, strlen(File::CONTEXT_WEB) + 1));
			$result->breadcrumbs = [];
			$path = '';

			foreach (explode('/', $result->uri) as $part) {
				$path = trim($path . '/' . $part, '/');
				$result->breadcrumbs[$path] = $part;
			}
		}

		return $results;
	}







|



|







20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class Web
{
	static public function search(string $search): array
	{
		$results = Files::search($search, File::CONTEXT_WEB . '%');

		foreach ($results as &$result) {
			$result->path = Utils::dirname(substr($result->path, strlen(File::CONTEXT_WEB) + 1));
			$result->breadcrumbs = [];
			$path = '';

			foreach (explode('/', $result->path) as $part) {
				$path = trim($path . '/' . $part, '/');
				$result->breadcrumbs[$path] = $part;
			}
		}

		return $results;
	}