1], ''); sort($data); return $data; } /** * Generate namespace breadcrumbs for search results */ function getNsLinks($id, $keywords, $search) { $parts = explode(':', $id); $count = count($parts); $part = ''; $data = []; $titles = []; for ($i = 0; $i < $count; $i++) { $part .= ($i > 0 ? ':' : '') . $parts[$i]; $page = $part; resolve_pageid('', $page, $exists); if (str_ends_with($page, ':start')) { $page = substr($page, 0, -6); } $titles[] = $parts[$i]; $data[] = ['link' => "?do=search&id=" . urlencode($keywords . " @ns $page")]; } $titleExcerpts = $search->getExcerpt($titles, $search->starQuery($keywords)); foreach ($data as $key => $val) { $data[$key]['title'] = $titleExcerpts[$key] ?? $titles[$key]; } return $data; } function printNamespacesNew($pageNames) { if (empty($pageNames)) return false; $limit = 10; echo '