Commit 5d160a66 authored by Romain Courteaud's avatar Romain Courteaud

Allow to sort the skin folder when creating a new skin selection.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28782 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a2977c9e
...@@ -210,12 +210,13 @@ def registerSkinFolder(skin_tool, skin_folder): ...@@ -210,12 +210,13 @@ def registerSkinFolder(skin_tool, skin_folder):
selection = skin_tool.getSkinPath(skin_name) or '' selection = skin_tool.getSkinPath(skin_name) or ''
selection_list = selection.split(',') selection_list = selection.split(',')
if (skin_folder_id not in selection_list) and (skin_name in skin_layer_list): if (skin_folder_id not in selection_list):
selection_list.insert(0, skin_folder_id) selection_list.insert(0, skin_folder_id)
if reorder_skin_selection: if reorder_skin_selection:
selection_list.sort( selection_list.sort(
key=lambda x: x in skin_tool.objectIds() and -skin_tool[x].getProperty( key=lambda x: x in skin_tool.objectIds() and -skin_tool[x].getProperty(
'business_template_skin_layer_priority', 0) or 0) 'business_template_skin_layer_priority', 0) or 0)
if (skin_name in skin_layer_list):
skin_tool.manage_skinLayers(skinpath=selection_list, skin_tool.manage_skinLayers(skinpath=selection_list,
skinname=skin_name, add_skin=1) skinname=skin_name, add_skin=1)
skin_tool.getPortalObject().changeSkin(None) skin_tool.getPortalObject().changeSkin(None)
......
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