Commit ad3c4de4 authored by Ivan Tyagov's avatar Ivan Tyagov

Support web mode as well.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36134 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent fd811856
...@@ -57,8 +57,12 @@ ...@@ -57,8 +57,12 @@
Add (if not present) gadgets to current knowledge pad.\n Add (if not present) gadgets to current knowledge pad.\n
"""\n """\n
\n \n
all_pads = [x for x in context.ERP5Site_getKnowledgePadListForUser(mode)]\n all_pads = [x for x in context.ERP5Site_getKnowledgePadListForUser(mode, default_pad_group)]\n
active_pad, all_pads = context.ERP5Site_getActiveKnowledgePadForUser(all_pads)\n if mode.startswith(\'web\'):\n
active_pad, all_pads = context.WebSite_getActiveKnowledgePadForUser(all_pads, default_pad_group)\n
else:\n
active_pad, all_pads = context.ERP5Site_getActiveKnowledgePadForUser(all_pads)\n
\n
active_pad = active_pad.getObject()\n active_pad = active_pad.getObject()\n
gadget_list = active_pad.contentValues(filter={\'portal_type\': \'Knowledge Box\'})\n gadget_list = active_pad.contentValues(filter={\'portal_type\': \'Knowledge Box\'})\n
contained_gadgets = [x.getSpecialiseValue().getRelativeUrl() \\\n contained_gadgets = [x.getSpecialiseValue().getRelativeUrl() \\\n
...@@ -84,7 +88,7 @@ return context.view()\n ...@@ -84,7 +88,7 @@ return context.view()\n
</item> </item>
<item> <item>
<key> <string>_params</string> </key> <key> <string>_params</string> </key>
<value> <string>gadget_relative_url, mode=\'erp5_front\'</string> </value> <value> <string>gadget_relative_url, mode=\'erp5_front\', default_pad_group=None</string> </value>
</item> </item>
<item> <item>
<key> <string>errors</string> </key> <key> <string>errors</string> </key>
...@@ -104,7 +108,7 @@ return context.view()\n ...@@ -104,7 +108,7 @@ return context.view()\n
<dictionary> <dictionary>
<item> <item>
<key> <string>co_argcount</string> </key> <key> <string>co_argcount</string> </key>
<value> <int>2</int> </value> <value> <int>3</int> </value>
</item> </item>
<item> <item>
<key> <string>co_varnames</string> </key> <key> <string>co_varnames</string> </key>
...@@ -112,6 +116,7 @@ return context.view()\n ...@@ -112,6 +116,7 @@ return context.view()\n
<tuple> <tuple>
<string>gadget_relative_url</string> <string>gadget_relative_url</string>
<string>mode</string> <string>mode</string>
<string>default_pad_group</string>
<string>append</string> <string>append</string>
<string>$append0</string> <string>$append0</string>
<string>_getiter_</string> <string>_getiter_</string>
...@@ -137,6 +142,7 @@ return context.view()\n ...@@ -137,6 +142,7 @@ return context.view()\n
<value> <value>
<tuple> <tuple>
<string>erp5_front</string> <string>erp5_front</string>
<none/>
</tuple> </tuple>
</value> </value>
</item> </item>
......
26 27
\ 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