示例#1
0
 def updateActionIcon( self
                     , category
                     , action_id
                     , icon_expr
                     , title=None
                     , priority=0
                     ):
     """ update ActionIcons and remove cache entry """
     BaseTool.updateActionIcon(self, category, action_id, icon_expr,
                               title, priority)
     removeAICacheEntry(category, action_id)
示例#2
0
 def manage_updateActionIcon( self
                            , category
                            , action_id
                            , icon_expr
                            , title
                            , priority
                            , REQUEST
                            ):
     """ update ActionIcons from ZMI and remove cache entry """
     BaseTool.manage_updateActionIcon( self, category, action_id, icon_expr,
                                       title, priority, REQUEST )
     removeAICacheEntry(category, action_id)
 def updateActionIcon(self, category, action_id, icon_expr,
                      title=None, priority=0):
     """ update ActionIcons and remove cache entry """
     log_deprecated("The icon for the '%s/%s' action is being updated on "
                    "the action icons tool. The action icons tool has "
                    "been deprecated and will be removed in Plone 5. "
                    "You should register action icons directly on the "
                    "action now, using the 'icon_expr' "
                    "setting." % (category, action_id))
     BaseTool.updateActionIcon(self, category, action_id, icon_expr,
                               title, priority)
     removeAICacheEntry(category, action_id)
 def updateActionIcon(self,
                      category,
                      action_id,
                      icon_expr,
                      title=None,
                      priority=0):
     """ update ActionIcons and remove cache entry """
     log_deprecated("The icon for the '%s/%s' action is being updated on "
                    "the action icons tool. The action icons tool has "
                    "been deprecated and will be removed in Plone 5. "
                    "You should register action icons directly on the "
                    "action now, using the 'icon_expr' "
                    "setting." % (category, action_id))
     BaseTool.updateActionIcon(self, category, action_id, icon_expr, title,
                               priority)
     removeAICacheEntry(category, action_id)
示例#5
0
    def _initSite(self, with_icon=False):
        from OFS.Folder import Folder
        from Products.CMFActionIcons.ActionIconsTool import ActionIconsTool

        self.root.site = Folder(id='site')
        site = self.root.site
        tool = ActionIconsTool()
        site._setObject(tool.getId(), tool)

        if with_icon:
            tool.addActionIcon(category=self.CATEGORY,
                               action_id=self.ACTION_ID,
                               title=self.TITLE,
                               priority=self.PRIORITY,
                               icon_expr=self.ICON_EXPR)
        return site
示例#6
0
    def _initSite(self, with_icon=False):
        from OFS.Folder import Folder
        from Products.CMFActionIcons.ActionIconsTool import ActionIconsTool

        self.root.site = Folder(id='site')
        site = self.root.site
        tool = ActionIconsTool()
        site._setObject( tool.getId(), tool )

        if with_icon:
            tool.addActionIcon( category=self.CATEGORY
                              , action_id=self.ACTION_ID
                              , title=self.TITLE
                              , priority=self.PRIORITY
                              , icon_expr=self.ICON_EXPR
                              )
        return site
 def getActionIcon(self, category, action_id, context=None):
     ai = BaseTool.getActionIcon(self, category, action_id, context=context)
     if ai:
         log_deprecated("The icon for the '%s/%s' action was obtained from "
                        "the action icons tool. The action icons tool has "
                        "been deprecated and will be removed in Plone 5. "
                        "You should register action icons directly on the "
                        "action now, using the 'icon_expr' "
                        "setting." % (category, action_id))
         return ai
     return None
示例#8
0
    def _initSite(self, with_icon=False):
        from OFS.Folder import Folder
        from Products.CMFActionIcons.ActionIconsTool import ActionIconsTool

        _setUpDefaultTraversable()

        self.root.site = Folder(id='site')
        site = self.root.site
        tool = ActionIconsTool()
        site._setObject(tool.getId(), tool)

        sm = getSiteManager()
        sm.registerUtility(site.portal_actionicons, IActionIconsTool)

        if with_icon:
            tool.addActionIcon(category=self.CATEGORY,
                               action_id=self.ACTION_ID,
                               title=self.TITLE,
                               priority=self.PRIORITY,
                               icon_expr=self.ICON_EXPR)
        return site
 def queryActionIcon(self, category, action_id, default=None, context=None):
     ai = BaseTool.queryActionIcon(self, category, action_id,
                                   default=default, context=context)
     if ai:
         log_deprecated("The icon for the '%s/%s' action was obtained from "
                        "the action icons tool. The action icons tool has "
                        "been deprecated and will be removed in Plone 5. "
                        "You should register action icons directly on the "
                        "action now, using the 'icon_expr' "
                        "setting." % (category, action_id))
         return ai
     return None
 def addActionIcon(self, category, action_id, icon_expr, title=None,
                   priority=0):
     combination = '%s/%s' % (category, action_id)
     if combination not in WHITELISTED_AI:
         log_deprecated("An icon for the '%s' action is being added to "
                        "the action icons tool. The action icons tool has "
                        "been deprecated and will be removed in Plone 5. "
                        "You should register action icons directly on the "
                        "action now, using the 'icon_expr' "
                        "setting." % combination)
     return BaseTool.addActionIcon(self, category, action_id, icon_expr,
                                   title, priority)
示例#11
0
    def _initSite(self, with_icon=False):
        from OFS.Folder import Folder
        from Products.CMFActionIcons.ActionIconsTool import ActionIconsTool

        _setUpDefaultTraversable()

        self.root.site = Folder(id='site')
        site = self.root.site
        tool = ActionIconsTool()
        site._setObject( tool.getId(), tool )

        sm = getSiteManager()
        sm.registerUtility(site.portal_actionicons, IActionIconsTool)

        if with_icon:
            tool.addActionIcon( category=self.CATEGORY
                              , action_id=self.ACTION_ID
                              , title=self.TITLE
                              , priority=self.PRIORITY
                              , icon_expr=self.ICON_EXPR
                              )
        return site
 def addActionIcon(self,
                   category,
                   action_id,
                   icon_expr,
                   title=None,
                   priority=0):
     combination = '%s/%s' % (category, action_id)
     if combination not in WHITELISTED_AI:
         log_deprecated("An icon for the '%s' action is being added to "
                        "the action icons tool. The action icons tool has "
                        "been deprecated and will be removed in Plone 5. "
                        "You should register action icons directly on the "
                        "action now, using the 'icon_expr' "
                        "setting." % combination)
     return BaseTool.addActionIcon(self, category, action_id, icon_expr,
                                   title, priority)
示例#13
0
 def manage_removeActionIcon( self, category, action_id, REQUEST ):
     """ remove ActionIcons from ZMI and remove cache entry """
     BaseTool.manage_removeActionIcon(self, category, action_id, REQUEST)
     removeAICacheEntry(category, action_id)
 def removeActionIcon(self, category, action_id):
     """ remove ActionIcon and remove cache entry """
     BaseTool.removeActionIcon(self, category, action_id)
     removeAICacheEntry(category, action_id)
示例#15
0
 def clearActionIcons( self ):
     """ clear ActionIcons and cache entries """
     BaseTool.clearActionIcons(self)
     iconcache.clear()
示例#16
0
 def removeActionIcon( self, category, action_id ):
     """ remove ActionIcon and remove cache entry """
     BaseTool.removeActionIcon(self, category, action_id)
     removeAICacheEntry(category, action_id)
 def clearActionIcons(self):
     """ clear ActionIcons and cache entries """
     BaseTool.clearActionIcons(self)
     iconcache.clear()
 def manage_updateActionIcon(self, category, action_id, icon_expr, title,
                             priority, REQUEST):
     """ update ActionIcons from ZMI and remove cache entry """
     BaseTool.manage_updateActionIcon(self, category, action_id, icon_expr,
                                      title, priority, REQUEST)
     removeAICacheEntry(category, action_id)
示例#19
0
    def _makeOne(self, *args, **kw):

        from Products.CMFActionIcons.ActionIconsTool import ActionIconsTool

        return ActionIconsTool(*args, **kw)
 def manage_removeActionIcon(self, category, action_id, REQUEST):
     """ remove ActionIcons from ZMI and remove cache entry """
     BaseTool.manage_removeActionIcon(self, category, action_id, REQUEST)
     removeAICacheEntry(category, action_id)