Commit 4044360d authored by Ivan Tyagov's avatar Ivan Tyagov

In r33683 knowledge pad HTML id elements formatchanged.

As this id are used to toggle and move gadgets in Zope server adjust accordingly respective scripts.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33694 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a70226a7
<base_category_list>
<portal_type id="Gadget">
<item>gadget_type</item>
</portal_type>
<portal_type id="Knowledge Box">
<item>specialise</item>
</portal_type>
......
......@@ -53,18 +53,25 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>""" \n
<value> <string encoding="cdata"><![CDATA[
""" \n
This script is called by drag and drop javascript framework\n
when user click on \'Minimize\' button."""\n
\n
box = context.restrictedTraverse(box_relative_url)\n
when user click on \'Minimize\' button.\n
"""\n
# format to Zope relative URL (\'knowledge_pad_module_3_4\' -> \'knowledge_pad_module/3/4\')\n
splitted_box_relative_url = box_relative_url.split(\'_\')\n
box = context.restrictedTraverse(\'knowledge_pad_module/%s/%s\' %(splitted_box_relative_url[-2], \n
splitted_box_relative_url[-1]))\n
state = box.getValidationState()\n
if state == \'visible\':\n
box.invisible()\n
elif state == \'invisible\':\n
box.visible()\n
return "OK"\n
</string> </value>
]]></string> </value>
</item>
<item>
<key> <string>_code</string> </key>
......@@ -108,7 +115,9 @@ return "OK"\n
<tuple>
<string>box_relative_url</string>
<string>_getattr_</string>
<string>splitted_box_relative_url</string>
<string>context</string>
<string>_getitem_</string>
<string>box</string>
<string>state</string>
</tuple>
......
......@@ -66,11 +66,11 @@ if not context.portal_membership.isAnonymousUser():\n
l = []\n
sub_items=item.split(\'|\')\n
# get box relative url\n
try: box_url=sub_items[0]\n
except indexError: pass\n
splitted_box_url = sub_items[0].split(\'_\')\n
box_url=\'knowledge_pad_module/%s/%s\' %(splitted_box_url[-2], splitted_box_url[-1]) \n
# remove box_relative_url from layout string\n
for sub_item in sub_items:\n
dummy1, dummy2, knowledge_box = sub_item.split(\'/\')\n
knowledge_box = sub_item.split(\'_\')[-1]\n
l.append(knowledge_box)\n
# join boxes\n
new_user_layout.append(\'|\'.join(l))\n
......@@ -137,10 +137,8 @@ return "OK"\n
<string>l</string>
<string>sub_items</string>
<string>_getitem_</string>
<string>indexError</string>
<string>splitted_box_url</string>
<string>sub_item</string>
<string>dummy1</string>
<string>dummy2</string>
<string>knowledge_box</string>
<string>knowledge_pad</string>
<string>getattr</string>
......
489
\ No newline at end of file
491
\ 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