Пример #1
0
function list_folder($ftp, $dir = '')
{
    echo "listing folder {$dir}\n";
    $records = ftp_rawlist($ftp, $dir);
    if (!$records) {
        return;
    }
    $arr = null;
    foreach ($records as $record) {
        if (!preg_match('/([d-])[rwx-]{9}.*\\s([^\\s]+)$/', $record, $arr)) {
            continue;
        }
        $isDir = $arr[1] == 'd';
        $recordName = $arr[2];
        if ($isDir) {
            if ($recordName == '.' || $recordName == '..') {
                continue;
            }
            list_folder($ftp, "{$dir}/{$recordName}");
            continue;
        }
        write_csv_line($recordName, "{$dir}/{$recordName}");
    }
}
Пример #2
0
function list_folder($folder_owner)
{
    global $active_folder, $exp_folders, $group_query, $level, $separator_counter, $xoopsDB, $xoopsUser;
    $bg_color = "";
    $bg_image = "images/line.png";
    $user_id = $xoopsUser->getVar('uid');
    // Set up display offsets
    $index = 0;
    while ($index < $level) {
        $level_offset .= "&nbsp;&nbsp;&nbsp;";
        $index++;
    }
    // If the user is an administrator, ignore the permissions entirely.
    if ($xoopsUser->isAdmin()) {
        $query = "SELECT * FROM " . $xoopsDB->prefix("dms_objects") . " ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= "ORDER BY obj_type DESC, obj_name";
    } else {
        $query = "SELECT obj_id, " . $xoopsDB->prefix("dms_objects") . ".ptr_obj_id, obj_type, obj_name, ";
        $query .= "obj_status, obj_owner, obj_checked_out_user_id, lifecycle_id, ";
        $query .= "user_id, group_id, user_perms, group_perms, everyone_perms ";
        $query .= "FROM " . $xoopsDB->prefix("dms_object_perms") . " ";
        $query .= "INNER JOIN " . $xoopsDB->prefix("dms_objects") . " ON ";
        $query .= $xoopsDB->prefix("dms_object_perms") . ".ptr_obj_id = obj_id ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= " AND (";
        $query .= "    everyone_perms !='0'";
        $query .= $group_query;
        $query .= " OR user_id='" . $user_id . "'";
        $query .= ")";
        $query .= " AND (obj_status !='2') ";
        $query .= "GROUP BY obj_id ";
        $query .= "ORDER BY obj_type DESC, obj_name";
        //print $query;
        //exit(0);
    }
    //  $result = mysql_query($query) or die(mysql_error());
    $result = $xoopsDB->query($query);
    $num_rows = $xoopsDB->getRowsNum($result);
    if ($num_rows > 0) {
        while ($result_data = mysql_fetch_array($result)) {
            $separator_counter++;
            if ($separator_counter > SEPARATOR_LIMIT) {
                print "  <tr>\r";
                print "  <td height='1' background='" . $bg_image . "' nowrap></td>\r";
                print "  <td background='" . $bg_image . "' nowrap></td>\r";
                print "  <td background='" . $bg_image . "' nowrap></td>\r";
                print "  <td background='" . $bg_image . "' nowrap></td>\r";
                print "  <td background='" . $bg_image . "' nowrap></td>\r";
                print "  <td background='" . $bg_image . "' nowrap></td>\r";
                print "  </tr>\r";
                $separator_counter = 1;
            }
            if ($xoopsUser->isAdmin()) {
                $perm = OWNER;
            } else {
                $perm = perms_level($result_data['obj_id']);
            }
            // If folder is active, then set it to the active background color
            if ($active_folder != 0 && ($result_data['obj_id'] == $active_folder || $folder_owner == $active_folder) && $perm > BROWSE) {
                $class = "class='cSubHeader'";
            } else {
                $class = "";
            }
            printf("  <tr>\r");
            // If this object is a folder, examine it....otherwise, display the file and move on.
            if ($result_data['obj_type'] == FOLDER || $result_data['obj_type'] == INBOXEMPTY || $result_data['obj_type'] == INBOXFULL) {
                $index = 0;
                $exp_flag = 0;
                // Is folder expanded?
                while ($exp_folders[$index] != -1) {
                    if ($exp_folders[$index] == $result_data['obj_id']) {
                        $exp_flag = 1;
                    }
                    $index++;
                }
                // Display standard folders
                if ($result_data['obj_type'] == FOLDER) {
                    if ($exp_flag == 1 && $perm > BROWSE) {
                        if ($result_data['obj_status'] == DELETED) {
                            printf("    <td %s align='left'>%s<a href='folder_contract.php?folder_id=%s'><img src='images/folder_del_open.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                        } else {
                            printf("    <td %s align='left'>%s<a href='folder_contract.php?folder_id=%s'><img src='images/folder_open.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                        }
                    } else {
                        if ($perm > BROWSE) {
                            if ($result_data['obj_status'] == DELETED) {
                                printf("    <td %s align='left'>%s<a href='folder_expand.php?folder_id=%s'><img src='images/folder_del_closed.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                            } else {
                                printf("    <td %s align='left'>%s<a href='folder_expand.php?folder_id=%s'><img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                            }
                        } else {
                            if ($result_data['obj_status'] == DELETED) {
                                printf("    <td %s align='left'>%s<img src='images/folder_del_closed.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                            } else {
                                printf("    <td %s align='left'>%s<img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                            }
                        }
                    }
                }
                // Display empty inbox folders
                if ($result_data['obj_type'] == INBOXEMPTY) {
                    if ($exp_flag == 1 && $perm > BROWSE) {
                        printf("    <td %s align='left'>%s<a href='folder_contract.php?folder_id=%s'><img src='images/inbox_empty.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                    } else {
                        if ($perm > BROWSE) {
                            printf("    <td %s align='left'>%s<a href='folder_expand.php?folder_id=%s'><img src='images/inbox_empty.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                        } else {
                            printf("    <td %s align='left'>%s<img src='images/inbox_empty.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                        }
                    }
                }
                // Display full inbox folders
                if ($result_data['obj_type'] == INBOXFULL) {
                    if ($exp_flag == 1 && $perm > BROWSE) {
                        printf("    <td %s align='left'>%s<a href='folder_contract.php?folder_id=%s'><img src='images/inbox_full.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                    } else {
                        if ($perm > BROWSE) {
                            printf("    <td %s align='left'>%s<a href='folder_expand.php?folder_id=%s'><img src='images/inbox_full.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset, $result_data['obj_id']);
                        } else {
                            printf("    <td %s align='left'>%s<img src='images/inbox_full.png'></a>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                        }
                    }
                }
                // If folder is not active, display the name and link to make it active, otherwise just display the name.
                if ($result_data['obj_id'] == $active_folder || $perm == BROWSE) {
                    printf("    %s</td>\r", $result_data['obj_name']);
                } else {
                    printf("    <a href='folder_expand.php?folder_id=%d'>%s</a></td>\r", $result_data['obj_id'], $result_data['obj_name']);
                }
                printf("    <td></td>\r");
                printf("    <td></td>\r");
                // Checkin/Checkout (not used for a folder)
                if ($result_data['obj_status'] == DELETED) {
                    printf("    <td align=center><a href='folder_restore.php?folder_id=%s'>Restore</a></td>\r", $result_data['obj_id']);
                    // Restore
                } else {
                    printf("    <td></td>\r");
                }
                if ($perm >= EDIT && ($xoopsUser->isAdmin() || $result_data['obj_owner'] != 0)) {
                    printf("    <td align='center'><a href='folder_options.php?obj_id=%s'>Options</a></td>\r", $result_data['obj_id']);
                } else {
                    print "    <td></td>\r";
                }
                printf("    <td></td>\r");
                // Status
                printf("    <td></td>\r  </tr>\r");
                if ($exp_flag == 1 && $perm > BROWSE) {
                    $level++;
                    list_folder($result_data['obj_id']);
                    $level--;
                }
            } else {
                // Object is a file or link
                // Check if the object is a file or link
                if ($result_data['obj_type'] != DOCLINK) {
                    // Object is a file
                    printf("    <td %s align='left'>%s<img src='images/file_text.png'>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                    if ($perm > BROWSE) {
                        printf("<a href='#' onclick='javascript:void(window.open(\"file_view.php?file_id=%s\"))'>%s</a></td>\r", $result_data['obj_id'], $result_data['obj_name']);
                    } else {
                        print $result_data['obj_name'];
                    }
                    printf("    <td></td>\r");
                    // Checkin/Checkout
                    switch ($result_data['obj_status']) {
                        case NORMAL:
                            if ($perm >= EDIT) {
                                printf("    <td align=center><a href='file_checkout.php?file_id=%s'>Edit</a></td>\r", $result_data['obj_id']);
                            } else {
                                print "    <td></td>\r";
                            }
                            break;
                        case CHECKEDOUT:
                            if ($user_id == $result_data['obj_checked_out_user_id'] && $perm >= EDIT) {
                                printf("    <td align=center><a href='file_checkin.php?file_id=%s'>Check-in</a></td>\r", $result_data['obj_id']);
                            } else {
                                printf("    <td></td>\r");
                            }
                            break;
                        default:
                            printf("    <td></td>\r");
                    }
                    switch ($result_data['obj_status']) {
                        case NORMAL:
                            if ($perm >= READONLY && $result_data['lifecycle_id'] == 0) {
                                printf("    <td align=center><a href='file_route.php?file_id=%s'>Route</a></td>\r", $result_data['obj_id']);
                            } else {
                                if ($result_data['lifecycle_id'] != 0) {
                                    print "    <td align=center><a href='lifecycle_promote.php?file_id=" . $result_data['obj_id'] . "'>Promote</a></td>\r";
                                } else {
                                    print "    <td></td>\r";
                                }
                            }
                            break;
                        case DELETED:
                            printf("    <td align=center><a href='file_restore.php?file_id=%s'>Restore</a></td>\r", $result_data['obj_id']);
                            // Restore
                            break;
                        default:
                            printf("    <td></td>\r");
                    }
                    if ($perm >= EDIT) {
                        printf("    <td align=center><a href='file_options.php?obj_id=%s'>Options</a></td>\r", $result_data['obj_id']);
                    } else {
                        printf("    <td></td>\r");
                    }
                    switch ($result_data['obj_status']) {
                        case NORMAL:
                            printf("    <td align=center><img src='images/file_unlocked.png'></td>\r");
                            break;
                        case CHECKEDOUT:
                            printf("    <td align=center><img src='images/file_locked.png'></td>\r");
                            break;
                        default:
                            printf("    <td></td>\r");
                    }
                } else {
                    // Object is a link
                    $link_query = "SELECT obj_id,obj_name,obj_status,current_version_row_id,obj_checked_out_user_id ";
                    $link_query .= "from " . $xoopsDB->prefix('dms_objects') . " ";
                    $link_query .= "WHERE obj_id='" . $result_data['ptr_obj_id'] . "'";
                    $link_result = mysql_fetch_object(mysql_query($link_query));
                    if ($xoopsUser->isAdmin()) {
                        $perm = OWNER;
                    } else {
                        $perm = perms_level($result_data['ptr_obj_id']);
                    }
                    printf("    <td %s align='left'>%s<img src='images/file_link.png'>&nbsp;&nbsp;&nbsp;\r", $class, $level_offset);
                    if ($perm > BROWSE) {
                        printf("<a href='#' onclick='javascript:void(window.open(\"file_view.php?file_id=%s\"))'>%s</a></td>\r", $link_result->obj_id, $link_result->obj_name);
                    } else {
                        print $link_result->obj_name . "</td>\r";
                    }
                    printf("    <td></td>\r");
                    // Checkin/Checkout
                    switch ($link_result->obj_status) {
                        case NORMAL:
                            if ($perm >= EDIT) {
                                printf("    <td align=center><a href='file_checkout.php?file_id=%s'>Edit</a></td>\r", $link_result->obj_id);
                            } else {
                                print "    <td></td>\r";
                            }
                            break;
                        case CHECKEDOUT:
                            if ($user_id == $link_result->obj_checked_out_user_id && $perm >= EDIT) {
                                printf("    <td align=center><a href='file_checkin.php?file_id=%s'>Check-in</a></td>\r", $link_result->obj_id);
                            } else {
                                printf("    <td></td>\r");
                            }
                            break;
                        default:
                            printf("    <td></td>\r");
                    }
                    printf("    <td></td>\r");
                    printf("    <td align=center><a href='link_options.php?obj_id=%s'>Options</a></td>\r", $result_data['obj_id']);
                    // Properties
                    switch ($link_result->obj_status) {
                        case NORMAL:
                            printf("    <td align=center><img src='images/file_unlocked.png'></td>\r");
                            break;
                        case CHECKEDOUT:
                            printf("    <td align=center><img src='images/file_locked.png'></td>\r");
                            break;
                        default:
                            printf("    <td></td>\r");
                    }
                }
                printf("    <td></td>\r  </tr>\r");
            }
        }
    } else {
        // If folder is active, then set it to the active background color
        if ($active_folder != 0 && $folder_owner == $active_folder) {
            $class = "class='cSubHeader'";
        } else {
            $class = "";
        }
        printf("  <tr><td %s><center>Empty</center></td><td colspan='5'></td></tr>\r", $class);
    }
}
Пример #3
0
function list_folder($folder_owner)
{
    global $active_folder, $exp_folders, $group_query, $level, $location, $xoopsDB, $xoopsUser;
    $bg_color = "";
    $user_id = $xoopsUser->getVar('uid');
    // Set up display offsets
    $index = 0;
    while ($index < $level) {
        $level_offset .= "&nbsp;&nbsp;&nbsp;";
        $index++;
    }
    // If the user is an administrator, ignore the permissions entirely.
    if ($xoopsUser->isAdmin()) {
        $query = "SELECT * FROM " . $xoopsDB->prefix("dms_objects") . " ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= "ORDER BY obj_type DESC, obj_name";
    } else {
        $query = "SELECT obj_id, " . $xoopsDB->prefix("dms_objects") . ".ptr_obj_id, obj_type, obj_name, ";
        $query .= "obj_status, obj_owner, obj_checked_out_user_id, lifecycle_id, ";
        $query .= "user_id, group_id, user_perms, group_perms, everyone_perms ";
        $query .= "FROM " . $xoopsDB->prefix("dms_object_perms") . " ";
        $query .= "INNER JOIN " . $xoopsDB->prefix("dms_objects") . " ON ";
        $query .= $xoopsDB->prefix("dms_object_perms") . ".ptr_obj_id = obj_id ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= " AND (";
        $query .= "    everyone_perms !='0'";
        $query .= $group_query;
        $query .= " OR user_id='" . $user_id . "'";
        $query .= ")";
        $query .= " AND (obj_status !='2') ";
        $query .= "GROUP BY obj_id ";
        $query .= "ORDER BY obj_type DESC, obj_name";
        //print $query;
        //exit(0);
    }
    //  $result = mysql_query($query) or die(mysql_error());
    $result = $xoopsDB->query($query);
    $num_rows = $xoopsDB->getRowsNum($result);
    if ($num_rows > 0) {
        while ($result_data = mysql_fetch_array($result)) {
            if ($xoopsUser->isAdmin()) {
                $perm = OWNER;
            } else {
                $perm = perms_level($result_data['obj_id']);
            }
            // Set class to nothing.
            $class = "";
            print "  <tr>\r";
            // If this object is a folder, examine it....otherwise, display the file and move on.
            if ($result_data['obj_type'] == FOLDER) {
                $index = 0;
                $exp_flag = 0;
                // Is folder expanded?
                while ($exp_folders[$index] != -1) {
                    if ($exp_folders[$index] == $result_data['obj_id']) {
                        $exp_flag = 1;
                    }
                    $index++;
                }
                if ($exp_flag == 1 && $perm > BROWSE) {
                    if ($result_data['obj_status'] == DELETED) {
                        print "    <td align='left'>" . $level_offset . "<a href='folder_contract.php?ret_location=" . $location . "&folder_id=" . $result_data['obj_id'] . "&file_id=-1&active=FALSE'><img src='images/folder_del_open.png'></a>&nbsp;&nbsp;&nbsp;\r";
                    } else {
                        print "    <td align='left'>" . $level_offset . "<a href='folder_contract.php?ret_location=" . $location . "&folder_id=" . $result_data['obj_id'] . "&file_id=-1&active=FALSE'><img src='images/folder_open.png'></a>&nbsp;&nbsp;&nbsp;\r";
                    }
                } else {
                    if ($perm > BROWSE) {
                        if ($result_data['obj_status'] == DELETED) {
                            print "    <td align='left'>" . $level_offset . "<a href='folder_expand.php?ret_location=" . $location . "&folder_id=" . $result_data['obj_id'] . "&file_id=-1&active=FALSE'><img src='images/folder_del_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        } else {
                            print "    <td align='left'>" . $level_offset . "<a href='folder_expand.php?ret_location=" . $location . "&folder_id=" . $result_data['obj_id'] . "&file_id=-1&active=FALSE'><img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        }
                    } else {
                        if ($result_data['obj_status'] == DELETED) {
                            print "    <td align='left'>" . $level_offset . "<img src='images/folder_del_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        } else {
                            print "    <td align='left'>" . $level_offset . "<img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        }
                    }
                }
                // If folder is not active, display the name and link to make it active, otherwise just display the name.
                if ($result_data['obj_id'] == $active_folder || $perm == BROWSE) {
                    printf("    %s</td>\r", $result_data['obj_name']);
                } else {
                    print "    <a href='folder_expand.php?ret_location=" . $location . "&folder_id=" . $result_data['obj_id'] . "&file_id=-1&active=FALSE'>" . $result_data['obj_name'] . "</a></td>\r";
                }
                printf("    <td></td>\r  </tr>\r");
                if ($exp_flag == 1 && $perm > BROWSE) {
                    $level++;
                    list_folder($result_data['obj_id']);
                    $level--;
                }
            } else {
                // Object is a file or link
                // Check if the object is a file or link
                if ($result_data['obj_type'] == FILE) {
                    // Object is a file
                    print "    <td align='left'><input type='radio' name='rad_file_id' value='" . $result_data['obj_id'] . "'>";
                    print $level_offset . "<img src='images/file_text.png'>&nbsp;&nbsp;&nbsp;\r";
                    if ($perm > BROWSE) {
                        print $result_data['obj_name'] . "</td>\r";
                    }
                }
                printf("    <td></td>\r  </tr>\r");
            }
        }
    } else {
        print "  <tr><td>" . $level_offset . "Empty</td><td colspan='5'></td></tr>\r";
    }
}
Пример #4
0
function list_folder($folder_owner)
{
    global $active_folder, $exp_folders, $file_id, $group_query, $level, $lifecycle_stage, $lifecycle_stage_result, $location, $xoopsDB, $xoopsUser;
    $bg_color = "";
    $user_id = $xoopsUser->getVar('uid');
    // Set up display offsets
    $index = 0;
    while ($index < $level) {
        $level_offset .= "&nbsp;&nbsp;&nbsp;";
        $index++;
    }
    // If the user is an administrator, ignore the permissions entirely.
    if ($xoopsUser->isAdmin()) {
        $query = "SELECT * FROM " . $xoopsDB->prefix("dms_objects") . " ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= "ORDER BY obj_type DESC, obj_name";
    } else {
        $query = "SELECT obj_id, " . $xoopsDB->prefix("dms_objects") . ".ptr_obj_id, obj_type, obj_name, obj_status, obj_owner, obj_checked_out_user_id, ";
        $query .= "user_id, group_id, user_perms, group_perms, everyone_perms ";
        $query .= "FROM " . $xoopsDB->prefix("dms_object_perms") . " ";
        $query .= "INNER JOIN " . $xoopsDB->prefix("dms_objects") . " ON ";
        $query .= $xoopsDB->prefix("dms_object_perms") . ".ptr_obj_id = obj_id ";
        $query .= "WHERE (obj_owner='" . $folder_owner . "') ";
        $query .= " AND (";
        $query .= "    everyone_perms !='0'";
        $query .= $group_query;
        $query .= " OR user_id='" . $user_id . "'";
        $query .= ")";
        $query .= " AND (obj_status !='2') ";
        $query .= "GROUP BY obj_id ";
        $query .= "ORDER BY obj_type DESC, obj_name";
    }
    //print $query;
    //exit(0);
    //  $result = mysql_query($query) or die(mysql_error());
    $result = $xoopsDB->query($query);
    $num_rows = $xoopsDB->getRowsNum($result);
    if ($num_rows > 0) {
        while ($result_data = mysql_fetch_array($result)) {
            if ($xoopsUser->isAdmin()) {
                $perm = OWNER;
            } else {
                $perm = perms_level($result_data['obj_id']);
            }
            // Set class to the active background color
            $class = "";
            // If this object is a folder, display it.
            if ($result_data['obj_type'] == FOLDER) {
                if ($result_data['obj_id'] == $lifecycle_stage_result['new_obj_location']) {
                    $radio_btn_string = " checked";
                } else {
                    $radio_btn_string = "";
                }
                print "  <tr>\r";
                $index = 0;
                $exp_flag = 0;
                // Is folder expanded?
                while ($exp_folders[$index] != -1) {
                    if ($exp_folders[$index] == $result_data['obj_id']) {
                        $exp_flag = 1;
                    }
                    $index++;
                }
                // Display standard folders
                if ($result_data['obj_type'] == FOLDER) {
                    if ($exp_flag == 1 && $perm > BROWSE) {
                        print "    <td align='left' nowrap " . $class . ">";
                        print "<input type='radio' name='rad_folder_id' value='" . $result_data['obj_id'] . "'" . $radio_btn_string . ">";
                        print $level_offset;
                        print "<a href='javascript:contract_folder(" . $result_data['obj_id'] . ");'>";
                        // contract folder
                        print "<img src='images/folder_open.png'></a>&nbsp;&nbsp;&nbsp;\r";
                    } else {
                        if ($perm > BROWSE) {
                            print "    <td align='left' nowrap " . $class . ">";
                            print "<input type='radio' name='rad_folder_id' value='" . $result_data['obj_id'] . "'" . $radio_btn_string . ">";
                            print $level_offset;
                            print "<a href='javascript:expand_folder(" . $result_data['obj_id'] . ");'>";
                            // expand folder
                            print "<img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        } else {
                            print "    <td align='left' nowrap " . $class . ">";
                            print "<input type='radio' name='rad_folder_id' value='" . $result_data['obj_id'] . "'" . $radio_btn_string . ">";
                            print $level_offset;
                            print "<img src='images/folder_closed.png'></a>&nbsp;&nbsp;&nbsp;\r";
                        }
                    }
                }
                // If folder is not active, display the name and link to make it active, otherwise just display the name.
                if ($result_data['obj_id'] == $active_folder || $perm == BROWSE) {
                    print "    " . $result_data['obj_name'] . "</td>\r";
                } else {
                    print "    <a href='javascript:expand_folder(" . $result_data['obj_id'] . ");'>";
                    // expand folder
                    print $result_data['obj_name'] . "</a></td>\r";
                }
                print "    </td>\r";
                if ($exp_flag == 1 && $perm > BROWSE) {
                    $level++;
                    list_folder($result_data['obj_id']);
                    $level--;
                }
            }
        }
    }
}