Blame view

product/Formulator/FieldHelpTopic.py 1 KB
1
from App.special_dtml import DTMLFile
Nicolas Delaby committed
2 3 4 5 6 7
from HelpSys import HelpTopic

class FieldHelpTopic(HelpTopic.HelpTopic):
    """A special help topic for fields.
    """
    meta_type = 'Help Topic'
Gabriel Monnerat committed
8

Nicolas Delaby committed
9 10 11 12 13
    def __init__(self, id, title, field_class,
                 permissions=None, categories=None):
        self.id = id
        self.title = title
        self.field_class = field_class
Gabriel Monnerat committed
14

Nicolas Delaby committed
15 16 17 18
        if permissions is not None:
            self.permissions = permissions
        if categories is not None:
            self.categories = categories
Gabriel Monnerat committed
19

Nicolas Delaby committed
20
    index_html = DTMLFile('dtml/FieldHelpTopic', globals())
Gabriel Monnerat committed
21

Nicolas Delaby committed
22 23 24 25 26 27 28 29 30 31 32 33 34
    def SearchableText(self):
        """Full text of the Help Topic, for indexing purposes."""
        return "" # return self.index_html()

    def get_groups(self):
        """Get form groups of this field.
        """
        return self.field_class.form.get_groups()

    def get_fields_in_group(self, group):
        """Get the fields in the group.
        """
        return self.field_class.form.get_fields_in_group(group)
Gabriel Monnerat committed
35