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 " "; } html_image('ic/cfolder15.png', array()); print ' ' . $purifier->purify($text) . " "; if ($nodeid != 0) { print ' <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> '; } if ($delete_ok) { print ' <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> '; } if ($nodeid != 0) { print ' ' . 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); } }
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 " "; } html_image('ic/cfolder15.png', array()); print ' ' . $text . " "; if ($nodeid != 0) { print ' <A href="trove_cat_edit.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'edit') . ']</A> '; } if ($delete_ok) { print ' <A href="trove_cat_delete.php?trove_cat_id=' . $nodeid . '">[' . $Language->getText('admin_trove_cat_list', 'delete') . ']</A> '; } if ($nodeid != 0) { print ' ' . 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"]--; }
function printnode($nodeid, $text) { // print current node, then all subnodes print '<BR>'; for ($i = 0; $i < $GLOBALS[depth]; $i++) { print " "; } print html_image('images/ic/cfolder15.png', '15', '13', array()); print ' ' . $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"]--; }
function printnode($nodeid, $text) { global $Language; print '<br />'; for ($i = 0; $i < $GLOBALS[depth]; $i++) { print " "; } print html_image('ic/cfolder15.png', '15', '13', array()); print ' ' . $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"]--; }