web/box.py
branchstable
changeset 2312 af4d8f75c5db
parent 2159 0ca23d0eace2
child 2381 caad2367d940
equal deleted inserted replaced
2311:f178182b1305 2312:af4d8f75c5db
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     6 :license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses
     7 """
     7 """
     8 __docformat__ = "restructuredtext en"
     8 __docformat__ = "restructuredtext en"
     9 _ = unicode
     9 _ = unicode
    10 
    10 
    11 from logilab.mtconverter import html_escape
    11 from logilab.mtconverter import xml_escape
    12 
    12 
    13 from cubicweb import Unauthorized, role as get_role, target as get_target
    13 from cubicweb import Unauthorized, role as get_role, target as get_target
    14 from cubicweb.selectors import (one_line_rset,  primary_view,
    14 from cubicweb.selectors import (one_line_rset,  primary_view,
    15                                 match_context_prop, partial_has_related_entities,
    15                                 match_context_prop, partial_has_related_entities,
    16                                 accepts_compat, has_relation_compat,
    16                                 accepts_compat, has_relation_compat,
    72     def mk_action(self, title, path, escape=True, **kwargs):
    72     def mk_action(self, title, path, escape=True, **kwargs):
    73         """factory function to create dummy actions compatible with the
    73         """factory function to create dummy actions compatible with the
    74         .format_actions method
    74         .format_actions method
    75         """
    75         """
    76         if escape:
    76         if escape:
    77             title = html_escape(title)
    77             title = xml_escape(title)
    78         return self.box_action(self._action(title, path, **kwargs))
    78         return self.box_action(self._action(title, path, **kwargs))
    79 
    79 
    80     def _action(self, title, path, **kwargs):
    80     def _action(self, title, path, **kwargs):
    81         return UnregisteredAction(self.req, self.rset, title, path, **kwargs)
    81         return UnregisteredAction(self.req, self.rset, title, path, **kwargs)
    82 
    82