Skip to content

Commit

Permalink
Pull types_link_to_folder_contents values from the configuration regi…
Browse files Browse the repository at this point in the history
…stry.
  • Loading branch information
esteele committed Sep 16, 2015
1 parent 2094329 commit 7bd8c8c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ Changelog
2.0.1 (unreleased)
------------------

- Nothing changed yet.
- Pull types_link_to_folder_contents values from the configuration registry.
[esteele]


2.0.0 (2015-03-26)
Expand Down
10 changes: 6 additions & 4 deletions plone/app/widgets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

from Products.CMFCore.interfaces import ISiteRoot
from Products.CMFCore.utils import getToolByName
from Products.CMFPlone.interfaces import ITypesSchema
from plone.registry.interfaces import IRegistry
from datetime import datetime
from plone.app.layout.navigation.root import getNavigationRootObject
from zope.component import providedBy
from zope.component import queryUtility
from zope.component import getUtility
from zope.component.hooks import getSite
from zope.i18n import translate
from zope.i18nmessageid import MessageFactory
Expand Down Expand Up @@ -136,10 +139,9 @@ def get_relateditems_options(context, value, separator, vocabulary_name,
options.setdefault('homeText', msgstr)
options.setdefault('folderTypes', ['Folder'])

properties = getToolByName(context, 'portal_properties')
if properties:
options['folderTypes'] = properties.site_properties.getProperty(
'typesLinkToFolderContentsInFC', options['folderTypes'])
registry = getUtility(IRegistry)
settings = registry.forInterface(ITypesSchema, prefix="plone")
options['folderTypes'] = settings.types_link_to_folder_contents

return options

Expand Down

0 comments on commit 7bd8c8c

Please sign in to comment.