Commit b30ca5c4 authored by Amos Latteier's avatar Amos Latteier

Changed helpValues to only report ProductHelps that actually have help. Also...

Changed helpValues to only report ProductHelps that actually have help. Also added support for smarter help registration.
parent b38dd699
...@@ -114,12 +114,15 @@ class HelpSystem(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -114,12 +114,15 @@ class HelpSystem(Acquisition.Implicit, ObjectManager, Item, Persistent):
def __init__(self, id): def __init__(self, id):
self.id=id self.id=id
def helpValues(self, spec=None): def helpValues(self, spec=None):
"ProductHelp objects of all Products" "ProductHelp objects of all Products that have help"
hv=[] hv=[]
for product in self.Control_Panel.Products.objectValues(): for product in self.Control_Panel.Products.objectValues():
hv.append(product.getProductHelp()) productHelp=product.getProductHelp()
# only list products that actually have help
if productHelp.helpValues():
hv.append(productHelp)
return hv return hv
# Seaching does an aggregated search of all ProductHelp # Seaching does an aggregated search of all ProductHelp
...@@ -156,9 +159,9 @@ class HelpSystem(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -156,9 +159,9 @@ class HelpSystem(Acquisition.Implicit, ObjectManager, Item, Persistent):
return self.button(self, self.REQUEST, product=product, topic=topic) return self.button(self, self.REQUEST, product=product, topic=topic)
helpURL=HTMLFile('helpURL',globals()) helpURL=HTMLFile('helpURL',globals())
class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent): class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent):
""" """
Manages a collection of Help Topics for a given Product. Manages a collection of Help Topics for a given Product.
...@@ -168,6 +171,8 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -168,6 +171,8 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent):
meta_type='Product Help' meta_type='Product Help'
icon='p_/ProductHelp_icon' icon='p_/ProductHelp_icon'
lastRegistered=None
meta_types=({'name':'Help Topic', meta_types=({'name':'Help Topic',
'action':'addTopicForm', 'action':'addTopicForm',
...@@ -214,7 +219,7 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -214,7 +219,7 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent):
if REQUEST is not None: if REQUEST is not None:
return self.manage_main(self, REQUEST, return self.manage_main(self, REQUEST,
manage_tabs_message='Help Topic added.') manage_tabs_message='Help Topic added.')
def helpValues(self, REQUEST=None): def helpValues(self, REQUEST=None):
""" """
Lists contained Help Topics. Lists contained Help Topics.
...@@ -236,6 +241,6 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent): ...@@ -236,6 +241,6 @@ class ProductHelp(Acquisition.Implicit, ObjectManager, Item, Persistent):
Searchable interface Searchable interface
""" """
return apply(self.catalog.__call__, args, kw) return apply(self.catalog.__call__, args, kw)
standard_html_header=HTMLFile('topic_header', globals()) standard_html_header=HTMLFile('topic_header', globals())
standard_html_footer=HTMLFile('topic_footer', globals()) standard_html_footer=HTMLFile('topic_footer', globals())
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