Commit f20d674b authored by Mame Coumba Sall's avatar Mame Coumba Sall

Modified so that title is properly translated when script is used

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@32544 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent d5cfb647
...@@ -53,9 +53,9 @@ ...@@ -53,9 +53,9 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string>request = context.REQUEST\n
request_form = context.REQUEST.form\n
request = context.REQUEST\n from ZTUtils import make_query\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
title = context.getTitle(\'Unknown\')\n title = context.getTitle(\'Unknown\')\n
translateString = context.Base_translateString\n translateString = context.Base_translateString\n
...@@ -74,17 +74,21 @@ web_page = web_page_module.newContent(portal_type = \'Web Page\', \n ...@@ -74,17 +74,21 @@ web_page = web_page_module.newContent(portal_type = \'Web Page\', \n
category_list = context.getMembershipCriterionCategoryList()\n category_list = context.getMembershipCriterionCategoryList()\n
web_page.setCategoryList(web_page.getCategoryList() + category_list)\n web_page.setCategoryList(web_page.getCategoryList() + category_list)\n
\n \n
\n
# Return the new page in the section context\n # Return the new page in the section context\n
editable_mode = 1\n keep_items = dict(editable_mode=1,\n
message = translateString("New Web Page of section %s." %(context.getTitle()))\n portal_status_message=translateString("New Web Page of section ${web_section}.",\n
redirect_url = \'%s/%s/view?portal_status_message=%s&editable_mode:int=%s\' % (\n mapping = dict(web_section=title)))\n
context.absolute_url(), web_page.getRelativeUrl(),message,editable_mode)\n \n
request_form.update(keep_items)\n
message = make_query(dict([(k, v) for k, v in request_form.items() if k and v is not None]))\n
\n
redirect_url = \'%s/%s/view?%s\' % (\n
context.absolute_url(), web_page.getRelativeUrl(),message)\n
\n \n
# return to the new page in the section context\n # return to the new page in the section context\n
return context.REQUEST.RESPONSE.redirect(redirect_url)\n return context.REQUEST.RESPONSE.redirect(redirect_url)\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -123,6 +127,9 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n ...@@ -123,6 +127,9 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n
<string>_getattr_</string> <string>_getattr_</string>
<string>context</string> <string>context</string>
<string>request</string> <string>request</string>
<string>request_form</string>
<string>ZTUtils</string>
<string>make_query</string>
<string>portal</string> <string>portal</string>
<string>title</string> <string>title</string>
<string>translateString</string> <string>translateString</string>
...@@ -130,7 +137,14 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n ...@@ -130,7 +137,14 @@ return context.REQUEST.RESPONSE.redirect(redirect_url)\n
<string>language</string> <string>language</string>
<string>web_page</string> <string>web_page</string>
<string>category_list</string> <string>category_list</string>
<string>editable_mode</string> <string>dict</string>
<string>keep_items</string>
<string>append</string>
<string>$append0</string>
<string>_getiter_</string>
<string>k</string>
<string>v</string>
<string>None</string>
<string>message</string> <string>message</string>
<string>redirect_url</string> <string>redirect_url</string>
</tuple> </tuple>
......
906 907
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment