source: products/qLocalSkin/trunk/browser/scripts.py

Last change on this file was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 621 bytes
Line 
1from Products.CMFCore.utils import getToolByName
2from Products.ResourceRegistries.browser.scripts import ScriptsView as base
3
4class ScriptsView(base):
5    """ Information for script rendering. """
6
7    def scripts(self):
8        scripts = super(ScriptsView, self).scripts()
9        portal_url = getToolByName(self.context, 'portal_url')
10        new_url = portal_url()
11        portal_url = portal_url.getPortalObject().absolute_url()
12        for script in scripts:
13            src = script.get('src', '')
14            if src != '':
15                script['src'] = src.replace(portal_url, new_url, 1)
16        return scripts
Note: See TracBrowser for help on using the repository browser.