## Script (Python) "get_translation" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=table, items, catID, entry, language ##title= ## # list_table_items.py: #from Products.PythonScripts.standard import html_quote #request = container.REQUEST #RESPONSE = request.RESPONSE #from Products.CMFCore.utils import getToolByName #translation_service = getToolByName(context, 'translation_service') #msg = translation_service.utranslate(domain='PloneXL8', #msgid='You have taken ownership of this translation.', #default='You have taken ownership of this translation.', #context=context) #msg = msg.encode('utf-8') #print msg #return printed debug = False if debug: print table, items, catID, entry #table = "category" #items = "commands" a = context.portal_membership.getAuthenticatedMember() if str(a) !="Anonymous User": member = True else: member = False if member: edit_topic = 'edit_translation?ID=%s&entry=%s&table=%s&catID=%s&language=%s&OXD=%s' %("0", entry, items, catID, language, '0' ) newentry = "Create New Entry" %(edit_topic) print newentry ID = "NotAssigned" if catID == '0': sqlQ = """ SELECT * FROM %s WHERE %s Like ''; """ %("translation", language) rs = context.sql(Qstring=sqlQ) else: try: ID = int(catID) IDA = ID sqlQ = "SELECT * from %s WHERE %sID=%s" %(items, table, ID) rs = context.sql(Qstring=sqlQ) except: sqlQ = "SELECT * from %s" %(items) rs = context.sql(Qstring=sqlQ) ID = None entry = "All" if debug: print ID, sqlQ #return printed if entry == '0': display = "Not Assigned" else: display = entry #This block switches on the summary view of primary IDs. Not useful if it's only numbers! print '
' %(items, display) print '
%s | ' %(ID, entry, items, language, display_id, display_id,) if i == 4: print '
%s%s | |||
English | %s | Modified By | Modified On |
%s | %s | %s | %s |