# $Id$ # $URL$ logger = logging.getLogger('meresco.searchform') logger.debug("Starting logger") websiteConfig = configs['website'] #from sys import stderr def main(arguments={}, path='', *args, **kwargs): # Anton: for the moment default to english language = 'en' #path.startswith('/en/') and 'en' or 'nl' #{'nl':'Zoeken', 'en':'Search'}[language] query = arguments.get('query', [''])[0] logger.debug('query: ' + query) httpQuery = escapeHtml(query) nlPath = '/'.join(['nl'] + path.split('/')[2:]) + '?' + urlencode(arguments) enPath = '/'.join(['en'] + path.split('/')[2:]) + '?' + urlencode(arguments) drilldown='' websiteConfig.setDefaults('searchform') search = websiteConfig.get('searchButton') goback = websiteConfig.get('gobackButton') reset = websiteConfig.get('resetButton') if 'drilldown' in arguments: for value in arguments['drilldown']: drilldown += '&drilldown='+value yield backtick('searchForm.template', { 'drilldown': drilldown, 'httpQuery': httpQuery, 'search': search, 'goback': goback, 'reset': reset })