Commit 7938f17d authored by Mayoro Diagne's avatar Mayoro Diagne

2008-10-07: mayoro

- do not display Appendix when there is no class_method or property_sheet to display
- do not display class_method section or property_sheet section when it's empty

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@24081 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 875fe8f3
...@@ -188,70 +188,73 @@ for section in section_list:\n ...@@ -188,70 +188,73 @@ for section in section_list:\n
property_sheets_list+=results[2]\n property_sheets_list+=results[2]\n
\n \n
if portal_skin is not None and portal_skin=="ODT":\n if portal_skin is not None and portal_skin=="ODT":\n
result.append(\n if class_methods_list !=[] or property_sheets_list !=[]:\n
ReportSection(\n result.append(\n
level=2,\n ReportSection(\n
title="Appendix",\n level=2,\n
form_id=\'\')\n title="Appendix",\n
)\n form_id=\'\')\n
)\n
classmethods = dict().fromkeys([x for x in class_methods_list]).keys()\n classmethods = dict().fromkeys([x for x in class_methods_list]).keys()\n
class_list = dict().fromkeys([\'.\'.join(x.split(\'.\')[:-2]) for x in classmethods]).keys()\n class_list = dict().fromkeys([\'.\'.join(x.split(\'.\')[:-2]) for x in classmethods]).keys()\n
class_list.sort()\n class_list.sort()\n
propertysheet = dict(zip([x.split(\'/\')[-1] for x in property_sheets_list],property_sheets_list))\n propertysheet = dict(zip([x.split(\'/\')[-1] for x in property_sheets_list],property_sheets_list))\n
result.append(\n if classmethods !=[]:\n
ReportSection(\n
level=3,\n
title="Class Methods",\n
form_id=\'\')\n
)\n
for class_name in class_list:\n
classmethod = dict().fromkeys([x.split(\'.\')[-1] for x in classmethods if x.startswith(class_name)]).keys()\n
classmethod.sort()\n
result.append(\n result.append(\n
ReportSection(\n ReportSection(\n
level=4,\n level=3,\n
title=class_name,\n title="Class Methods",\n
form_id=\'\')\n form_id=\'\')\n
)\n )\n
for class_name in class_list:\n
classmethod = dict().fromkeys([x.split(\'.\')[-1] for x in classmethods if x.startswith(class_name)]).keys()\n
classmethod.sort()\n
result.append(\n
ReportSection(\n
level=4,\n
title=class_name,\n
form_id=\'\')\n
)\n
result.append(\n
ReportSection(\n
form_id=\'PortalTypeDocumentationHelperAppendixClassMethod_view\',\n
selection_params=dict(class_method_list=classmethod, obj=uri_object),\n
selection_name=\'class_method_selection\',\n
listbox_display_mode=\'FlatListMode\')\n
)\n
if propertysheet.keys() != []:\n
result.append(\n result.append(\n
ReportSection(\n ReportSection(\n
form_id=\'PortalTypeDocumentationHelperAppendixClassMethod_view\',\n level=3,\n
selection_params=dict(class_method_list=classmethod, obj=uri_object),\n title="Property Sheets",\n
selection_name=\'class_method_selection\',\n
listbox_display_mode=\'FlatListMode\')\n
)\n
result.append(\n
ReportSection(\n
level=3,\n
title="Property Sheets",\n
form_id=\'\')\n
)\n
result.append(\n
ReportSection(\n
form_id=\'PortalTypeDocumentationHelperAppendixPropertySheet_view\',\n
selection_params=dict(property_sheet_list=propertysheet.keys(), obj=uri_object),\n
selection_name=\'property_sheet_selection\',\n
listbox_display_mode=\'FlatListMode\')\n
)\n
class_name = \'PortalTypePropertySheetDocumentationHelper\'\n
propertysheets = propertysheet.values()\n
propertysheets.sort(compareFileName)\n
for uri in propertysheets:\n
result.append(\n
ReportSection(\n
level=4,\n
title=uri.split(\'/\')[-1].split(\'.\')[0],\n
form_id=\'\')\n form_id=\'\')\n
)\n )\n
result.append(\n result.append(\n
ReportSection(\n ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n form_id=\'PortalTypeDocumentationHelperAppendixPropertySheet_view\',\n
method_id=\'getDocumentationHelper\',\n selection_params=dict(property_sheet_list=propertysheet.keys(), obj=uri_object),\n
form_id=\'%s_view\' % class_name,\n selection_name=\'property_sheet_selection\',\n
param_list=[class_name,\n
uri],\n
listbox_display_mode=\'FlatListMode\')\n listbox_display_mode=\'FlatListMode\')\n
)\n )\n
class_name = \'PortalTypePropertySheetDocumentationHelper\'\n
propertysheets = propertysheet.values()\n
propertysheets.sort(compareFileName)\n
for uri in propertysheets:\n
result.append(\n
ReportSection(\n
level=4,\n
title=uri.split(\'/\')[-1].split(\'.\')[0],\n
form_id=\'\')\n
)\n
result.append(\n
ReportSection(\n
path=context.getPortalObject().portal_classes.getRelativeUrl(),\n
method_id=\'getDocumentationHelper\',\n
form_id=\'%s_view\' % class_name,\n
param_list=[class_name,\n
uri],\n
listbox_display_mode=\'FlatListMode\')\n
)\n
return result\n return result\n
</string> </value> </string> </value>
</item> </item>
......
146 148
\ 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