Skip to content

Commit

Permalink
Pull mark_special_links, external_links_open_new_window values from c…
Browse files Browse the repository at this point in the history
…onfiguration registry.
  • Loading branch information
esteele authored and pbauer committed Sep 19, 2015
1 parent e011952 commit 3cef6af
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@ Changelog
1.2.13 (unreleased)
-------------------

- Pull mark_special_links, external_links_open_new_window values
from configuration registry.
[esteele]

- Fix visual glitch on Safari
[davilima6]

- Show active theme at the top of the theme list.
Fixes https://github.com/plone/plone.app.theming/issues/70
[tmassman]


1.2.12 (2015-09-15)
-------------------

Expand Down
17 changes: 2 additions & 15 deletions src/plone/app/theming/browser/controlpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ def authorize(context, request):
class ThemingControlpanel(BrowserView):

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(
Expand Down Expand Up @@ -79,21 +77,10 @@ def redirect(self, url):
self.request.response.redirect(url)

def get_mark_special_links(self):
msl = getattr(self.props, 'mark_special_links', False)
if msl == 'true':
return True
return False
return self.settings.mark_special_links

def set_mark_special_links(self, value):
if value:
mark_special_links = 'true'
else:
mark_special_links = 'false'
if self.props.hasProperty('mark_special_links'):
self.props.manage_changeProperties(mark_special_links=mark_special_links)
else:
self.props.manage_addProperty(
'mark_special_links', mark_special_links, 'string')
self.settings.mark_special_links = value

mark_special_links = property(get_mark_special_links,
set_mark_special_links)
Expand Down

0 comments on commit 3cef6af

Please sign in to comment.