# $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] any.shout(logger.debug,'hello') if kwargs['query']: logger.debug('kwargs query: ' + kwargs['query']) logger.debug(infra.prpt('arguments',arguments)) 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 })