Exemplo n.º 1
0
function html_browse($proj)
{
    if (isset($_GET['b'])) {
        html_blob($proj, $_GET['b']);
    } else {
        if (isset($_GET['t'])) {
            $tree = $_GET['t'];
        } elseif (isset($_GET['tr'])) {
            $tree = $_GET['tr'];
        } else {
            $tree = "HEAD";
        }
        html_tree($proj, $tree);
    }
}
Exemplo n.º 2
0
function html_tree($tree_array, $highlighted = null, $column_map = array())
{
    global $db;
    # images html
    $img_tree_T = "<img align='middle' src='" . IMG_SRC . "tree_dots_T.gif' alt=''>";
    $img_tree_L = "<img align='middle' src='" . IMG_SRC . "tree_dots_L.gif' alt=''>";
    $img_tree_column = "<img align='middle' src='" . IMG_SRC . "tree_dots_column.gif' alt=''>";
    $img_tree_plus = "<img align='middle' src='" . IMG_SRC . "tree_dots_plus.gif' alt=''>";
    $img_tree_plus_b = "<img align='middle' src='" . IMG_SRC . "tree_dots_plus_b.gif' alt=''>";
    $img_tree_minus = "<img align='middle' src='" . IMG_SRC . "tree_dots_minus.gif' alt=''>";
    $img_tree_minus_b = "<img align='middle' src='" . IMG_SRC . "tree_dots_minus_b.gif' alt=''>";
    $img_spacer = "<img src='" . IMG_SRC . "1px_transparent.gif' width=15 height=1 alt=''>";
    $column = $img_tree_column . $img_spacer;
    # display each child
    for ($i = 0; $i < sizeof($tree_array); $i++) {
        //echo"<tr><td valign=bottom>";
        echo $img_spacer;
        foreach ($column_map as $column_type) {
            if ($column_type == "|") {
                echo $column;
            } elseif ($column_type == " ") {
                echo $img_spacer;
            }
        }
        # if the last child record print $table_L
        # else print $table_T
        if ($i == sizeof($tree_array) - 1) {
            echo $img_tree_L;
            $column_type = array(" ");
        } else {
            echo $img_tree_T;
            $column_type = array("|");
        }
        $style = "";
        if ($tree_array[$i]['req_id'] == $highlighted) {
            $style = "style='font-weight: bold; font-size: 120%;'";
        }
        echo "<a {$style} href='requirement_detail_page.php?req_id=" . $tree_array[$i]['req_id'] . "'>" . $tree_array[$i]['req_name'] . "</a>";
        echo "<br>" . NEWLINE;
        //echo"</td></tr>". NEWLINE;
        # display this node's children
        html_tree($tree_array[$i]['children'], $highlighted, array_merge($column_map, $column_type));
    }
}
Exemplo n.º 3
0
function html_browse($proj)
{
    $str = '';
    $c = isset($_GET['c']) ? $_GET['c'] : isset($_GET['h']) ? $_GET['h'] : 'HEAD';
    $f = $_GET['f'];
    $str .= '<div class="gitbrowse">';
    $str .= html_pathlinks($proj, $c, $f);
    if (isset($_GET['b'])) {
        $str .= html_blob($proj, $_GET['b'], $f);
    } else {
        $str .= html_tree($proj, $c, $f);
    }
    $str .= '</div>';
    return $str;
}