# -*- coding: utf-8 # Copyright 2005 by Meelis Mets from Products.Archetypes.public import BaseSchema, Schema from Products.Archetypes.public import StringField, LinesField, TextField from Products.Archetypes.public import LinesWidget, TextAreaWidget, IdWidget, StringWidget, SelectionWidget, MultiSelectionWidget from Products.Archetypes.public import BaseFolder, BaseContent, registerType from Globals import InitializeClass from Products.CMFCore.utils import getToolByName from BaseFunctions import BaseFunctions from Permissions import * from AccessControl import ClassSecurityInfo, Unauthorized from config import PROJECT_NAME schema = BaseSchema + Schema(( )) class Gallery(BaseFolder, BaseFunctions): """ Gallery """ meta_type = "Gallery" archetype_name = "Gallery" global_allow = 1 allowed_content_types = ('Image',) security = ClassSecurityInfo() content_icon='gradebook_icon.gif' schema = schema actions = ( { 'id':'view', 'name':'View', 'action':'string:${object_url}/atct_album_view', 'permissions': ('View',), }, ) def manage_afterAdd(self,item,container): """sets permissions""" self.manage_permission('Add portal content', ('Manager','Teacher','Member') ,1) def deleteObject(self, REQUEST): """ delete object """ id = REQUEST.get("id") self._delObject(id) return REQUEST.RESPONSE.redirect(self.absolute_url()+'/linkcollector_view') registerType(Gallery, PROJECT_NAME)