|
Last change
on this file since 1003 was
1,
checked in by myroslav, 21 years ago
|
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
|
File size:
823 bytes
|
| Line | |
|---|
| 1 | from zope.component import adapts |
|---|
| 2 | from zope.interface import implements |
|---|
| 3 | |
|---|
| 4 | from Products.qLocalSkin.interfaces import IShiftPortalUrl |
|---|
| 5 | from interfaces import ISkinNameExtractor |
|---|
| 6 | from Products.qLocalSkin.config import PROPERTY_NAME |
|---|
| 7 | |
|---|
| 8 | class SkinNameExtractor(object): |
|---|
| 9 | """ Extract skin name from context's properties. """ |
|---|
| 10 | |
|---|
| 11 | implements(ISkinNameExtractor) |
|---|
| 12 | adapts(IShiftPortalUrl) |
|---|
| 13 | |
|---|
| 14 | property_name = PROPERTY_NAME |
|---|
| 15 | |
|---|
| 16 | def __init__(self, context): |
|---|
| 17 | self.context = context |
|---|
| 18 | |
|---|
| 19 | def getSkinName(self): |
|---|
| 20 | skin_name = self.context.getProperty(self.property_name, d=None) |
|---|
| 21 | return skin_name |
|---|
| 22 | |
|---|
| 23 | def setSkinName(self, value): |
|---|
| 24 | if self.context.hasProperty(self.property_name): |
|---|
| 25 | self.context.manage_changeProperies(**{self.property_name:value}) |
|---|
| 26 | return True |
|---|
| 27 | return False |
|---|
Note: See
TracBrowser
for help on using the repository browser.