It became apparent with Scott's start at integration for UR (#445698: Default view for activity2) that we need a better way to include these files. Let's integrate them the way Views2 does and have a 'path' key for hook_activity_info() - if 'path' is not defined we only look in the module's (who is implementing hook_activity_info()) root directory for our activity.inc file.
After this is implemented, use this in our core module integration and update the aforementioned issue.
Comments
Comment #1
Scott Reynolds commentedI disagree here. Views does this because a lot of the API stuff for them is very involved (think about how many lines a spent describing the tables to Views). We don't need to go this far. We provide the 'file' as an optional thing, if they want it there they can add it, otherwise it is assumed that the hook_activity* implementations are present in the current space.
Comment #2
sirkitree commentedAnd where do we look for this file, only in the module's root? or should we (like Views) look inside 'includes' as well?
Comment #3
Scott Reynolds commentedNo see the way Views works is this
1.) if the hook_views_api() says there is a 'path' then use that as the root for all views related files (.views.inc, any handlers etc)
2.) if there isn't a hook_views_api() include it at the root of the module
What the patch in #445698: Default view for activity2 presents, and what has been committed to 2.x is the following
1.) if the hook_activity_access_api() specifies a 'file' include that file
2.) otherwise assume all hooks are in the .module file and do nothing.
This is exactly like #447494: adding file option to hook_spaces_types() does
Comment #4
sirkitree commentedBeing taken care of over at #451664: Create a check for hook_activity_info() api version 2.0