web/views/ibreadcrumbs.py
changeset 3451 6b46d73823f5
parent 3407 da9cc8cc7c5f
child 3460 e4843535db25
--- a/web/views/ibreadcrumbs.py	Wed Sep 23 19:26:38 2009 +0200
+++ b/web/views/ibreadcrumbs.py	Wed Sep 23 19:40:19 2009 +0200
@@ -32,7 +32,7 @@
     separator = u' > '
 
     def call(self, view=None, first_separator=True):
-        entity = self.rset.get_entity(0, 0)
+        entity = self.cw_rset.get_entity(0, 0)
         path = entity.breadcrumbs(view)
         if path:
             self.w(u'<span id="breadcrumbs" class="pathbar">')
@@ -44,7 +44,7 @@
     def render_breadcrumbs(self, contextentity, path):
         root = path.pop(0)
         if isinstance(root, Entity):
-            self.w(u'<a href="%s">%s</a>' % (self.req.build_url(root.id),
+            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.id),
                                              root.dc_type('plural')))
             self.w(self.separator)
         self.wpath_part(root, contextentity, not path)
@@ -61,11 +61,11 @@
                 self.w(part.view('breadcrumbs'))
         elif isinstance(part, tuple):
             url, title = part
-            textsize = self.req.property_value('navigation.short-line-size')
+            textsize = self._cw.property_value('navigation.short-line-size')
             self.w(u'<a href="%s">%s</a>' % (
                 xml_escape(url), xml_escape(uilib.cut(title, textsize))))
         else:
-            textsize = self.req.property_value('navigation.short-line-size')
+            textsize = self._cw.property_value('navigation.short-line-size')
             self.w(uilib.cut(unicode(part), textsize))
 
 
@@ -76,7 +76,7 @@
         # XXX hack: only display etype name or first non entity path part
         root = path.pop(0)
         if isinstance(root, Entity):
-            self.w(u'<a href="%s">%s</a>' % (self.req.build_url(root.id),
+            self.w(u'<a href="%s">%s</a>' % (self._cw.build_url(root.id),
                                              root.dc_type('plural')))
         else:
             self.wpath_part(root, contextentity, not path)
@@ -89,7 +89,7 @@
         self.w(u'<span id="breadcrumbs" class="pathbar">')
         if first_separator:
             self.w(self.separator)
-        self.w(self.req._('search'))
+        self.w(self._cw._('search'))
         self.w(u'</span>')
 
 
@@ -97,7 +97,7 @@
     __regid__ = 'breadcrumbs'
 
     def cell_call(self, row, col):
-        entity = self.rset.get_entity(row, col)
+        entity = self.cw_rset.get_entity(row, col)
         desc = xml_escape(uilib.cut(entity.dc_description(), 50))
         # XXX remember camember : tags.a autoescapes !
         self.w(tags.a(entity.view('breadcrumbtext'),
@@ -108,6 +108,6 @@
     __regid__ = 'breadcrumbtext'
 
     def cell_call(self, row, col):
-        entity = self.rset.get_entity(row, col)
-        textsize = self.req.property_value('navigation.short-line-size')
+        entity = self.cw_rset.get_entity(row, col)
+        textsize = self._cw.property_value('navigation.short-line-size')
         self.w(uilib.cut(entity.dc_title(), textsize))