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> <base_category_list>
<portal_type id="Gadget">
<item>gadget_type</item>
</portal_type>
<portal_type id="Knowledge Box"> <portal_type id="Knowledge Box">
<item>specialise</item> <item>specialise</item>
</portal_type> </portal_type>
......
...@@ -53,18 +53,25 @@ ...@@ -53,18 +53,25 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <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 This script is called by drag and drop javascript framework\n
when user click on \'Minimize\' button."""\n when user click on \'Minimize\' button.\n
\n """\n
box = context.restrictedTraverse(box_relative_url)\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 state = box.getValidationState()\n
if state == \'visible\':\n if state == \'visible\':\n
box.invisible()\n box.invisible()\n
elif state == \'invisible\':\n elif state == \'invisible\':\n
box.visible()\n box.visible()\n
return "OK"\n return "OK"\n
</string> </value>
]]></string> </value>
</item> </item>
<item> <item>
<key> <string>_code</string> </key> <key> <string>_code</string> </key>
...@@ -108,7 +115,9 @@ return "OK"\n ...@@ -108,7 +115,9 @@ return "OK"\n
<tuple> <tuple>
<string>box_relative_url</string> <string>box_relative_url</string>
<string>_getattr_</string> <string>_getattr_</string>
<string>splitted_box_relative_url</string>
<string>context</string> <string>context</string>
<string>_getitem_</string>
<string>box</string> <string>box</string>
<string>state</string> <string>state</string>
</tuple> </tuple>
......
...@@ -66,11 +66,11 @@ if not context.portal_membership.isAnonymousUser():\n ...@@ -66,11 +66,11 @@ if not context.portal_membership.isAnonymousUser():\n
l = []\n l = []\n
sub_items=item.split(\'|\')\n sub_items=item.split(\'|\')\n
# get box relative url\n # get box relative url\n
try: box_url=sub_items[0]\n splitted_box_url = sub_items[0].split(\'_\')\n
except indexError: pass\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 # remove box_relative_url from layout string\n
for sub_item in sub_items:\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 l.append(knowledge_box)\n
# join boxes\n # join boxes\n
new_user_layout.append(\'|\'.join(l))\n new_user_layout.append(\'|\'.join(l))\n
...@@ -137,10 +137,8 @@ return "OK"\n ...@@ -137,10 +137,8 @@ return "OK"\n
<string>l</string> <string>l</string>
<string>sub_items</string> <string>sub_items</string>
<string>_getitem_</string> <string>_getitem_</string>
<string>indexError</string> <string>splitted_box_url</string>
<string>sub_item</string> <string>sub_item</string>
<string>dummy1</string>
<string>dummy2</string>
<string>knowledge_box</string> <string>knowledge_box</string>
<string>knowledge_pad</string> <string>knowledge_pad</string>
<string>getattr</string> <string>getattr</string>
......
489 491
\ 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