Exemplo n.º 1
0
function printnode($nodeid, $text, $depth = 0, $delete_ok = false)
{
    global $Language;
    $purifier = Codendi_HTMLPurifier::instance();
    // print current node, then all subnodes
    print '<BR>';
    for ($i = 0; $i < $depth; $i++) {
        print "&nbsp; &nbsp; ";
    }
    html_image('ic/cfolder15.png', array());
    print '&nbsp; ' . $purifier->purify($text) . " ";
    if ($nodeid != 0) {
        print '&nbsp; <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> ';
    }
    if ($delete_ok) {
        print '&nbsp; <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> ';
    }
    if ($nodeid != 0) {
        print '&nbsp;' . help_button('trove_cat', $nodeid) . "\n";
    }
    $res_child = db_query("SELECT trove_cat_id,fullname,parent FROM trove_cat " . "WHERE parent='" . db_ei($nodeid) . "' ORDER BY fullpath");
    while ($row_child = db_fetch_array($res_child)) {
        $delete_ok = $row_child["parent"] != 0;
        printnode($row_child["trove_cat_id"], $row_child["fullname"], $depth + 1, $delete_ok);
    }
}
Exemplo n.º 2
0
function printnode($nodeid, $text, $delete_ok = false)
{
    global $Language;
    // print current node, then all subnodes
    print '<BR>';
    for ($i = 0; $i < $GLOBALS['depth']; $i++) {
        print "&nbsp; &nbsp; ";
    }
    html_image('ic/cfolder15.png', array());
    print '&nbsp; ' . $text . " ";
    if ($nodeid != 0) {
        print '&nbsp; <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> ';
    }
    if ($delete_ok) {
        print '&nbsp; <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> ';
    }
    if ($nodeid != 0) {
        print '&nbsp;' . help_button('trove_cat', $nodeid) . "\n";
    }
    $GLOBALS["depth"]++;
    $res_child = db_query("SELECT trove_cat_id,fullname,parent FROM trove_cat " . "WHERE parent='{$nodeid}' ORDER BY fullpath");
    while ($row_child = db_fetch_array($res_child)) {
        $delete_ok = $row_child["parent"] != 0;
        printnode($row_child["trove_cat_id"], $row_child["fullname"], $delete_ok);
    }
    $GLOBALS["depth"]--;
}
Exemplo n.º 3
0
function printnode($nodeid, $text)
{
    // print current node, then all subnodes
    print '<BR>';
    for ($i = 0; $i < $GLOBALS[depth]; $i++) {
        print "&nbsp; &nbsp; ";
    }
    print html_image('images/ic/cfolder15.png', '15', '13', array());
    print '&nbsp; ' . $text . " ";
    print '<A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[Edit]</A> ';
    print help_button('trove_cat', $nodeid) . "\n";
    $GLOBALS["depth"]++;
    $res_child = db_query("SELECT trove_cat_id,fullname FROM trove_cat " . "WHERE parent='{$nodeid}'");
    while ($row_child = db_fetch_array($res_child)) {
        printnode($row_child["trove_cat_id"], $row_child["fullname"]);
    }
    $GLOBALS["depth"]--;
}
Exemplo n.º 4
0
function printnode($nodeid, $text)
{
    global $Language;
    print '<br />';
    for ($i = 0; $i < $GLOBALS[depth]; $i++) {
        print "&nbsp; &nbsp; ";
    }
    print html_image('ic/cfolder15.png', '15', '13', array());
    print '&nbsp; ' . $text . " ";
    print url_make_link("trove_cat_add.php?parent_trove_cat_id='.{$nodeid}.'", "[" . _('Add') . "]");
    if ($nodeid != 0) {
        print url_make_link("trove_cat_edit.php?parent_trove_cat_id='.{$nodeid}.'", "[" . _('Edit') . "]");
        print help_button('trove_cat', $nodeid) . "\n";
    }
    $GLOBALS['depth']++;
    $res_child = db_query("\n\t\tSELECT trove_cat_id,fullname FROM trove_cat \n\t\tWHERE parent='{$nodeid}'\n\t\tAND trove_cat_id!=0;\n\t");
    while ($row_child = db_fetch_array($res_child)) {
        printnode($row_child["trove_cat_id"], $row_child["fullname"]);
    }
    $GLOBALS["depth"]--;
}