def TreeFile(db,path):
    liste=pgquery.directories_in_directory(db, 'share', path)
    text='<ul>\n'
    for n in liste:
        text=text+'<li id='+n['name']+'>'+split_api_filepath(to_api_path(n['name']))[1]+'</li>\n'
        text2=TreeFile(db,n['name'])
        text=text+text2
    text=text+'</ul>\n'
    return text
def TreeFile(db,path):
    liste=pgquery.directories_in_directory(db, 'share', path)
    text='<ul>\n'
    for n in liste:
        text=text+'<li id='+n['name']+'>'+split_api_filepath(to_api_path(n['name']))[1]+'\n'
        text2=TreeFile(db,n['name'])
        text=text+text2
    liste=pgquery.files_in_directory(db, 'share', path)
    for n in liste:
        text=text+'<li id='+path+n['name']+' data-jstree=''{"icon":"/static/file-icon.png"}''>'+split_api_filepath(to_api_path(n['name']))[1]+'</li>\n'
    text=text+'</ul>\n'
    text=text+'</li>\n'
    return text