Beispiel #1
0
function _breadcrumb_buildTrail($crumbs, $len = -1, $cnt = -1)
{
    global $structure, $structure_path, $feature_breadcrumbs, $feature_siteidentity;
    global $feature_sitetitle, $print_page, $info, $site_crumb_seper;
    $seper = ' ' . htmlentities($site_crumb_seper, ENT_QUOTES, "UTF-8") . ' ';
    switch ($feature_sitetitle) {
        case 'y':
            $loclass = "pagetitle";
            $hiclass = "pagetitle";
            break;
        case 'title':
            $loclass = "crumblink";
            $hiclass = "pagetitle";
            break;
        case 'n':
        default:
            $loclass = "crumblink";
            $hiclass = "crumblink";
            break;
    }
    if ($feature_siteidentity == 'n' || $feature_breadcrumbs == 'n') {
        $loclass = "crumblink";
        $hiclass = "pagetitle";
    }
    if ($len == -1) {
        $len = count($crumbs);
    }
    if (_is_assoc($crumbs)) {
        return false;
    }
    if (is_array($crumbs)) {
        $ret = array();
        if ($structure == 'y' && $info) {
            $cnt += 1;
            $ret = breadcrumb_buildStructureTrail($structure_path, $cnt, $loclass);
            // prepend the root crumb
            array_unshift($ret, _breadcrumb_buildCrumb($crumbs[$cnt], $cnt, $loclass));
        } else {
            foreach ($crumbs as $crumb) {
                $cnt += 1;
                if ($len != $cnt + 1) {
                    $ret[] = _breadcrumb_buildCrumb($crumb, $cnt, $loclass);
                } else {
                    $ret[] = '';
                }
            }
        }
        return implode($seper, $ret);
    } else {
        return _breadcrumb_buildCrumb($crumbs, $cnt, $loclass);
    }
}
Beispiel #2
0
function _breadcrumb_buildTrail($crumbs, $len = -1, $cnt = -1, $showLinks = true)
{
    global $structure, $structure_path, $prefs, $info;
    $seper = ' ' . htmlentities($prefs['site_crumb_seper'], ENT_QUOTES, "UTF-8") . ' ';
    switch ($prefs['feature_sitetitle']) {
        case 'y':
            $loclass = "pagetitle";
            $hiclass = "pagetitle";
            break;
        case 'title':
            $loclass = "crumblink";
            $hiclass = "pagetitle";
            break;
        case 'n':
        default:
            $loclass = "crumblink";
            $hiclass = "crumblink";
            break;
    }
    if ($prefs['feature_breadcrumbs'] == 'n') {
        $loclass = "crumblink";
        $hiclass = "pagetitle";
    }
    if ($len == -1) {
        $len = count($crumbs);
    }
    if (_is_assoc($crumbs)) {
        return false;
    }
    if (is_array($crumbs)) {
        $ret = array();
        if ($structure == 'y' && $info) {
            $cnt += 1;
            $ret = breadcrumb_buildStructureTrail($structure_path, $cnt, $loclass, $showLinks);
            // prepend the root crumb
            array_unshift($ret, _breadcrumb_buildCrumb($crumbs[$cnt], $cnt, $loclass, $showLinks));
            if (count($crumbs) > 1) {
                $ret[] = _breadcrumb_buildCrumb($crumbs[count($crumbs) - 1], count($ret) - 1, $loclass, $showLinks);
            }
        } else {
            foreach ($crumbs as $crumb) {
                $cnt += 1;
                $ret[] = _breadcrumb_buildCrumb($crumb, $cnt, $loclass, $showLinks);
            }
        }
        $ret = array_filter($ret);
        return implode($seper, $ret);
    } else {
        return _breadcrumb_buildCrumb($crumbs, $cnt, $loclass, $showLinks);
    }
}