Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes
plone.app.layout.presentation.presentation.PresentationView Class Reference
Inheritance diagram for plone.app.layout.presentation.presentation.PresentationView:
Inheritance graph
[legend]
Collaboration diagram for plone.app.layout.presentation.presentation.PresentationView:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __call__
def body
def enabled
def content
def creator
def author
def authorname

Static Public Attributes

tuple template = ViewPageTemplateFile('presentation.pt')

Detailed Description

Definition at line 11 of file presentation.py.


Member Function Documentation

Definition at line 14 of file presentation.py.

00014 
00015     def __call__(self):
00016         return self.template()

Here is the caller graph for this function:

Definition at line 75 of file presentation.py.

00075 
00076     def author(self):
00077         membership = getToolByName(self.context, "portal_membership")
00078         return membership.getMemberInfo(self.creator())

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 80 of file presentation.py.

00080 
00081     def authorname(self):
00082         author = self.author()
00083         return author and author['fullname'] or self.creator()
00084 

Here is the call graph for this function:

Definition at line 18 of file presentation.py.

00018 
00019     def body(self):
00020         return self.context.CookedBody()

Here is the caller graph for this function:

Definition at line 42 of file presentation.py.

00042 
00043     def content(self):
00044         # ugly, ugly, ugly code, that basically changes the way the slide is put
00045         # together this should be a HTML parser or XSLT or even JS
00046 
00047         body = self.body()
00048 
00049         # this should be a regex too, but hey this works
00050         tags = ["h1", "H1", "h2", "H2"]
00051         tag = None
00052         for t in tags:
00053             if body.find("<%s>" % t) > -1:
00054                 tag = t
00055                 break
00056 
00057         num = int(tag[1])
00058         if num > 1:
00059             new = "%s1" % (tag[0])
00060             body = body.replace("<%s>" % tag, "<%s>" % new)
00061             body = body.replace("</%s>" % tag, "</%s>" % new)
00062             tag = new
00063 
00064         body = body.split('<%s>' % tag)
00065         body = ('</div>\n<div class="slide">\n<%s>' % tag).join(body)
00066         body = body.split('</%s>' % tag)
00067         body = ('</%s>\n' % tag).join(body)
00068 
00069         return body

Here is the call graph for this function:

Definition at line 71 of file presentation.py.

00071 
00072     def creator(self):
00073         return self.context.Creator()

Here is the caller graph for this function:

Definition at line 22 of file presentation.py.

00022 
00023     def enabled(self):
00024         getPresentation = getattr(self.context.aq_base, "getPresentation", None)
00025         if getPresentation is None or getPresentation() == False:
00026             return False
00027 
00028         body = self.body()
00029 
00030         # this should be a regex too, but hey this works
00031         tags = ["h1", "H1", "h2", "H2"]
00032         tag = None
00033         for t in tags:
00034             if body.find("<%s>" % t) > -1:
00035                 tag = t
00036                 break
00037 
00038         if tag is None:
00039             return False
00040 
00041         return True

Here is the call graph for this function:


Member Data Documentation

tuple plone.app.layout.presentation.presentation.PresentationView.template = ViewPageTemplateFile('presentation.pt') [static]

Definition at line 12 of file presentation.py.


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