[Erp5-report] r32508 mame - in /erp5/trunk/bt5/erp5_web: ActionTemplateItem/portal_types/We...
nobody at svn.erp5.org
nobody at svn.erp5.org
Fri Feb 12 17:29:12 CET 2010
Author: mame
Date: Fri Feb 12 17:29:02 2010
New Revision: 32508
URL: http://svn.erp5.org?rev=32508&view=rev
Log:
Clean WebSection_newWebPage
*Rename the script
*Keep the existing categories on WebPage instead of deleting them.
*Remove the reference generated on the WebPage.
*Redirect to the web page in the context of the web section (in order to view the section in the breadcrumb).
Added:
erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_createNewWebPage.xml
Modified:
erp5/trunk/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20Section/new_page.xml
erp5/trunk/bt5/erp5_web/bt/revision
Modified: erp5/trunk/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20Section/new_page.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/ActionTemplateItem/portal_types/Web%2520Section/new_page.xml?rev=32508&r1=32507&r2=32508&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20Section/new_page.xml [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/ActionTemplateItem/portal_types/Web%20Section/new_page.xml [utf8] Fri Feb 12 17:29:02 2010
@@ -33,7 +33,9 @@
</item>
<item>
<key> <string>description</string> </key>
- <value> <string></string> </value>
+ <value>
+ <none/>
+ </value>
</item>
<item>
<key> <string>icon</string> </key>
@@ -77,7 +79,7 @@
<dictionary>
<item>
<key> <string>text</string> </key>
- <value> <string>string:${object_url}/WebSection_newWebPage</string> </value>
+ <value> <string>string:${object_url}/WebSection_createNewWebPage</string> </value>
</item>
</dictionary>
</pickle>
Added: erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_createNewWebPage.xml
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_createNewWebPage.xml?rev=32508&view=auto
==============================================================================
--- erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_createNewWebPage.xml (added)
+++ erp5/trunk/bt5/erp5_web/SkinTemplateItem/portal_skins/erp5_web/WebSection_createNewWebPage.xml [utf8] Fri Feb 12 17:29:02 2010
@@ -1,0 +1,163 @@
+<?xml version="1.0"?>
+<ZopeData>
+ <record id="1" aka="AAAAAAAAAAE=">
+ <pickle>
+ <tuple>
+ <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
+ <tuple/>
+ </tuple>
+ </pickle>
+ <pickle>
+ <dictionary>
+ <item>
+ <key> <string>Script_magic</string> </key>
+ <value> <int>3</int> </value>
+ </item>
+ <item>
+ <key> <string>_bind_names</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>_asgns</string> </key>
+ <value>
+ <dictionary>
+ <item>
+ <key> <string>name_container</string> </key>
+ <value> <string>container</string> </value>
+ </item>
+ <item>
+ <key> <string>name_context</string> </key>
+ <value> <string>context</string> </value>
+ </item>
+ <item>
+ <key> <string>name_m_self</string> </key>
+ <value> <string>script</string> </value>
+ </item>
+ <item>
+ <key> <string>name_subpath</string> </key>
+ <value> <string>traverse_subpath</string> </value>
+ </item>
+ </dictionary>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>_body</string> </key>
+ <value> <string encoding="cdata"><![CDATA[
+
+request = context.REQUEST\n
+portal = context.getPortalObject()\n
+title = context.getTitle(\'Unknown\')\n
+translateString = context.Base_translateString\n
+web_page_module = context.web_page_module\n
+\n
+# Find the applicable language\n
+language = portal.Localizer.get_selected_language()\n
+\n
+# Create a new empty page\n
+web_page = web_page_module.newContent(portal_type = \'Web Page\', \n
+ title="New Page of Section %s" % title,\n
+ version="1", language=language)\n
+\n
+\n
+# Copy categories into new Web Page\n
+category_list = context.getMembershipCriterionCategoryList()\n
+web_page.setCategoryList(web_page.getCategoryList() + category_list)\n
+\n
+# Return the new page in the section context\n
+editable_mode = 1\n
+message = translateString("New Web Page of section %s." %(context.getTitle()))\n
+redirect_url = \'%s/%s/view?portal_status_message=%s&editable_mode:int=%s\' % (\n
+ context.absolute_url(), web_page.getRelativeUrl(),message,editable_mode)\n
+\n
+# return to the new page in the section context\n
+return context.REQUEST.RESPONSE.redirect(redirect_url)\n
+
+
+]]></string> </value>
+ </item>
+ <item>
+ <key> <string>_code</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>_params</string> </key>
+ <value> <string></string> </value>
+ </item>
+ <item>
+ <key> <string>errors</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_code</string> </key>
+ <value>
+ <object>
+ <klass>
+ <global name="FuncCode" module="Shared.DC.Scripts.Signature"/>
+ </klass>
+ <tuple/>
+ <state>
+ <dictionary>
+ <item>
+ <key> <string>co_argcount</string> </key>
+ <value> <int>0</int> </value>
+ </item>
+ <item>
+ <key> <string>co_varnames</string> </key>
+ <value>
+ <tuple>
+ <string>_getattr_</string>
+ <string>context</string>
+ <string>request</string>
+ <string>portal</string>
+ <string>title</string>
+ <string>translateString</string>
+ <string>web_page_module</string>
+ <string>language</string>
+ <string>web_page</string>
+ <string>category_list</string>
+ <string>editable_mode</string>
+ <string>message</string>
+ <string>redirect_url</string>
+ </tuple>
+ </value>
+ </item>
+ </dictionary>
+ </state>
+ </object>
+ </value>
+ </item>
+ <item>
+ <key> <string>func_defaults</string> </key>
+ <value>
+ <none/>
+ </value>
+ </item>
+ <item>
+ <key> <string>id</string> </key>
+ <value> <string>WebSection_createNewWebPage</string> </value>
+ </item>
+ <item>
+ <key> <string>warnings</string> </key>
+ <value>
+ <tuple/>
+ </value>
+ </item>
+ </dictionary>
+ </pickle>
+ </record>
+</ZopeData>
Modified: erp5/trunk/bt5/erp5_web/bt/revision
URL: http://svn.erp5.org/erp5/trunk/bt5/erp5_web/bt/revision?rev=32508&r1=32507&r2=32508&view=diff
==============================================================================
--- erp5/trunk/bt5/erp5_web/bt/revision [utf8] (original)
+++ erp5/trunk/bt5/erp5_web/bt/revision [utf8] Fri Feb 12 17:29:02 2010
@@ -1,1 +1,1 @@
-905
+906
More information about the Erp5-report
mailing list