[kupu-checkins] r43357 - in kupu/trunk/kupu/plone: . kupu_plone_layer
duncan at codespeak.net
duncan at codespeak.net
Mon May 14 12:44:45 CEST 2007
Author: duncan
Date: Mon May 14 12:44:44 2007
New Revision: 43357
Modified:
kupu/trunk/kupu/plone/exportimport.py
kupu/trunk/kupu/plone/kupu_plone_layer/sample-kupu-customisation-policy.py
kupu/trunk/kupu/plone/librarytool.py
kupu/trunk/kupu/plone/z3interfaces.py
Log:
GS support for image classes.
Modified: kupu/trunk/kupu/plone/exportimport.py
==============================================================================
--- kupu/trunk/kupu/plone/exportimport.py (original)
+++ kupu/trunk/kupu/plone/exportimport.py Mon May 14 12:44:44 2007
@@ -171,10 +171,15 @@
previewaction = kupu.getPreviewForType(portal_type)
normalaction = kupu.getNormalViewForType(portal_type)
scalefield = kupu.getScaleFieldForType(portal_type)
+ classes = kupu.getClassesForType(portal_type)
+ mediatype = kupu.getMediaForType(portal_type)
res.append(dict(portal_type=portal_type,
previewaction=previewaction,
normalaction=normalaction,
- scalefield=scalefield))
+ scalefield=scalefield,
+ classes=classes,
+ mediatype=mediatype,
+ ))
return res
security.declarePrivate('_getExportTemplate')
@@ -247,7 +252,10 @@
'preview': { KEY:'expression', DEFAULT: ''},
'normal': { DEFAULT: ''},
'scalefield': { DEFAULT: 'image' },
+ 'previewclass': { KEY: 'classes', DEFAULT: ()},
+ 'mediatype': { DEFAULT: ''},
},
+ 'previewclass': { '#text': {KEY:None}, },
'generatepreviews': {},
'globaltoolbar': { '#text': { KEY:None }, },
'toolbar':
Modified: kupu/trunk/kupu/plone/kupu_plone_layer/sample-kupu-customisation-policy.py
==============================================================================
--- kupu/trunk/kupu/plone/kupu_plone_layer/sample-kupu-customisation-policy.py (original)
+++ kupu/trunk/kupu/plone/kupu_plone_layer/sample-kupu-customisation-policy.py Mon May 14 12:44:44 2007
@@ -101,6 +101,8 @@
'expression': PREVIEW_EXPR % image,
'normal': None,
'scalefield': image.split('_',1)[0],
+ 'classes': '',
+ 'mediatype': 'image',
}
for (type, image) in tool.getPreviewable() ]
# e.g. PREVIEW=[{'portal_type': 'Image',
Modified: kupu/trunk/kupu/plone/librarytool.py
==============================================================================
--- kupu/trunk/kupu/plone/librarytool.py (original)
+++ kupu/trunk/kupu/plone/librarytool.py Mon May 14 12:44:44 2007
@@ -256,7 +256,10 @@
if normal:
normal = Expression(normal)
scalefield = a.get('scalefield', 'image')
- classes = a.get('classes', '').split('\n')
+ classes = a.get('classes', '')
+ if isinstance(classes, basestring):
+ classes = classes.split('\n')
+ classes = tuple(classes)
mediatype = a.get('mediatype', 'image')
if not portal_type:
continue
Modified: kupu/trunk/kupu/plone/z3interfaces.py
==============================================================================
--- kupu/trunk/kupu/plone/z3interfaces.py (original)
+++ kupu/trunk/kupu/plone/z3interfaces.py Mon May 14 12:44:44 2007
@@ -83,15 +83,20 @@
def getCookedLibraries(context):
"""Return a list of libraries with our own parameters included"""
- def getPreviewForType(self, portal_type):
+ def getPreviewForType(portal_type):
"""Get the preview url for a specific type"""
- def getNormalViewForType(self, portal_type):
+ def getNormalViewForType(portal_type):
"""Get the normal view url for a specific type"""
- def getScaleFieldForType(self, portal_type):
+ def getScaleFieldForType(portal_type):
"""Get the name of the field containing a scalable image"""
+ def getClassesForType(portal_type):
+ """Get a sequence of classes that may be applied"""
+
+ def getMediaForType(portal_type):
+ """Gets the media type image/flash"""
def configure_kupu(
linkbyuid, table_classnames, html_exclusions, style_whitelist, class_blacklist,
More information about the kupu-checkins
mailing list