Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Properties
plone.app.controlpanel.language.LanguageControlPanelAdapter Class Reference
Inheritance diagram for plone.app.controlpanel.language.LanguageControlPanelAdapter:
Inheritance graph
[legend]
Collaboration diagram for plone.app.controlpanel.language.LanguageControlPanelAdapter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def get_default_language
def set_default_language
def get_use_combined_language_codes
def set_use_combined_language_codes

Public Attributes

 context

Properties

 default_language
 use_combined_language_codes

Detailed Description

Definition at line 42 of file language.py.


Constructor & Destructor Documentation

Definition at line 47 of file language.py.

00047 
00048     def __init__(self, context):
00049         super(LanguageControlPanelAdapter, self).__init__(context)
00050         self.context = getToolByName(context, 'portal_languages')

Here is the caller graph for this function:


Member Function Documentation

Definition at line 51 of file language.py.

00051 
00052     def get_default_language(self):
00053         return aq_inner(self.context).getDefaultLanguage()

Definition at line 66 of file language.py.

00066 
00067     def get_use_combined_language_codes(self):
00068         return aq_inner(self.context).use_combined_language_codes

Definition at line 54 of file language.py.

00054 
00055     def set_default_language(self, value):
00056         context = aq_inner(self.context)
00057         if isinstance(value, tuple):
00058             value = value[0]
00059         supported_langs = context.getSupportedLanguages()
00060         if value not in supported_langs:
00061             context.supported_langs = [value]
00062         context.setDefaultLanguage(value)

Definition at line 69 of file language.py.

00069 
00070     def set_use_combined_language_codes(self, value):
00071         context = aq_inner(self.context)
00072         # We are disabling the combined codes, but still have one selected
00073         # as the default.
00074         default = context.getDefaultLanguage()
00075         if len(default.split('-')) > 1:
00076             # XXX This should be done in some kind of validate method instead,
00077             # but I have no time to figure out that part of formlib right now
00078             request = context.REQUEST
00079             message = _(u"You cannot disable country-specific language "
00080                          "variants, please choose a different site "
00081                          "language first.")
00082             IStatusMessage(request).addStatusMessage(message, type='error')
00083         else:
00084             context.use_combined_language_codes = value

Here is the call graph for this function:


Member Data Documentation

Definition at line 49 of file language.py.


Property Documentation

Initial value:
property(get_default_language,
                                set_default_language)

Definition at line 63 of file language.py.

Initial value:
property(get_use_combined_language_codes,
                                           set_use_combined_language_codes)

Definition at line 85 of file language.py.


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