def _getConfiguration(object): """Return the local or global configuration settings for notify""" # BBB: the best is to refactor this using adapters if not ILocalBoardNotify.providedBy(object): ploneboard_notify_properties = getToolByName(object,'portal_properties')['ploneboard_notify_properties'] sendto_all = ploneboard_notify_properties.sendto_all sendto_values = ploneboard_notify_properties.sendto_values else: # Local configuration sendto_all = object.getProperty('forum_sendto_all', False) sendto_values = object.getProperty('forum_sendto_values', []) return sendto_all, sendto_values
def isLocalEnabled(self, forum_brain): """Check is the Forum use local configuration, so if provides ILocalBoardNotify""" forum = forum_brain.getObject() return ILocalBoardNotify.providedBy(forum)