[CMF-checkins] CVS: CMF/CMFCore - Skinnable.py:1.5.2.1
Chris McDonough
chrism@zope.com
Mon, 30 Sep 2002 16:49:09 -0400
Update of /cvs-repository/CMF/CMFCore
In directory cvs.zope.org:/tmp/cvs-serv23434
Modified Files:
Tag: chrism-actions-branch
Skinnable.py
Log Message:
Add changeSkin method (and methods which it depends on) to chrism-actions-branch.
=== CMF/CMFCore/Skinnable.py 1.5 => 1.5.2.1 ===
--- CMF/CMFCore/Skinnable.py:1.5 Tue Jul 9 13:27:25 2002
+++ CMF/CMFCore/Skinnable.py Mon Sep 30 16:49:08 2002
@@ -117,6 +117,32 @@
w_self.setupCurrentSkin()
return w_self
+ security.declarePublic('changeSkin')
+ def changeSkin(self, skinname):
+ self._v_skindata = None
+ skinobj = self.getSkin(skinname)
+ if skinobj is not None:
+ self._v_skindata = (self.REQUEST, skinobj, {})
+
+ security.declarePrivate('getSkin')
+ def getSkin(self, name=None):
+ """Returns the requested skin.
+ """
+ skinob = None
+ skinstool = None
+ sfn = self.getSkinsFolderName()
+
+ if sfn is not None:
+ sf = getattr(self, sfn, None)
+ if sf is not None:
+ if name is not None:
+ skinob = sf.getSkinByName(name)
+ if skinob is None:
+ skinob = sf.getSkinByName(sf.getDefaultSkin())
+ if skinob is None:
+ skinob = sf.getSkinByPath('')
+ return skinob
+
def _checkId(self, id, allow_dup=0):
'''
Override of ObjectManager._checkId(). Allows the user