Back to index

plone3  3.1.7
Public Member Functions
ResourceRegistries.browser.styles.StylesView Class Reference
Inheritance diagram for ResourceRegistries.browser.styles.StylesView:
Inheritance graph
[legend]
Collaboration diagram for ResourceRegistries.browser.styles.StylesView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def registry
def skinname
def styles

Detailed Description

Information for style rendering. 

Definition at line 7 of file styles.py.


Member Function Documentation

Definition at line 10 of file styles.py.

00010 
00011     def registry(self):
00012         return getToolByName(aq_inner(self.context), 'portal_css')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 13 of file styles.py.

00013 
00014     def skinname(self):
00015         return self.context.getCurrentSkinName()

Here is the caller graph for this function:

Definition at line 16 of file styles.py.

00016 
00017     def styles(self):
00018         registry = self.registry()
00019         registry_url = registry.absolute_url()
00020 
00021         styles = registry.getEvaluatedResources(self.context)
00022         skinname = url_quote(self.skinname())
00023         result = []
00024         for style in styles:
00025             rendering = style.getRendering()
00026             if rendering == 'link':
00027                 src = "%s/%s/%s" % (registry_url, skinname, style.getId())
00028                 data = {'rendering': rendering,
00029                         'media': style.getMedia(),
00030                         'rel': style.getRel(),
00031                         'title': style.getTitle(),
00032                         'src': src}
00033             elif rendering == 'import':
00034                 src = "%s/%s/%s" % (registry_url, skinname, style.getId())
00035                 data = {'rendering': rendering,
00036                         'media': style.getMedia(),
00037                         'src': src}
00038             elif rendering == 'inline':
00039                 content = registry.getInlineResource(style.getId(),
00040                                                      self.context)
00041                 data = {'rendering': rendering,
00042                         'media': style.getMedia(),
00043                         'content': content}
00044             else:
00045                 raise ValueError, "Unkown rendering method '%s' for style '%s'" % (rendering, style.getId())
00046             result.append(data)
00047         return result

Here is the call graph for this function:


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