-
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.
- Loading branch information
Showing
12 changed files
with
40 additions
and
112 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
3 changes: 0 additions & 3 deletions
3
src/collective/behavior/featuredimage/profiles/default/metadata.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 |
---|---|---|
@@ -1,7 +1,4 @@ | ||
<?xml version="1.0"?> | ||
<metadata> | ||
<version>1</version> | ||
<dependencies> | ||
<dependency>profile-plone.app.dexterity:default</dependency> | ||
</dependencies> | ||
</metadata> |
7 changes: 0 additions & 7 deletions
7
src/collective/behavior/featuredimage/profiles/testfixture/metadata.xml
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/collective/behavior/featuredimage/profiles/testfixture/types.xml
This file was deleted.
Oops, something went wrong.
40 changes: 0 additions & 40 deletions
40
src/collective/behavior/featuredimage/profiles/testfixture/types/Dexterity_Item.xml
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
src/collective/behavior/featuredimage/tests/Dexterity_Item.xml
This file was deleted.
Oops, something went wrong.
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
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,14 @@ | ||
# -*- coding: utf-8 -*- | ||
from plone.dexterity.interfaces import IDexterityFTI | ||
from zope.component import queryUtility | ||
|
||
|
||
def enable_featured_image_behavior(portal_type): | ||
"""Enable Related Items behavior on the specified portal type.""" | ||
fti = queryUtility(IDexterityFTI, name=portal_type) | ||
behavior = 'collective.behavior.featuredimage.behaviors.interfaces.IFeaturedImage' | ||
if behavior in fti.behaviors: | ||
return | ||
behaviors = list(fti.behaviors) | ||
behaviors.append(behavior) | ||
fti.behaviors = tuple(behaviors) |