-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a profile to limit plonesite addables (#69)
- Loading branch information
1 parent
65c4620
commit d73b153
Showing
9 changed files
with
162 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
27 changes: 27 additions & 0 deletions
27
src/design/plone/policy/limit_root_addables/configure.zcml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<configure | ||
xmlns="http://namespaces.zope.org/zope" | ||
xmlns:genericsetup="http://namespaces.zope.org/genericsetup" | ||
xmlns:i18n="http://namespaces.zope.org/i18n" | ||
xmlns:plone="http://namespaces.plone.org/plone" | ||
i18n_domain="design.plone.policy.limit_root_addables" | ||
> | ||
|
||
<genericsetup:registerProfile | ||
name="default" | ||
title="design.plone.policy.limit_root_addables" | ||
description="Installs the design.plone.policy.limit_root_addables add-on" | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/default" | ||
post_handler=".setuphandlers.post_install" | ||
/> | ||
|
||
<genericsetup:registerProfile | ||
name="uninstall" | ||
title="Design Plone: policy (uninstall)" | ||
description="Uninstalls the design.plone.policy add-on." | ||
provides="Products.GenericSetup.interfaces.EXTENSION" | ||
directory="profiles/uninstall" | ||
post_handler=".setuphandlers.uninstall" | ||
/> | ||
|
||
</configure> |
12 changes: 12 additions & 0 deletions
12
src/design/plone/policy/limit_root_addables/profiles/default/types/Plone_Site.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<object name="Plone Site" meta_type="Dexterity FTI" i18n:domain="plone" | ||
xmlns:i18n="http://xml.zope.org/namespaces/i18n"> | ||
<property name="filter_content_types">True</property> | ||
<property name="allowed_content_types"> | ||
<element value="Folder"/> | ||
<element value="File"/> | ||
<element value="Document"/> | ||
<element value="Image"/> | ||
<element value="Subsite"/> | ||
</property> | ||
</object> |
25 changes: 25 additions & 0 deletions
25
src/design/plone/policy/limit_root_addables/setuphandlers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# -*- coding: utf-8 -*- | ||
from Products.CMFPlone.interfaces import INonInstallable | ||
from zope.interface import implementer | ||
|
||
|
||
@implementer(INonInstallable) | ||
class HiddenProfiles(object): | ||
def getNonInstallableProfiles(self): | ||
"""Hide uninstall profile from site-creation and quickinstaller.""" | ||
return [ | ||
"design.plone.policy.limit_root_addable:uninstall", | ||
] | ||
|
||
|
||
def post_install(context): | ||
"""Post install script""" | ||
# Do something at the end of the installation of this package. | ||
|
||
|
||
def uninstall(context): | ||
"""Uninstall script""" | ||
# Do something at the end of the uninstallation of this package. | ||
plonesite = context.portal_types["Plone Site"] | ||
plonesite.filter_content_types = False | ||
plonesite.allowed_content_types = () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters