Back to index

plone3  3.1.7
Classes | Functions | Variables
CMFFormController.ControllerPageTemplate Namespace Reference

Classes

class  ControllerPageTemplate

Functions

def manage_addControllerPageTemplate

Variables

tuple manage_addControllerPageTemplateForm = PageTemplateFile('www/cptAdd', globals())

Function Documentation

def CMFFormController.ControllerPageTemplate.manage_addControllerPageTemplate (   self,
  id,
  title = None,
  text = None,
  REQUEST = None,
  submit = None 
)
Add a Controller Page Template with optional file content.

Definition at line 20 of file ControllerPageTemplate.py.

00020 
00021                                     REQUEST=None, submit=None):
00022     """Add a Controller Page Template with optional file content."""
00023 
00024     id = str(id)
00025     if REQUEST is None:
00026         self._setObject(id, ControllerPageTemplate(id, text))
00027         ob = getattr(self, id)
00028         if title:
00029             ob.pt_setTitle(title)
00030         return ob
00031     else:
00032         file = REQUEST.form.get('file')
00033         headers = getattr(file, 'headers', None)
00034         if headers is None or not file.filename:
00035             zpt = ControllerPageTemplate(id)
00036         else:
00037             zpt = ControllerPageTemplate(id, file, headers.get('content_type'))
00038 
00039         self._setObject(id, zpt)
00040 
00041         try:
00042             u = self.DestinationURL()
00043         except AttributeError:
00044             u = REQUEST['URL1']
00045 
00046         if submit == " Add and Edit ":
00047             u = "%s/%s" % (u, quote(id))
00048         REQUEST.RESPONSE.redirect(u+'/manage_main')
00049     return ''
00050 
# ###########################################################################

Here is the caller graph for this function:


Variable Documentation

tuple CMFFormController.ControllerPageTemplate.manage_addControllerPageTemplateForm = PageTemplateFile('www/cptAdd', globals())

Definition at line 15 of file ControllerPageTemplate.py.