Back to index

plone3  3.1.7
getActionIconList.py
Go to the documentation of this file.
00001 ## Script (Python) "getActionIconList"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=
00008 ##title=
00009 ##
00010 
00011 context.plone_log("The getActionIconList script is deprecated and will be "
00012                   "removed in Plone 4.0.")
00013 
00014 from Products.CMFCore.utils import getToolByName
00015 
00016 ai_tool = getToolByName(context, 'portal_actionicons')
00017 plone_utils = getToolByName(context, 'plone_utils')
00018 normalizeString = plone_utils.normalizeString
00019 
00020 class ActionIconInfo:
00021     pass
00022 
00023 result = []
00024 for ai in ai_tool.listActionIcons():
00025     info = ActionIconInfo()
00026     info.category = normalizeString(ai.getCategory())
00027     info.action = normalizeString(ai.getActionId())
00028     info.icon = ai.getIconURL()
00029     result.append(info)
00030 
00031 return result