equal
deleted
inserted
replaced
47 def url(self): |
47 def url(self): |
48 """return the url associated with this action""" |
48 """return the url associated with this action""" |
49 raise NotImplementedError |
49 raise NotImplementedError |
50 |
50 |
51 def html_class(self): |
51 def html_class(self): |
52 if self.req.selected(self.url()): |
52 if self._cw.selected(self.url()): |
53 return 'selected' |
53 return 'selected' |
54 if self.category: |
54 if self.category: |
55 return 'box' + self.category.capitalize() |
55 return 'box' + self.category.capitalize() |
56 |
56 |
57 def build_action(self, title, path, **kwargs): |
57 def build_action(self, title, path, **kwargs): |
58 return UnregisteredAction(self.req, self.rset, title, path, **kwargs) |
58 return UnregisteredAction(self._cw, self.cw_rset, title, path, **kwargs) |
59 |
59 |
60 |
60 |
61 class UnregisteredAction(Action): |
61 class UnregisteredAction(Action): |
62 """non registered action used to build boxes. Unless you set them |
62 """non registered action used to build boxes. Unless you set them |
63 explicitly, .vreg and .schema attributes at least are None. |
63 explicitly, .vreg and .schema attributes at least are None. |
87 & partial_may_add_relation()) |
87 & partial_may_add_relation()) |
88 |
88 |
89 submenu = 'addrelated' |
89 submenu = 'addrelated' |
90 |
90 |
91 def url(self): |
91 def url(self): |
92 current_entity = self.rset.get_entity(self.row or 0, self.col or 0) |
92 current_entity = self.cw_rset.get_entity(self.cw_row or 0, self.cw_col or 0) |
93 linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self)) |
93 linkto = '%s:%s:%s' % (self.rtype, current_entity.eid, target(self)) |
94 return self.build_url('add/%s' % self.etype, __linkto=linkto, |
94 return self.build_url('add/%s' % self.etype, __linkto=linkto, |
95 __redirectpath=current_entity.rest_path(), # should not be url quoted! |
95 __redirectpath=current_entity.rest_path(), # should not be url quoted! |
96 __redirectvid=self.req.form.get('__redirectvid', '')) |
96 __redirectvid=self._cw.form.get('__redirectvid', '')) |
97 |
97 |