Last change
on this file since 782 was
782,
checked in by crchemist, 17 years ago
|
Added translation for portal_status_message.
|
-
Property svn:eol-style set to
native
|
File size:
588 bytes
|
Line | |
---|
1 | from zope.interface import implements |
---|
2 | from zope.component import adapts |
---|
3 | |
---|
4 | from Products.CMFCore.utils import getToolByName |
---|
5 | from Products.Archetypes.interfaces import IBaseContent |
---|
6 | |
---|
7 | from interfaces import ICanonicalPath |
---|
8 | |
---|
9 | |
---|
10 | class canonicalPathAdapter(object): |
---|
11 | """Adapts base content to canonical path. |
---|
12 | """ |
---|
13 | adapts(IBaseContent) |
---|
14 | implements(ICanonicalPath) |
---|
15 | |
---|
16 | def __init__(self, context): |
---|
17 | self.context = context |
---|
18 | |
---|
19 | def canonical_path(self): |
---|
20 | purl = getToolByName(self.context,'portal_url') |
---|
21 | return '/'+'/'.join(purl.getRelativeContentPath(self.context)) |
---|
Note: See
TracBrowser
for help on using the repository browser.