Exemplo n.º 1
0
def get_content_status(content):
    public_status = None
    next_status = None

    if IVersionedObject.providedBy(content):
        if content.get_public_version() is not None:
            public_status = 'published'
        elif content.get_previous_versions():
            public_status = 'closed'

        if content.get_unapproved_version() is not None:
            if content.is_approval_requested():
                next_status = "pending"
            else:
                next_status = "draft"
        elif content.get_approved_version() is not None:
            next_status = "approved"

    # XXX: define behavior for Folders
    # elif IFolder.providedBy(content):
    #     if content.is_published():
    #         status[0] = 'published'
    #     if content.is_approved():
    #         status[1] = 'approved'
    return {'status_public': public_status, 'status_next': next_status}
Exemplo n.º 2
0
 def execute(
     self, content, config, icon, priority, factory, zmi_addable, **kw):
     """Register content type.
     """
     if IVersionedObject.implementedBy(content):
         return False
     self._register_content(
         config, content, factory, ContentFactory, icon, zmi_addable)
     self._register_silva(content, priority)
     return True
Exemplo n.º 3
0
 def available(self):
     return (not IVersionedObject.providedBy(self.context) and
             super(NonVersionedContentMetadataForm, self).available())