1 # copyright 2003-2010 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
1 # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved. |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
2 # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr |
3 # |
3 # |
4 # This file is part of CubicWeb. |
4 # This file is part of CubicWeb. |
5 # |
5 # |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
6 # CubicWeb is free software: you can redistribute it and/or modify it under the |
71 other_menu = self._get_menu('moreactions', _('more actions')) |
71 other_menu = self._get_menu('moreactions', _('more actions')) |
72 for category, defaultmenu in (('mainactions', self), |
72 for category, defaultmenu in (('mainactions', self), |
73 ('moreactions', other_menu), |
73 ('moreactions', other_menu), |
74 ('addrelated', None)): |
74 ('addrelated', None)): |
75 for action in actions.get(category, ()): |
75 for action in actions.get(category, ()): |
76 if category == 'addrelated': |
|
77 warn('[3.5] "addrelated" category is deprecated, use ' |
|
78 '"moreactions" category w/ "addrelated" submenu', |
|
79 DeprecationWarning) |
|
80 defaultmenu = self._get_menu('addrelated', _('add'), _('add')) |
|
81 if action.submenu: |
76 if action.submenu: |
82 menu = self._get_menu(action.submenu) |
77 menu = self._get_menu(action.submenu) |
83 else: |
78 else: |
84 menu = defaultmenu |
79 menu = defaultmenu |
85 action.fill_menu(self, menu) |
80 action.fill_menu(self, menu) |