Logo Search packages:      
Sourcecode: zope-cpsskins version File versions  Download package

def CPSSkins::PortalThemesTool::PortalThemesTool::renderAccessKeys (   self,
  kw 
)

Render all access keys

Definition at line 1146 of file PortalThemesTool.py.

01146                                     :
        """Render all access keys
        """
        rendered = ''

        # Retrieving the accesskeys for CPSDefault which are defined in a
        # vocabulary.
        vtool = getToolByName(self, 'portal_vocabularies', None)
        utool = getToolByName(self, 'portal_url')
        portal = utool.getPortalObject()
        if vtool is not None:
            accesskeys_voc = getattr(vtool, 'accesskeys', {})
            for accesskey, path in accesskeys_voc.items():
                if path.startswith('/'):
                    # For example: "/", "/accessibility"
                    url = portal.absolute_url() + path
                else:
                    # For example: "#content", "mailto:xxx"
                    url = path
                rendered += ('<a href="%s" accesskey="%s"></a>'
                             % (url, accesskey))

        # Retrieving the accesskey for CPSSkins
        rendered += self.renderAccessKey(**kw)

        # Retrieving the accesskey for CPSPortlets
        ptltool = getToolByName(self, 'portal_cpsportlets', None)
        if ptltool is not None:
            try:
                rendered += ptltool.renderAccessKey(**kw)
            except AttributeError:
                pass
        if rendered != '':
            rendered = '<div>%s</div>' % rendered
        return rendered

    #
    # External Themes


Generated by  Doxygen 1.6.0   Back to index