Exemplo n.º 1
0
        default = '/misc_/OFSP/File_icon.gif'
        icon_location = '/misc_/%s' % self.ProjectName()
        extension = filename.lower()[filename.rfind('.')+1:]
        if ICON_ASSOCIATIONS.has_key(extension):
            return '%s/%s'%(icon_location, ICON_ASSOCIATIONS[extension])
        else:
            return default

        
    
    #security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'FileManagement')

templates = ('zpt/FileManagement', 
             'zpt/deleteFileForm',
            )
addTemplates2Class(FilesContainer, templates, globals_=globals())

security = ClassSecurityInfo()
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'FileManagement')
security.apply(FilesContainer)


InitializeClass(FilesContainer)
        
        
#-------------------------------------------------------------------------------

manage_addFileForm = PTF('zpt/addFileForm', globals())

def manage_addFile(dispatcher, title, file, fileid='',
                            abstract=u'', REQUEST=None):
Exemplo n.º 2
0
                return self.tabComments(self,REQUEST,manage_tabs_message=msg)
            else:
                REQUEST['msg'] = msg
                return self.editCommentsForm(self,REQUEST)
        else:
            return msg
    
templates = ('zpt/tabComments',
             'zpt/editCommentsForm',
             'zpt/mail_newCommentToWebmaster',
             'zpt/mail_newCommentToParent',
             'zpt/mail_rejectCommentToAuthor',
             'zpt/mail_deleteCommentToAuthor',
             'zpt/mail_approveCommentToAuthor',
            )
addTemplates2Class(CommentsStorage, templates, globals_=globals())

security = ClassSecurityInfo()
security.declareProtected(VMS, 'tabComments')
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'editCommentsForm')
security.declarePrivate('mail_newCommentToWebmaster')
security.declarePrivate('mail_newCommentToParent')
security.declarePrivate('mail_rejectCommentToAuthor')
security.declarePrivate('mail_deleteCommentToAuthor')
security.declarePrivate('mail_approveCommentToAuthor')
security.apply(CommentsStorage)


import unittest
import sys
class CommentsStorageTests(unittest.TestCase):
Exemplo n.º 3
0
    management_page = 'PagesManagementHome'
    
    security.declareProtected(PERMISSION_VIEW, 'getPages')
    getPages = BaseContainer.getItems
     
    security.declareProtected(PERMISSION_MANAGE_CONTENT, 'deletePage')
    deletePage = BaseContainer.deleteItem
            
    security.declareProtected(PERMISSION_VIEW, 'countPages')
    countPages = BaseContainer.countItems
    
templates = (
    'zpt/page/PagesManagementHome',
    'zpt/page/addPageForm',
    'zpt/page/deletePageForm',)            
addTemplates2Class(PageContainer, templates, globals_=globals())
                
security = ClassSecurityInfo()
security.declareProtected(PERMISSION_MANAGE_CONTENT, 'PagesManagementHome')
security.declareProtected(PERMISSION_MANAGE_CONTENT, 'addPageForm')
security.declareProtected(PERMISSION_MANAGE_CONTENT, 'deletePageForm')
security.apply(PageContainer)
InitializeClass(PageContainer)


######################################################################
## Page 
######################################################################

manage_addPageForm = PTF('zpt/page/addPageForm', globals())
def manage_addPage(context, id, title, abstract = u'',
Exemplo n.º 4
0
    security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'deleteNewsItem')
    def deleteNewsItem(self, id, REQUEST=None):
        """ delete the newsitem object """
        assert getattr(self, id).meta_type == METATYPE_NEWSITEM
        self.manage_delObjects([id])
        
        if REQUEST is not None:
            msg = "News item deleted"
            url = self.absolute_url()+'/NewsManagement'
            self.http_redirect(url, msg=msg)
        

templates = ('zpt/NewsManagement',
             'zpt/deleteNewsItemForm',
            )
addTemplates2Class(NewsContainer, templates, globals_=globals())
setattr(NewsContainer, 'rss.xml', NewsContainer.RSS)

security = ClassSecurityInfo()
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'deleteNewsItemForm')
security.apply(NewsContainer)


InitializeClass(NewsContainer)
        
        
#-------------------------------------------------------------------------------

manage_addNewsItemForm = PTF('zpt/addNewsItemForm', globals())

def manage_suggestNewsItemId(self):
Exemplo n.º 5
0
    _properties = BaseContainer._properties + CategoriesContainer._properties
     
    security.declareProtected(PERMISSION_VIEW, 'getFAQs')
    getFAQs = CategoriesContainer.getItems
    
    security.declareProtected(PERMISSION_MANAGE_CONTENT, 'deleteFAQ')
    deleteFAQ = BaseContainer.deleteItem
            
    security.declareProtected(PERMISSION_VIEW, 'countFAQ')
    countFAQ = BaseContainer.countItems    
        
templates = ('zpt/faq/FAQManagement',
             #'zpt/faq/addPageForm',
             'zpt/faq/deleteFAQForm',
            )
addTemplates2Class(FAQContainer, templates, globals_=globals())

security = ClassSecurityInfo()
#security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'addFAQForm')
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'deleteFAQForm')
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'FAQManagement')
security.apply(FAQContainer)
InitializeClass(FAQContainer)
        
        
######################################################################
## FAQ
######################################################################
manage_addFAQForm = PTF('zpt/faq/addFAQForm', globals())
def manage_addFAQ(dispatcher, id, title,
                  abstract='', body='', publish_date=None,
Exemplo n.º 6
0
        
        for object in objects:
            publish_date = object.getPublishDate()
            if year and month:
                if publish_date.year() == year and publish_date.month() == month:
                    result.append(object)
            if year and not month:
                if publish_date.year() == year:
                    result.append(object)
        return result

        
templates = ('zpt/BlogManagement',
             'zpt/deleteBlogItemForm',
            )
addTemplates2Class(BlogContainer, templates, globals_=globals())
setattr(BlogContainer, 'rss.xml', BlogContainer.RSS)

security = ClassSecurityInfo()
security.declareProtected(MANAGE_CONTENT_PERMISSIONS, 'deleteBlogItemForm')
security.apply(BlogContainer)


InitializeClass(BlogContainer)
        
        
#-------------------------------------------------------------------------------

manage_addBlogItemForm = PTF('zpt/addBlogItemForm', globals())