Back to index

plone3  3.1.7
Public Member Functions
kss.core.plugins.core.demo.demoregistry.DemoRegistry Class Reference
Inheritance diagram for kss.core.plugins.core.demo.demoregistry.DemoRegistry:
Inheritance graph
[legend]
Collaboration diagram for kss.core.plugins.core.demo.demoregistry.DemoRegistry:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getDemo
def getHTMLHelp
def getPackagePath
def displayHelp
def hideHelp

Detailed Description

Definition at line 24 of file demoregistry.py.


Member Function Documentation

Definition at line 54 of file demoregistry.py.

00054 
00055     def displayHelp(self, viewname):
00056         html = '<h1>Description</h1><div>%s</div>' % self.getHTMLHelp(viewname)
00057         self.getCommandSet('core').replaceInnerHTML('div#help', html)
00058         self.getCommandSet('core').addClass('a#displayHelp', 'hidden')
00059         self.getCommandSet('core').removeClass('a#hideHelp', 'hidden')
00060         return self.render()

Definition at line 26 of file demoregistry.py.

00026 
00027     def getDemo(self, viewname):
00028         kssdemos = KSSCoreDemos().demos
00029         for demo in kssdemos:
00030             if demo.page_url==viewname + '.html':
00031                 return demo
00032         return None

Here is the caller graph for this function:

Definition at line 33 of file demoregistry.py.

00033 
00034     def getHTMLHelp(self, viewname):
00035         demo = self.getDemo(viewname)
00036         packagePath = self.getPackagePath(viewname)
00037         helpfile = demo.helpfile
00038         if not packagePath or not helpfile:
00039             return ''
00040         file = open(packagePath + '/' + helpfile)
00041         rtext = file.read()
00042         file.close()
00043         html = HTML(rtext)
00044         return html

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 45 of file demoregistry.py.

00045 
00046     def getPackagePath(self, viewname):
00047         demo = self.getDemo(viewname)
00048         packageName = demo.packageName
00049         if not packageName:
00050             return None
00051         module = resolve(packageName)
00052         packagePath = '/'.join(module.__file__.split('/')[:-1])
00053         return packagePath

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 61 of file demoregistry.py.

00061 
00062     def hideHelp(self):
00063         self.getCommandSet('core').replaceInnerHTML('div#help', '')
00064         self.getCommandSet('core').removeClass('a#displayHelp', 'hidden')
00065         self.getCommandSet('core').addClass('a#hideHelp', 'hidden')
00066         return self.render()

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