#NEWLINE# def get_folder_content( request ) : #NEWLINE# #INDENT# search_tag = request . GET . get ( 'search_tag' , '' ) #NEWLINE# search_text = request . GET . get ( 'search_text' , '' ) #NEWLINE# ppath = request . GET . get ( 'dir' , '' ) #NEWLINE# ppath = urllib . unquote ( ppath . rstrip ( '/' ) ) #NEWLINE# path = clean_path ( ppath ) #NEWLINE# if ( path != ppath ) : #NEWLINE# #INDENT# path = '' #NEWLINE# #UNINDENT# default_text = _ ( 'Recent files' ) #NEWLINE# bdelete = False #NEWLINE# if ( path == '' ) : #NEWLINE# #INDENT# files = get_home_page_files ( request , search_tag , search_text ) #NEWLINE# if ( search_tag or search_text ) : #NEWLINE# #INDENT# default_text = _ ( 'Search results' ) #NEWLINE# #UNINDENT# bmanager = False #NEWLINE# folder_item_template = 'fileman/fm_folder_item_home.html' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( buser , bmanager ) = get_user_access_to_path ( request . user , path ) #NEWLINE# if ( not buser ) : #NEWLINE# #INDENT# return HttpResponse ( '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( files , dirs ) = get_files ( request , path , search_tag , search_text ) #NEWLINE# folder_item_template = 'fileman/fm_folder_item.html' #NEWLINE# if ( dirs or files ) : #NEWLINE# #INDENT# bdelete = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# bdelete = True #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# parts = path . split ( '/' ) #NEWLINE# if ( len ( parts ) == 1 ) : #NEWLINE# #INDENT# brename = False #NEWLINE# bdelete = False #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# brename = True #NEWLINE# #UNINDENT# cdir_components = get_path_components ( path , default_text ) #NEWLINE# extra_context = { #NEWLINE# #INDENT# 'cdir_components' : cdir_components , #NEWLINE# 'files' : files , #NEWLINE# 'search_text' : search_text , #NEWLINE# 'search_tag' : search_tag , #NEWLINE# 'manager' : bmanager , #NEWLINE# 'brename' : brename , #NEWLINE# 'bdelete' : bdelete , #NEWLINE# #UNINDENT# } #NEWLINE# extra_context [ 'folder_item_template' ] = folder_item_template #NEWLINE# context = RequestContext ( request ) #NEWLINE# return render_to_response ( 'fileman/fm_folder_content.html' , extra_context , context_instance = context )