Commit 8f975c03 authored by Kevin Deldycke's avatar Kevin Deldycke

Add default page edit link if section has one.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10114 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4e8d0457
...@@ -86,18 +86,22 @@ def addLink(doc, portal_type, level):\n ...@@ -86,18 +86,22 @@ def addLink(doc, portal_type, level):\n
}\n }\n
edit_links.append(new_link)\n edit_links.append(new_link)\n
\n \n
# Display current doc\n # Add "edit current object" action\n
current_doc = context\n current_doc = context\n
current_pt = current_doc.getPortalType()\n current_pt = current_doc.getPortalType()\n
addLink(current_doc, current_pt, \'Displayed\')\n addLink(current_doc, current_pt, \'Current\')\n
\n \n
# Display current doc\n # Add "edit parent section" action when WebPage is displayed\n
if current_pt == \'Web Page\':\n if current_pt == \'Web Page\':\n
parent_doc = current_doc.aq_parent\n parent_doc = current_doc.aq_parent\n
addLink(parent_doc, parent_doc.getPortalType(), \'Parent\')\n parent_pt = parent_doc.getPortalType()\n
\n if parent_pt in (\'Web Section\', \'Web Site\'):\n
\n addLink(parent_doc, parent_pt, \'Parent\')\n
\n \n
# Add "edit default page" action\n
default_page_doc = current_doc.WebSite_getDefaultWebPageValue()\n
if current_pt in (\'Web Section\', \'Web Site\') and default_page_doc:\n
addLink(default_page_doc, default_page_doc.getPortalType(), \'Default\')\n
\n \n
\n \n
return edit_links\n return edit_links\n
...@@ -151,6 +155,8 @@ return edit_links\n ...@@ -151,6 +155,8 @@ return edit_links\n
<string>_getattr_</string> <string>_getattr_</string>
<string>current_pt</string> <string>current_pt</string>
<string>parent_doc</string> <string>parent_doc</string>
<string>parent_pt</string>
<string>default_page_doc</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
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