Skip to content

Commit

Permalink
Use new registry setting
Browse files Browse the repository at this point in the history
  • Loading branch information
esteele authored and pbauer committed Sep 19, 2015
1 parent 53c16bf commit e011952
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/plone/app/theming/browser/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.decode import processInputs
from Products.statusmessages.interfaces import IStatusMessage
from Products.CMFPlone.interfaces import ILinkSchema
from plone.app.theming.interfaces import DEFAULT_THEME_FILENAME
from plone.app.theming.interfaces import IThemeSettings
from plone.app.theming.interfaces import RULE_FILENAME
Expand Down Expand Up @@ -43,6 +44,9 @@ def __call__(self):
ptool = getToolByName(self.context, 'portal_properties')
self.props = ptool.site_properties
self.pskin = getToolByName(self.context, 'portal_skins')
registry = getUtility(IRegistry)
self.settings = registry.forInterface(
ILinkSchema, prefix="plone", check=False)

if self.update():
return self.index()
Expand Down Expand Up @@ -95,16 +99,10 @@ def set_mark_special_links(self, value):
set_mark_special_links)

def get_ext_links_open_new_window(self):
elonw = self.props.external_links_open_new_window
if elonw == 'true':
return True
return False
return self.settings.external_links_open_new_window

def set_ext_links_open_new_window(self, value):
if value:
self.props.manage_changeProperties(external_links_open_new_window='true')
else:
self.props.manage_changeProperties(external_links_open_new_window='false')
self.settings.external_links_open_new_window = value

ext_links_open_new_window = property(get_ext_links_open_new_window,
set_ext_links_open_new_window)
Expand Down

0 comments on commit e011952

Please sign in to comment.