#NEWLINE# def what( self , page , args ) : #NEWLINE# #INDENT# only_existing = args . get ( 'existing' , False ) #NEWLINE# exclude_current = args . get ( 'excludecurrent' , False ) #NEWLINE# trailing_path = '' #NEWLINE# request = args . get ( 'request' , None ) #NEWLINE# if request : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# trailing_path = request . _feincms_extra_context . get ( 'extra_path' , '' ) [ 1 : ] #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# translations = dict ( ( ( t . language , t ) for t in page . available_translations ( ) ) ) #NEWLINE# translations [ page . language ] = page #NEWLINE# links = [ ] #NEWLINE# for ( key , name ) in settings . LANGUAGES : #NEWLINE# #INDENT# if ( exclude_current and ( key == page . language ) ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# if ( key in translations ) : #NEWLINE# #INDENT# links . append ( ( key , name , ( translations [ key ] . get_absolute_url ( ) + trailing_path ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not only_existing ) : #NEWLINE# #INDENT# links . append ( ( key , name , None ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return links