function make_page_breadcrumbs($tree_index, $tree_full, $id_col, $title_col, $getname = "rownav") { $_GET[$getname] = !empty($_GET[$getname]) && isnum($_GET[$getname]) ? $_GET[$getname] : 0; function breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $id) { $crumb =& $crumb; if (isset($tree_index[get_parent($tree_index, $id)])) { $_name = get_parent_array($tree_full, $id); $crumb = array('link' => isset($_name[$id_col]) ? clean_request($getname . "=" . $_name[$id_col], array("aid"), TRUE) : "", 'title' => isset($_name[$title_col]) ? \PHPFusion\QuantumFields::parse_label($_name[$title_col]) : ""); if (get_parent($tree_index, $id) == 0) { return $crumb; } $crumb_1 = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, get_parent($tree_index, $id)); if (!empty($crumb_1)) { $crumb = array_merge_recursive($crumb, $crumb_1); } } return $crumb; } // then we make a infinity recursive function to loop/break it out. $crumb = breadcrumb_page_arrays($tree_index, $tree_full, $id_col, $title_col, $getname, $_GET[$getname]); // then we sort in reverse. if (count($crumb['title']) > 1) { krsort($crumb['title']); krsort($crumb['link']); } if (count($crumb['title']) > 1) { foreach ($crumb['title'] as $i => $value) { add_breadcrumb(array('link' => $crumb['link'][$i], 'title' => $value)); if ($i == count($crumb['title']) - 1) { OutputHandler::addToTitle($GLOBALS['locale']['global_200'] . $value); OutputHandler::addToMeta($value); } } } elseif (isset($crumb['title'])) { OutputHandler::addToTitle($GLOBALS['locale']['global_200'] . $crumb['title']); OutputHandler::addToMeta($crumb['title']); add_breadcrumb(array('link' => $crumb['link'], 'title' => $crumb['title'])); } }
/** * Append something to a meta tag * * @param string $name * @param string $addition */ function add_to_meta($name, $addition = "") { OutputHandler::addToMeta($name, $addition); }