====== Collapsed breadcrumb ====== \\ Main breadcrumb (not Search breadcrumb) format defined in ''sites/all/modules/islandora-github/ObjectHelper.inc'' \\ Edit file: \\ \\ ... /** * Builds an array of drupal links for use in breadcrumbs. * * @global type $base_url * @param type $pid * @param type $breadcrumbs * @param type $level */ function getBreadcrumbs($pid, &$breadcrumbs, $level=10) { module_load_include('inc', 'fedora_repository', 'api/fedora_utils'); // Before executing the query, we hve a base case of accessing the top-level collection global $base_url; if ($pid == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } else { $query_string = 'select $parentObject $title $content from <#ri> where ( $title and $parentObject $content and ( $parentObject or $parentObject or $parentObject) and $parentObject ) minus $content Tip order by $parentObject'; $query_string = htmlentities(urlencode($query_string)); $url = variable_get('fedora_repository_url', 'http://localhost:8080/fedora/risearch'); $url .= "?type=tuples&flush=TRUE&format=CSV&limit=1&offset=0&lang=itql&stream=on&query=" . $query_string; $result = preg_split('/[\r\n]+/', do_curl($url)); array_shift($result); // throw away first line $matches = str_getcsv(join("\n", $result)); if ($matches !== FALSE) { $parent = preg_replace('/^info:fedora\//', '', $matches[0]); Tip /* $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); */ if ((strlen($parent) >0) && ($level <10)) { /* if (substr($matches[1],-11,6) == '- page') { */ if (substr($matches[1],-11,6) != '- page') { /* $breadcrumbs[] = l(substr($matches[1],-9), 'fedora/repository/' . $pid); */ /* } */ /* else if (strlen($matches[1]) > 20){ */ if (strlen($matches[1]) > 25){ $breadcrumbs[] = l(htmlentities(substr($matches[1],0,25)) . '...', 'fedora/repository/' . $pid); } else { $breadcrumbs[] = l($matches[1], 'fedora/repository/' . $pid); } } } if ($parent == variable_get('fedora_repository_pid', 'islandora:root')) { $breadcrumbs[] = l(t('Digital repository'), 'fedora/repository'); $breadcrumbs[] = l(t('Home'), $base_url); } elseif ($level > 0) { $this->getBreadcrumbs($parent, $breadcrumbs, $level - 1); } } } } ...