示例#1
0
$guard_url = new Security_Class();
// Формирование строки хлебных крошек
if ($_SESSION["id"]["main"] == 0) {
    $breadcrumbs = "<i>Главная</i>";
} else {
    $word = $site_0;
    $breadcrumbs = "<a href='" . $word . "'>Главная</a>&nbsp;&gt; ";
    $number = count($_SESSION["id"]);
    $i = 1;
    foreach ($_SESSION["id"] as $key => $value) {
        // Получение имени хлебной крошки по id
        if ($key == "vrach") {
            $field_arr = array("sname", "fname", "mname");
            $name = $db_explorer->GetItemsFromTableById($field_arr, "users", $value);
            $crumb = $name["sname"] . " " . $name["fname"] . " " . $name["mname"];
            $word .= $db_explorer->CodeIntoPerson($value) . "/";
        } else {
            $title = $db_explorer->GetOneItemFromTableById("title", "folder", $value);
            $crumb = $guard_url->transform($title);
            $word .= $db_explorer->CodeIntoWord($value) . "/";
        }
        if ($i != $number) {
            $breadcrumbs .= "<a href='" . $word . "'>" . $crumb . "</a>&nbsp;&gt; ";
        } else {
            $breadcrumbs .= "<i>" . $crumb . "</i>";
        }
        $i++;
    }
}
echo $breadcrumbs;
unset($guard_url);