2009-10-25 15:42:08 -05:00
|
|
|
<tal:comment replace="nothing">
|
|
|
|
This page is called by a XmlHttpRequest object. It requires parameters "page" and "macro":
|
|
|
|
they are used to call the macro that will render the HTML chunk to be returned to the browser.
|
|
|
|
It can also have a parameter "action", that refers to a method that will be triggered on
|
|
|
|
contextObj before returning the result of the macro to the browser.
|
|
|
|
</tal:comment>
|
2011-09-18 08:00:05 -05:00
|
|
|
<tal:ajax define="contextObj context/getParentNode;
|
|
|
|
tool contextObj/getTool;
|
|
|
|
req python: request;
|
|
|
|
resp req/RESPONSE;
|
|
|
|
page req/page;
|
|
|
|
macro req/macro;
|
|
|
|
action req/action|nothing;
|
2011-11-25 11:01:20 -06:00
|
|
|
user contextObj/getUser;
|
2011-09-18 08:00:05 -05:00
|
|
|
app tool/getApp;
|
|
|
|
appUrl app/absolute_url;
|
2011-11-25 11:01:20 -06:00
|
|
|
template python: contextObj.getPageTemplate(app.ui, page);
|
2011-09-18 08:00:05 -05:00
|
|
|
x python: resp.setHeader('Content-Type','text/html;;charset=utf-8');
|
|
|
|
x python: resp.setHeader('Expires', 'Mon, 11 Dec 1975 12:05:05 GMT');
|
|
|
|
x python: resp.setHeader('Content-Language', req.get('language', 'en'));
|
|
|
|
x python: resp.setHeader('CacheControl', 'no-cache')">
|
2010-04-30 05:05:29 -05:00
|
|
|
<tal:comment replace="nothing">Keys "Expires" and "CacheControl" are used for preventing IE to cache
|
|
|
|
this page. Indeed, this page is retrieved through an asynchronous XMLHttpRequest by the browser, and
|
|
|
|
IE caches this by default.</tal:comment>
|
2009-10-25 15:42:08 -05:00
|
|
|
<tal:executeAction condition="action">
|
2011-09-18 08:00:05 -05:00
|
|
|
<tal:do define="x python: contextObj.getMethod('on'+action)()" omit-tag=""/>
|
2009-10-25 15:42:08 -05:00
|
|
|
</tal:executeAction>
|
2010-08-05 11:23:17 -05:00
|
|
|
<metal:callMacro use-macro="python: template.macros.get(macro)"/>
|
2009-10-25 15:42:08 -05:00
|
|
|
</tal:ajax>
|