Commit 6dcfcea4 authored by Ivan Tyagov's avatar Ivan Tyagov

Use a dedicated script to check if a Pad is empty or not.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42626 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a97f1901
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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
Is Knowledge Pad empty (i.e. no gadgets inside).\n
Use current Pad\'s layout.\n
"""\n
layout = context.KnowledgePad_getBoxColumnLayout()\n
return not sum([len(x) for x in layout])\n
</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>KnowledgePad_isEmpty</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -41,8 +41,7 @@
real_context python: options.get(\'real_context\', None);\n
cancel_url python: options.get(\'cancel_url\', None);\n
isAnon python: here.portal_membership.isAnonymousUser();\n
is_tab_empty python: (len(layout)==1 and len(layout[0])==0) or\n
(len(layout)==3 and len(layout[0]+layout[1]+layout[2])==0);\n
is_tab_empty here/KnowledgePad_isEmpty;\n
columns python: options.get(\'columns\', 3);\n
column_css_class python: test(isAnon, \n
\'portal-column portal-column-undraggable\', \n
......@@ -53,21 +52,19 @@
\n
<!-- Render pad columns -->\n
<tal:block tal:repeat="column_index python: range(0, columns)">\n
<div tal:attributes="class column_css_class;\n
id string:portal-column-${column_index}"\n
tal:condition="python: columns>=1+column_index">\n
<div tal:condition="python: columns>=1+column_index"\n
tal:attributes="class column_css_class;\n
id string:portal-column-${column_index}">\n
\n
<tal:block tal:condition="python: len(layout)>=1+column_index"\n
tal:replace="structure python:\n
here.KnowledgePad_viewColumnWidget(section_layout=layout[column_index],\n
real_context=real_context,\n
cancel_url=cancel_url)"/>\n
\n
</div>\n
</tal:block>\n
\n
</div>\n
</div>
]]></unicode> </value>
</item>
......@@ -85,7 +82,7 @@
</item>
<item>
<key> <string>output_encoding</string> </key>
<value> <string>utf-8</string> </value>
<value> <string>iso-8859-15</string> </value>
</item>
<item>
<key> <string>title</string> </key>
......
686
\ No newline at end of file
688
\ 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