# -*- coding: utf-8 # $Id$ # # Copyright 2006 by IVA Team and contributors # # This file is part of IVA. # # IVA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # IVA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with IVA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ This module will be a container for images used in qt. """ __version__ = "$Revision$"[11:-2] import Globals from Globals import Persistent from OFS import Folder from AccessControl import ClassSecurityInfo from Cruft import Cruft from common import translate, perm_edit, perm_view, mkTime from TraversableWrapper import Traversable class QTImages( Folder.Folder, Persistent, Traversable, Cruft ): """ QTImages """ meta_type = 'QTImages' security = ClassSecurityInfo() def __init__(self): """ init """ self.id = 'qtimages' security.declareProtected(perm_edit, 'getImagesXML') def getImagesXML(self): """ return a xml list of images for kupu """ msg = '' for x in self.objectValues(): msg += '\n' % x.getId() msg += '%s\n' % x.absolute_url() msg += '%s\n' % x.getId() msg += '\n' msg += '%s\n' % x.get_size() msg += '%s\n' % x.height msg += '%s\n' % x.width msg += '\n' return msg security.declareProtected(perm_edit, 'kupuUploadImage') def kupuUploadImage(self, node_prop_image, node_prop_caption): """ kupu uploading image """ self.manage_addImage(node_prop_caption, node_prop_image, node_prop_caption) return "Done, close window." Globals.InitializeClass(QTImages)