Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFDefault.browser.folder.FormViewBase Class Reference
Inheritance diagram for CMFDefault.browser.folder.FormViewBase:
Inheritance graph
[legend]
Collaboration diagram for CMFDefault.browser.folder.FormViewBase:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __call__
def form_action
def listButtonInfos
def listHiddenVarInfos

Private Member Functions

def _setRedirect

Detailed Description

Definition at line 44 of file folder.py.


Member Function Documentation

Definition at line 74 of file folder.py.

00074 
00075     def __call__(self, **kw):
00076         form = self.request.form
00077         for button in self._BUTTONS:
00078             if button['id'] in form:
00079                 for permission in button.get('permissions', ()):
00080                     if not self._checkPermission(permission):
00081                         break
00082                 else:
00083                     for transform in button.get('transform', ()):
00084                         status = getattr(self, transform)(**form)
00085                         if isinstance(status, bool):
00086                             status = (status,)
00087                         if len(status) > 1:
00088                             message = translate(status[1], self.context)
00089                             self.request.other['portal_status_message'] = message
00090                         if not status[0]:
00091                             return self.index()
00092                     if self._setRedirect(*button['redirect']):
00093                         return
00094         return self.index()

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFDefault.browser.folder.FormViewBase._setRedirect (   self,
  provider_id,
  action_path,
  keys = '' 
) [private]

Definition at line 48 of file folder.py.

00048 
00049     def _setRedirect(self, provider_id, action_path, keys=''):
00050         provider = self._getTool(provider_id)
00051         try:
00052             target = provider.getActionInfo(action_path, self.context)['url']
00053         except ValueError:
00054             target = self._getPortalURL()
00055 
00056         kw = {}
00057         message = self.request.other.get('portal_status_message', '')
00058         if message:
00059             if isinstance(message, unicode):
00060                 message = message.encode(self._getBrowserCharset())
00061             kw['portal_status_message'] = message
00062         for k in keys.split(','):
00063             k = k.strip()
00064             v = self.request.form.get(k, None)
00065             if v:
00066                 kw[k] = v
00067 
00068         query = kw and ( '?%s' % make_query(kw) ) or ''
00069         self.request.RESPONSE.redirect( '%s%s' % (target, query) )
00070 
00071         return True

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 96 of file folder.py.

00096 
00097     def form_action(self):
00098         return self._getViewURL()

Here is the call graph for this function:

Definition at line 100 of file folder.py.

00100 
00101     def listButtonInfos(self):
00102         form = self.request.form
00103         buttons = []
00104         for button in self._BUTTONS:
00105             if button.get('title', None):
00106                 for permission in button.get('permissions', ()):
00107                     if not self._checkPermission(permission):
00108                         break
00109                 else:
00110                     for condition in button.get('conditions', ()):
00111                         if not getattr(self, condition)():
00112                             break
00113                     else:
00114                         buttons.append({'name': button['id'],
00115                                         'value': button['title']})
00116         return tuple(buttons)

Here is the call graph for this function:

Definition at line 119 of file folder.py.

00119 
00120     def listHiddenVarInfos(self):
00121         kw = self._getHiddenVars()
00122         vars = [ {'name': name, 'value': value}
00123                  for name, value in html_marshal(**kw) ]
00124         return tuple(vars)
00125 

Here is the call graph for this function:


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