Déplacement pour eggification.
[Plinn.git] / Products / Plinn / skins / generic / getCPInfoList.py
diff --git a/Products/Plinn/skins/generic/getCPInfoList.py b/Products/Plinn/skins/generic/getCPInfoList.py
new file mode 100644 (file)
index 0000000..88d5d6c
--- /dev/null
@@ -0,0 +1,19 @@
+##parameters=
+
+cp = context.getCPInfo()
+objectInfos = []
+rt = context.restrictedTraverse
+if cp is not None :
+       for path in cp[1] :
+               ob = rt(path, None)
+               icon = rt(ob.getIcon())
+               if ob :
+                       objectInfos.append({'title'             : ob.title_or_id(),
+                                                               'url'           : ob.absolute_url(),
+                                                               'icon'          : icon.absolute_url(),
+                                                               'height'        : icon.height,
+                                                               'width'         : icon.width,
+                                                               'type'          : ob.getPortalTypeName()
+                                                               }
+                                                       )
+return objectInfos
\ No newline at end of file