98ad4af78a1e824421f12b1cdd368843b7308098
[zzz-spline-forum.git] / splinext / forum / __init__.py
1 from pkg_resources import resource_filename
2
3 from pylons import c, session
4
5 from spline.lib.plugin import PluginBase
6 from spline.lib.plugin import PluginBase, PluginLink, Priority
7
8 import splinext.forum.controllers.forum
9
10 def add_routes_hook(map, *args, **kwargs):
11 """Hook to inject some of our behavior into the routes configuration."""
12 map.connect('/forums', controller='forum', action='forums')
13 map.connect('/forums/{forum_id}', controller='forum', action='threads')
14 map.connect('/forums/{forum_id}/threads/{thread_id}', controller='forum', action='posts')
15
16
17 class ForumPlugin(PluginBase):
18 def controllers(self):
19 return dict(
20 forum = splinext.forum.controllers.forum.ForumController,
21 )
22
23 def hooks(self):
24 return [
25 ('routes_mapping', Priority.NORMAL, add_routes_hook),
26 ]