Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
plone.app.form.widgets.selectionwidget.LanguageDropdownChoiceWidget Class Reference
Inheritance diagram for plone.app.form.widgets.selectionwidget.LanguageDropdownChoiceWidget:
Inheritance graph
[legend]
Collaboration diagram for plone.app.form.widgets.selectionwidget.LanguageDropdownChoiceWidget:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def textForValue

Public Attributes

 languages

Detailed Description

A DropdownWidget which renders a localized language selection.

Definition at line 6 of file selectionwidget.py.


Constructor & Destructor Documentation

Initialize the widget.

Definition at line 10 of file selectionwidget.py.

00010 
00011     def __init__(self, field, request):
00012         """Initialize the widget."""
00013         super(LanguageDropdownChoiceWidget, self).__init__(field,
00014             field.vocabulary, request)
00015         portal_state = queryMultiAdapter((self.context, request),
00016                                          name=u'plone_portal_state')
00017         self.languages = portal_state.locale().displayNames.languages

Here is the call graph for this function:

Here is the caller graph for this function:


Member Function Documentation

Extract a string from the `term`.

The `term` must be a vocabulary tokenized term.

Definition at line 18 of file selectionwidget.py.

00018 
00019     def textForValue(self, term):
00020         """Extract a string from the `term`.
00021 
00022         The `term` must be a vocabulary tokenized term.
00023         """
00024         if ITitledTokenizedTerm.providedBy(term):
00025             title = self.languages.get(term.value, term.title)
00026             if title == term.value:
00027                 title = term.title
00028             return title
00029         return term.token

Here is the caller graph for this function:


Member Data Documentation

Definition at line 16 of file selectionwidget.py.


The documentation for this class was generated from the following file: