Ejemplo n.º 1
0
/**
 * handbook toc printer
 * prints an unordered html list representation of the multidimensional array.
 * $pages    the array of items to print.
 * $section  the directory name of the files.
 */
function hb_print_toc($pages, $section)
{
    global $_pages, $req_lang;
    echo '<ul>';
    foreach ($pages as $page_key => $page_value) {
        echo '<li>';
        if (is_array($page_value)) {
            echo '<a href="../' . $section . '/' . $page_key . '?' . $req_lang . '" id="id' . $page_key . '" class="tree">' . $_pages[$page_key] . '</a>';
            hb_print_toc($page_value, $section);
        } else {
            echo '<a href="../' . $section . '/' . $page_value . '?' . $req_lang . '" id="id' . $page_value . '" class="leaf">' . $_pages[$page_value] . '</a>';
        }
        echo '</li>';
    }
    echo '</ul>';
}
Ejemplo n.º 2
0
/**
 * handbook toc printer
 * prints an unordered html list representation of the multidimensional array.
 * $handbook_pages    the array of items to print.
 * $section  the directory name of the files.
 */
function hb_print_toc($handbook_pages)
{
    global $_pages;
    echo '<ul id="handbook-toc">';
    foreach ($handbook_pages as $page_key => $page_value) {
        echo '<li>';
        if (is_array($page_value)) {
            if (isset($_pages[$page_key])) {
                echo '<a href="frame_content.php?p=' . $page_key . '" id="id' . $page_key . '" class="tree">' . _AT($_pages[$page_key]['title_var']) . '</a>';
                hb_print_toc($page_value);
            }
        } else {
            if (isset($_pages[$page_value])) {
                echo '<a href="frame_content.php?p=' . $page_value . '" id="id' . $page_value . '" class="leaf">' . _AT($_pages[$page_value]['title_var']) . '</a>';
            }
        }
        echo '</li>';
    }
    echo '</ul>';
}