############################################################################## # # Copyright (c) 2001, 2002 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## # Zope External Editor Product by Casey Duncan from Globals import ImageFile, DTMLFile from OFS.ObjectManager import ObjectManager from OFS.FindSupport import FindSupport from ExternalEditor import ExternalEditor, EditLink # Add the icon and the edit method to the misc_ namespace misc_ = {'edit_icon': ImageFile('edit_icon.gif', globals())} # Insert the global external editor resources methods = {'externalEdit_': ExternalEditor(), 'externalEditLink_': EditLink} from runtime_patch import patch from zLOG import LOG, ERROR, DEBUG #FIXME maybe in Windows we should change / to \ ?? d='lib/python/OFS/dtml/' ## i = 'main.dtml' try: ObjectManager.manage_main = DTMLFile( patch(d+i),globals()) except: LOG('ExternalEditor', ERROR, 'Cannot automatically patch '+i+': will use default version') ObjectManager.manage_main = DTMLFile('manage_main', globals()) ## i = 'findResult.dtml' try: FindSupport.manage_findResult=DTMLFile(patch(d+i),globals(), management_view='Find') except: LOG('ExternalEditor', ERROR, 'Cannot automatically patch '+i+',: will use default version') FindSupport.manage_findResult=DTMLFile('findResult', globals(), management_view='Find')