Back to index

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

List of all members.

Public Member Functions

def __init__
def get_default_type
def set_default_type
def get_allowed_types
def set_allowed_types
def get_enable_mediawiki
def set_enable_mediawiki
def get_wiki_enabled_types
def set_wiki_enabled_types
def wicked_settings
def unregister_wicked_types

Public Attributes

 context
 toggle_mediawiki

Properties

 default_type = property(get_default_type, set_default_type)
 allowed_types = property(get_allowed_types, set_allowed_types)
 enable_mediawiki = property(get_enable_mediawiki, set_enable_mediawiki)
 wiki_enabled_types

Detailed Description

Definition at line 116 of file markup.py.


Constructor & Destructor Documentation

Definition at line 121 of file markup.py.

00121 
00122     def __init__(self, context):
00123         super(MarkupControlPanelAdapter, self).__init__(context)
00124         self.context = context
00125         self.toggle_mediawiki = False

Here is the caller graph for this function:


Member Function Documentation

Definition at line 136 of file markup.py.

00136 
00137     def get_allowed_types(self):
00138         return getAllowedContentTypes(self.context)

Here is the call graph for this function:

Definition at line 128 of file markup.py.

00128 
00129     def get_default_type(self):
00130         return getDefaultContentType(self.context)

Here is the call graph for this function:

Definition at line 150 of file markup.py.

00150 
00151     def get_enable_mediawiki(self):
00152         return self.wicked_settings.enable_mediawiki

Definition at line 161 of file markup.py.

00161 
00162     def get_wiki_enabled_types(self):
00163         return self.wicked_settings.types_enabled

Definition at line 139 of file markup.py.

00139 
00140     def set_allowed_types(self, value):
00141         # The menu pretends to be a whitelist, but we are storing a blacklist
00142         # so that new types are available by default. So, we inverse the list.
00143         allowable_types = getAllowableContentTypes(self.context)
00144         forbidden_types = [t for t in allowable_types if t not in value]
00145         setForbiddenContentTypes(self.context, forbidden_types)

Here is the call graph for this function:

Definition at line 131 of file markup.py.

00131 
00132     def set_default_type(self, value):
00133         setDefaultContentType(self.context, value)

Here is the call graph for this function:

Definition at line 153 of file markup.py.

00153 
00154     def set_enable_mediawiki(self, value):
00155         settings = self.wicked_settings
00156         if settings.enable_mediawiki != value:
00157             self.toggle_mediawiki = True
00158             settings.enable_mediawiki = value

Here is the call graph for this function:

Definition at line 164 of file markup.py.

00164 
00165     def set_wiki_enabled_types(self, value):
00166         settings = self.wicked_settings
00167         if not self.toggle_mediawiki and value == settings.types_enabled:
00168             return
00169 
00170         self.unregister_wicked_types() # @@ use sets to avoid thrashing
00171         for name in value:
00172             reg = wicked_type_regs[name](self.context)
00173             if self.enable_mediawiki:
00174                 reg.txtfilter = BrackettedWickedFilter
00175             reg.handle()
00176 
00177         self.toggle_mediawiki = False
00178         settings.types_enabled = value

Here is the call graph for this function:

Unregisters all previous registration objects

Definition at line 187 of file markup.py.

00187 
00188     def unregister_wicked_types(self):
00189         """Unregisters all previous registration objects
00190         """
00191         for name in wicked_type_regs.keys():
00192             wicked_type_regs[name](self.context).handle(unregister=True)

Here is the caller graph for this function:

Definition at line 183 of file markup.py.

00183 
00184     def wicked_settings(self):
00185         ann = IAnnotations(self.context)
00186         return ann.setdefault(WICKED_SETTING_KEY, WickedSettings())

Here is the caller graph for this function:


Member Data Documentation

Definition at line 123 of file markup.py.

Definition at line 124 of file markup.py.


Property Documentation

Definition at line 146 of file markup.py.

Definition at line 134 of file markup.py.

Definition at line 159 of file markup.py.

Initial value:
property(get_wiki_enabled_types,
                                  set_wiki_enabled_types)

Definition at line 179 of file markup.py.


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