#NEWLINE# def zsettings( request ) : #NEWLINE# #INDENT# '\n    Adds zorna context variables to the context.\n\n    ' #NEWLINE# try : #NEWLINE# #INDENT# reg = SiteRegistration . objects . get ( site = Site . objects . get_current ( ) ) #NEWLINE# allow_registration = reg . allow_registration #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# allow_registration = False #NEWLINE# #UNINDENT# media_plugin_url = settings . MEDIA_PLUGIN_URL #NEWLINE# if request . user . is_anonymous ( ) : #NEWLINE# #INDENT# usergroups = [ ] #NEWLINE# calendar = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# usergroups = [ str ( g . pk ) for g in request . user . get_profile ( ) . groups . all ( ) ] #NEWLINE# calendar = get_personal_calendar ( request . user ) #NEWLINE# #UNINDENT# return { #NEWLINE# #INDENT# 'CKEDITOR_MEDIA_PREFIX' : settings . CKEDITOR_MEDIA_PREFIX , #NEWLINE# 'ZORNA_SKIN' : settings . ZORNA_SKIN , #NEWLINE# 'ZORNA_REGISTRATION' : allow_registration , #NEWLINE# 'MEDIA_PLUGIN_URL' : media_plugin_url , #NEWLINE# 'ZORNA_USER_GROUPS' : usergroups , #NEWLINE# 'ZORNA_USER_CALENDAR' : calendar , #NEWLINE# #UNINDENT# }