Esempio n. 1
0
def updateBlogLayout(obj, event):
    """ Reset blog layout if modified bloggable object hasn't the blogging markup"""
    
    if not IBlogMarker.providedBy(obj):
        if obj.getLayout() == 'blog-view':
            ptypes = getToolByName(obj, 'portal_types')
            type_info = ptypes.getTypeInfo(obj.portal_type)
            obj.setLayout(type_info.default_view)
  def should_include(self):
    utils = getToolByName(self.context, 'plone_utils')
    for row in self.context.folderlistingFolderContents():
      for column in row.folderlistingFolderContents():
        for item in column.folderlistingFolderContents():
          if ICollageAlias.providedBy(item):
            item=item.get_target()
          if IBlogMarker.providedBy(item):
#            return True
            return False
    return False
Esempio n. 3
0
def initBlogLayout(obj, event):
    """ Set blog layout if bloggable object is created with the blogging markup """
    
    if IBlogMarker.providedBy(obj):
        obj.setLayout('blog-view')
Esempio n. 4
0
 def is_blog(self):
     return IBlogMarker.providedBy(self.context)