コード例 #1
0
ファイル: Blog.py プロジェクト: cc-archive/zope_products
 def manage_afterAdd(self, item, container):
     BaseFolder.manage_afterAdd(self, item, container)
     if self.simpleblog_tool.getCreatePortletOnBlogCreation():
         if not hasattr(item.aq_base, 'right_slots'):
             item._setProperty('right_slots', ['here/portlet_simpleblog/macros/portletBlogFull_local'], 'lines')
         if not hasattr(item.aq_base, 'column_two_portlets'):
             item._setProperty('column_two_portlets', ['here/portlet_simpleblog/macros/portletBlogFull_local'], 'lines')
コード例 #2
0
ファイル: blog.py プロジェクト: kroman0/products
    def initializeArchetype(self, **kwargs):
        BaseFolder.initializeArchetype(self, **kwargs)
        RPCAuth = self.simpleblog_tool.findRPCAuth(self)

        self.metaWeblog = MetaWeblogAPI.MetaWeblogAPI().__of__(self)
        self.metaWeblog.setupRPCAuth(RPCAuth)
        self.blogger = BloggerAPI.BloggerAPI().__of__(self)
        self.blogger.setupRPCAuth(RPCAuth)
        self.mt = MovableTypeAPI.MovableTypeAPI().__of__(self)
        self.mt.setupRPCAuth(RPCAuth)    
コード例 #3
0
ファイル: kit.py プロジェクト: rockfruit/bika.sanbi
    def delARAttachment(self):
        """ delete the attachment """
        tool = getToolByName(self, "reference_catalog")
        if 'Attachment' in self.request.form:
            attachment_uid = self.request.form['Attachment']
            attachment = tool.lookupObject(attachment_uid)

        others = self.context.getAttachment()
        attachments = []
        for other in others:
            if not other.UID() == attachment_uid:
                attachments.append(other.UID())
        self.context.setAttachment(attachments)
        kits = attachment.aq_parent
        ids = [attachment.getId(), ]
        BaseFolder.manage_delObjects(kits, ids, self.request)

        # self.request.RESPONSE.redirect(self.context.absolute_url())
        self.request.RESPONSE.redirect(
            self.request.REQUEST.get_header('referer'))
コード例 #4
0
    def delARAttachment(self):
        """ delete the attachment """
        tool = getToolByName(self, "reference_catalog")
        if 'Attachment' in self.request.form:
            attachment_uid = self.request.form['Attachment']
            attachment = tool.lookupObject(attachment_uid)

        others = self.context.getAttachment()
        attachments = []
        for other in others:
            if not other.UID() == attachment_uid:
                attachments.append(other.UID())
        self.context.setAttachment(attachments)
        kits = attachment.aq_parent
        ids = [
            attachment.getId(),
        ]
        BaseFolder.manage_delObjects(kits, ids, self.request)

        # self.request.RESPONSE.redirect(self.context.absolute_url())
        self.request.RESPONSE.redirect(
            self.request.REQUEST.get_header('referer'))
コード例 #5
0
 def __init__(self, oid, **kwargs):
     """Setup the archive folderish object, turn off discussion"""
     BaseFolder.__init__(self, oid, **kwargs)
     self.schema["allowDiscussion"].default = 0
コード例 #6
0
 def __init__(self, oid, **kwargs):
     """Setup the archive folderish object, turn off discussion"""
     BaseFolder.__init__(self, oid, **kwargs)
     self.schema['allowDiscussion'].default = 0