Last change
on this file since 261 was
69,
checked in by crchemist, 18 years ago
|
removed redundant skins method
|
-
Property svn:eol-style set to
native
|
File size:
1.2 KB
|
Line | |
---|
1 | from Products.CMFPlone.URLTool import URLTool |
---|
2 | |
---|
3 | from adapters.interfaces import IRequestPortalUrlAnnotator |
---|
4 | |
---|
5 | def urltool_call(self, relative=0, *args, **kw): |
---|
6 | """ Get by default the absolute URL of the portal. If request is annonated then add suffix to portal_url |
---|
7 | """ |
---|
8 | |
---|
9 | # print '################################ Called patched portal_url __call__: ' + self.REQUEST.URL |
---|
10 | url_suffix = '' |
---|
11 | if self.REQUEST: |
---|
12 | annotator = IRequestPortalUrlAnnotator(self.REQUEST, None) |
---|
13 | if annotator is not None: |
---|
14 | url_suffix = annotator.getPortalUrlSuffix() |
---|
15 | # print '############ Added sufix to portal_url: ' + url_suffix |
---|
16 | |
---|
17 | return self.getPortalObject().absolute_url(relative=relative) + url_suffix |
---|
18 | |
---|
19 | def urltool_getPortalPath(self): |
---|
20 | """ Get the portal object's URL without the server URL component. |
---|
21 | """ |
---|
22 | |
---|
23 | url_suffix = '' |
---|
24 | if self.REQUEST: |
---|
25 | annotator = IRequestPortalUrlAnnotator(self.REQUEST, None) |
---|
26 | if annotator is not None: |
---|
27 | url_suffix = annotator.getPortalUrlSuffix() |
---|
28 | # print '############ Added sufix to portal_url: ' + url_suffix |
---|
29 | |
---|
30 | return '/'.join(self.getPortalObject().getPhysicalPath()) + url_suffix |
---|
31 | |
---|
32 | URLTool.__call__ = urltool_call |
---|
33 | #URLTool.getPortalPath = urltool_getPortalPath |
---|
Note: See
TracBrowser
for help on using the repository browser.