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')
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)
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'))
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'))
def __init__(self, oid, **kwargs): """Setup the archive folderish object, turn off discussion""" BaseFolder.__init__(self, oid, **kwargs) self.schema["allowDiscussion"].default = 0
def __init__(self, oid, **kwargs): """Setup the archive folderish object, turn off discussion""" BaseFolder.__init__(self, oid, **kwargs) self.schema['allowDiscussion'].default = 0