Commit ced430c1 authored by Jean-Paul Smets's avatar Jean-Paul Smets

title moved to left on getVariationCategoryItemList


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@189 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a62b50d2
...@@ -69,13 +69,13 @@ class Variated(Base): ...@@ -69,13 +69,13 @@ class Variated(Base):
security.declareProtected(Permissions.AccessContentsInformation, 'getVariationCategoryItemList') security.declareProtected(Permissions.AccessContentsInformation, 'getVariationCategoryItemList')
def getVariationCategoryItemList(self, base_category_list = (), base=1, def getVariationCategoryItemList(self, base_category_list = (), base=1,
method_id='getTitle', start_with_item=None): method_id='getTitle', current_category=None):
""" """
Returns the list of possible variation items Returns the list of possible variation items
""" """
variation_category_item_list = [] variation_category_item_list = []
if start_with_item is not None: if current_category is not None:
variation_category_item_list.append(start_with_item) variation_category_item_list.append(current_category)
variation_category_list = self.getVariationCategoryList(base_category_list=base_category_list) variation_category_list = self.getVariationCategoryList(base_category_list=base_category_list)
for variation_category in variation_category_list: for variation_category in variation_category_list:
resource = self.portal_categories.resolveCategory(variation_category) resource = self.portal_categories.resolveCategory(variation_category)
...@@ -85,7 +85,7 @@ class Variated(Base): ...@@ -85,7 +85,7 @@ class Variated(Base):
else: else:
index = variation_category.find('/') + 1 index = variation_category.find('/') + 1
label = variation_category[index:] label = variation_category[index:]
variation_category_item_list.append((label, value)) variation_category_item_list.append((value, label))
return variation_category_item_list return variation_category_item_list
security.declareProtected(Permissions.ModifyPortalContent, '_setVariationCategoryList') security.declareProtected(Permissions.ModifyPortalContent, '_setVariationCategoryList')
...@@ -127,7 +127,7 @@ class Variated(Base): ...@@ -127,7 +127,7 @@ class Variated(Base):
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getVariationRangeBaseCategoryItemList') 'getVariationRangeBaseCategoryItemList')
def getVariationRangeBaseCategoryItemList(self, base=1, method_id='getTitle', start_with_item=None): def getVariationRangeBaseCategoryItemList(self, base=1, method_id='getTitle', current_category=None):
""" """
Returns possible variations of the resource Returns possible variations of the resource
as a list of tuples (id, title). This is mostly as a list of tuples (id, title). This is mostly
......
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