Navigation Menu

Skip to content

Commit

Permalink
Handle settings changes in control panel correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
malthe committed Oct 24, 2012
1 parent ec61d06 commit 9933a6e
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/collective/multilingual/browser/controlpanel.py
Expand Up @@ -9,11 +9,14 @@
from zope import schema
from zope.interface import implements
from zope.component import getSiteManager
from zope.component import getUtility
from zope.interface import Interface
from zope.lifecycleevent import modified

from plone.dexterity.interfaces import IDexterityFTI
from plone.z3cform import layout
from plone.registry.recordsproxy import RecordsProxy
from plone.registry.interfaces import IRegistry
from plone.app.registry.browser import controlpanel

from ..interfaces import IMultilingual
Expand Down Expand Up @@ -43,8 +46,12 @@ class ControlPanelAdapter(object):

_behavior_name = dottedName(IMultilingual)

context = None
proxy = None

def __init__(self, context):
self.context = context
self.__dict__['context'] = context
self.__dict__['proxy'] = RecordsProxy(getUtility(IRegistry), ISettings)

def _get_ftis(self):
sm = getSiteManager(self.context)
Expand Down Expand Up @@ -73,6 +80,12 @@ def _set_ftis(self, ftis):

ftis = property(_get_ftis, _set_ftis)

def __getattr__(self, name):
return getattr(self.proxy, name)

def __setattr__(self, name, value):
setattr(self.proxy, name, value)


class ControlPanelEditForm(controlpanel.RegistryEditForm):
schema = IControlPanelSchema
Expand Down

0 comments on commit 9933a6e

Please sign in to comment.