24 |
24 |
25 from logilab.common.deprecation import class_renamed |
25 from logilab.common.deprecation import class_renamed |
26 from logilab.mtconverter import xml_escape |
26 from logilab.mtconverter import xml_escape |
27 |
27 |
28 from cubicweb import role |
28 from cubicweb import role |
29 from cubicweb.web import json |
29 from cubicweb.utils import json_dumps |
30 from cubicweb.view import Component |
30 from cubicweb.view import Component |
31 from cubicweb.selectors import ( |
31 from cubicweb.selectors import ( |
32 paginated_rset, one_line_rset, primary_view, match_context_prop, |
32 paginated_rset, one_line_rset, primary_view, match_context_prop, |
33 partial_has_related_entities) |
33 partial_has_related_entities) |
34 |
34 |
144 url = view.page_navigation_url(self, path, params) |
144 url = view.page_navigation_url(self, path, params) |
145 elif path == 'json': |
145 elif path == 'json': |
146 rql = params.pop('rql', self.cw_rset.printable_rql()) |
146 rql = params.pop('rql', self.cw_rset.printable_rql()) |
147 # latest 'true' used for 'swap' mode |
147 # latest 'true' used for 'swap' mode |
148 url = 'javascript: replacePageChunk(%s, %s, %s, %s, true)' % ( |
148 url = 'javascript: replacePageChunk(%s, %s, %s, %s, true)' % ( |
149 json.dumps(params.get('divid', 'pageContent')), |
149 json_dumps(params.get('divid', 'pageContent')), |
150 json.dumps(rql), json.dumps(params.pop('vid', None)), |
150 json_dumps(rql), json_dumps(params.pop('vid', None)), |
151 json.dumps(params)) |
151 json_dumps(params)) |
152 else: |
152 else: |
153 url = self._cw.build_url(path, **params) |
153 url = self._cw.build_url(path, **params) |
154 return url |
154 return url |
155 |
155 |
156 def page_link(self, path, params, start, stop, content): |
156 def page_link(self, path, params, start, stop, content): |