Commit 66788dc0 authored by Ivan Tyagov's avatar Ivan Tyagov

Use proper naming.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34227 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c828c5f3
<?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>"""\n
This script allows to create a new Discussion Thread.\n
"""\n
\n
portal = context.getPortalObject()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
version = \'001\'\n
language = portal.Localizer.get_selected_language()\n
discussion_thread = portal.discussion_thread_module.newContent(\n
portal_type = "Discussion Thread",\n
title = title,\n
source_value = person,\n
version = version,\n
language = language)\n
discussion_post = discussion_thread.newContent(\n
portal_type = "Discussion Post",\n
title = title,\n
text_content = text_content,\n
source_value = person,\n
version = version,\n
language = language)\n
\n
if person is None:\n
portal_status_message = "New discussion created. Your post will be reviewed for approval."\n
discussion_post.stack()\n
else:\n
portal_status_message = "New discussion created."\n
discussion_post.post()\n
\n
return discussion_thread.Base_redirect(form_id,\n
keep_items = dict(portal_status_message=context.Base_translateString(portal_status_message)))\n
</string> </value>
</item>
<item>
<key> <string>_code</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title, text_content, form_id, predecessor=None,**kw</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Assignee</string>
</tuple>
</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>4</int> </value>
</item>
<item>
<key> <string>co_varnames</string> </key>
<value>
<tuple>
<string>title</string>
<string>text_content</string>
<string>form_id</string>
<string>predecessor</string>
<string>kw</string>
<string>_getattr_</string>
<string>context</string>
<string>portal</string>
<string>person</string>
<string>version</string>
<string>language</string>
<string>discussion_thread</string>
<string>discussion_post</string>
<string>None</string>
<string>portal_status_message</string>
<string>dict</string>
</tuple>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>func_defaults</string> </key>
<value>
<tuple>
<none/>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>DiscussionThreadModule_createNewDiscussionThread</string> </value>
</item>
<item>
<key> <string>warnings</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
</item> </item>
<item> <item>
<key> <string>action</string> </key> <key> <string>action</string> </key>
<value> <string>DiscussionThread_newPost</string> </value> <value> <string>DiscussionThreadModule_createNewDiscussionThread</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -77,14 +77,15 @@ ...@@ -77,14 +77,15 @@
<item> <item>
<key> <string>bottom</string> </key> <key> <string>bottom</string> </key>
<value> <value>
<list/> <list>
<string>your_text_content</string>
</list>
</value> </value>
</item> </item>
<item> <item>
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list> <list>
<string>your_text_content</string>
<string>your_captcha</string> <string>your_captcha</string>
</list> </list>
</value> </value>
...@@ -114,7 +115,7 @@ ...@@ -114,7 +115,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>DiscussionThread_viewNewPostDialog</string> </value> <value> <string>DiscussionThreadModule_viewCreateNewDiscussionThreadDialog</string> </value>
</item> </item>
<item> <item>
<key> <string>method</string> </key> <key> <string>method</string> </key>
...@@ -138,7 +139,7 @@ ...@@ -138,7 +139,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>Post</string> </value> <value> <string>Create</string> </value>
</item> </item>
<item> <item>
<key> <string>unicode_mode</string> </key> <key> <string>unicode_mode</string> </key>
......
...@@ -13,11 +13,11 @@ ...@@ -13,11 +13,11 @@
<key> <string>delegated_list</string> </key> <key> <string>delegated_list</string> </key>
<value> <value>
<list> <list>
<string>css_class</string> <string>title</string>
<string>default</string> <string>default</string>
<string>editable</string> <string>css_class</string>
<string>text_editor</string> <string>text_editor</string>
<string>title</string> <string>editable</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -65,7 +65,9 @@ ...@@ -65,7 +65,9 @@
</item> </item>
<item> <item>
<key> <string>default</string> </key> <key> <string>default</string> </key>
<value> <string></string> </value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item> </item>
<item> <item>
<key> <string>editable</string> </key> <key> <string>editable</string> </key>
...@@ -86,7 +88,7 @@ ...@@ -86,7 +88,7 @@
<item> <item>
<key> <string>text_editor</string> </key> <key> <string>text_editor</string> </key>
<value> <value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> <persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value> </value>
</item> </item>
<item> <item>
...@@ -126,7 +128,7 @@ ...@@ -126,7 +128,7 @@
</item> </item>
<item> <item>
<key> <string>text_editor</string> </key> <key> <string>text_editor</string> </key>
<value> <string>text_area</string> </value> <value> <string>fck_editor</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
...@@ -149,7 +151,27 @@ ...@@ -149,7 +151,27 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string>python:(here.portal_preferences.getPreferredTextFormat() == \'text/html\' and here.portal_preferences.getPreferredTextEditor()) or \'text_area\'</string> </value> <value> <string encoding="cdata"><![CDATA[
python: " >%s" % (context.portal_catalog.getObject(here.DiscussionThread_getSelectedPost()).text_content.replace("<br />", "<br /> \\>"))
]]></string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>python:(here.portal_preferences.getPreferredTextFormat() == \'text/html\' and here.portal_preferences.getPreferreTextEditor()) or \'text_area\'d</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -55,14 +55,10 @@ ...@@ -55,14 +55,10 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>"""\n <value> <string>"""\n
This script allows to create a new Discussion Post in context.\n This script allows to create a new Discussion Post in context.\n
If user is not an ERP5 Person object we ask for validation, else we post\n
"""\n """\n
portal = context.getPortalObject()\n
\n \n
portal = context.getPortalObject()\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
# XXX: use ERP5Site_getUserPreference\n
#signature = portal.portal_preferences.getPreference(\'preferred_forum_signature\')\n
\n
version = \'001\'\n version = \'001\'\n
language = portal.Localizer.get_selected_language()\n language = portal.Localizer.get_selected_language()\n
discussion_post = context.newContent(\n discussion_post = context.newContent(\n
...@@ -71,15 +67,14 @@ discussion_post = context.newContent(\n ...@@ -71,15 +67,14 @@ discussion_post = context.newContent(\n
text_content = text_content,\n text_content = text_content,\n
source_value = person,\n source_value = person,\n
predecessor_value = predecessor,\n predecessor_value = predecessor,\n
#signature = signature,\n
version = version,\n version = version,\n
language = language)\n language = language)\n
\n \n
if person is None:\n if person is None:\n
portal_status_message = "New reply created. Your post will be reviewed for approval."\n portal_status_message = "New post created. Your post will be reviewed for approval."\n
discussion_post.stack()\n discussion_post.stack()\n
else:\n else:\n
portal_status_message = "New reply created."\n portal_status_message = "New post created."\n
discussion_post.post()\n discussion_post.post()\n
\n \n
return context.Base_redirect(form_id,\n return context.Base_redirect(form_id,\n
......
...@@ -85,7 +85,9 @@ ...@@ -85,7 +85,9 @@
<item> <item>
<key> <string>center</string> </key> <key> <string>center</string> </key>
<value> <value>
<list/> <list>
<string>your_captcha</string>
</list>
</value> </value>
</item> </item>
<item> <item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="CaptchaField" module="Products.ERP5Form.CaptchaField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_CaptchaField__extraPropertyList</string> </key>
<value>
<list>
<string>captcha_dot_net_client</string>
<string>captcha_dot_net_secret</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>your_captcha</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>wrong_captcha</string> </key>
<value> <string>You did not enter the right answer.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>captcha_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>captcha_type</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>captcha_dot_net_client</string> </key>
<value> <string>demo</string> </value>
</item>
<item>
<key> <string>captcha_dot_net_secret</string> </key>
<value> <string>secret</string> </value>
</item>
<item>
<key> <string>captcha_type</string> </key>
<value> <string>text</string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Captcha</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<tuple>
<global name="TALESMethod" module="Products.Formulator.TALESField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_text</string> </key>
<value> <string>here/portal_membership/isAnonymousUser</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: \'<a class="bt-small" style="width:250px;" href="%s/DiscussionThread_viewNewPostDialog?cancel_url=%s"><span><img src="km_img/icon-add.png" alt="+"/> Add New Discussion Thread</span></a>\' %(here.getWebSiteValue().absolute_url(), here.absolute_url()) python: \'<a class="bt-small" style="width:250px;" href="%s/discussion_thread_module/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog?cancel_url=%s"><span><img src="km_img/icon-add.png" alt="+"/> Add New Discussion Thread</span></a>\' %(here.getWebSiteValue().absolute_url(), here.absolute_url())
]]></string> </value> ]]></string> </value>
</item> </item>
......
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<key> <string>_text</string> </key> <key> <string>_text</string> </key>
<value> <string encoding="cdata"><![CDATA[ <value> <string encoding="cdata"><![CDATA[
python: \'<a class="bt-small" style="width:250px;" href="%s/DiscussionThread_viewNewPostDialog?cancel_url=%s"><span><img src="km_img/icon-add.png" alt="+"/> Add New Discussion Thread</span></a>\' %(here.getWebSiteValue().absolute_url(), here.absolute_url()) python: \'<a class="bt-small" style="width:250px;" href="%s/discussion_thread_module/DiscussionThreadModule_viewCreateNewDiscussionThreadDialog?cancel_url=%s"><span><img src="km_img/icon-add.png" alt="+"/> Add New Discussion Thread</span></a>\' %(here.getWebSiteValue().absolute_url(), here.absolute_url())
]]></string> </value> ]]></string> </value>
</item> </item>
......
27 29
\ 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