')
+ vtitle = self._cw.form.get('vtitle')
+ if vtitle:
+ stream.write(u'
%s
\n' % vtitle)
+ paginate = True
+ nav_html = UStringIO()
+ if paginate and not view.handle_pagination:
+ view.paginate(w=nav_html.write)
+ stream.write(nav_html.getvalue())
+ if divid == 'pageContent':
+ stream.write(u'
')
+ view.render(**kwargs)
+ extresources = self._cw.html_headers.getvalue(skiphead=True)
+ if extresources:
+ stream.write(u'
\n') # XXX use a widget?
+ stream.write(extresources)
+ stream.write(u'
\n')
+ if divid == 'pageContent':
+ stream.write(u'
%s
' % nav_html.getvalue())
+ return stream.getvalue()
+
+
+def _ajaxfunc_factory(implementation, selector=yes(), _output_type=None,
+ _check_pageid=False, regid=None):
+ """converts a standard python function into an AjaxFunction appobject"""
+ class AnAjaxFunc(AjaxFunction):
+ __regid__ = regid or implementation.__name__
+ __select__ = selector
+ output_type = _output_type
+ check_pageid = _check_pageid
+
+ def serialize(self, content):
+ if self.output_type is None:
+ return content
+ elif self.output_type == 'xhtml':
+ self._cw.set_content_type(self._cw.html_content_type())
+ return ''.join((u'