Back to index

plone3  3.1.7
Public Member Functions | Static Public Attributes Class Reference
Inheritance diagram for
Inheritance graph
Collaboration diagram for
Collaboration graph

List of all members.

Public Member Functions

def __call__
def referer
def nextURL
def handle_save_action
def handle_cancel_action

Static Public Attributes

tuple form_name = _(u"Configure portlet")
 validator = null_validator,
string name = u'cancel'

Detailed Description

A base add form for portlets.

Use this for portlet assignments that require configuration before being 
added. Assignment types that do not should use NullAddForm instead.

Sub-classes should define create() and set the form_fields class variable.

Notice the suble difference between AddForm and NullAddform in that the
create template method for AddForm takes as a parameter a dict 'data':

    def create(self, data):
        return MyAssignment(data.get('foo'))
whereas the NullAddForm has no data parameter:

    def create(self):
        return MyAssignment()

Definition at line 27 of file

Member Function Documentation

Definition at line 51 of file

00052     def __call__(self):
00053         IPortletPermissionChecker(aq_parent(aq_inner(self.context)))()
00054         return super(AddForm, self).__call__()

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 75 of file

00076     def handle_cancel_action(self, action, data):
00077         nextURL = self.nextURL()
00078         if nextURL:
00079             self.request.response.redirect(self.nextURL())
00080         return ''

Here is the call graph for this function:

Definition at line 69 of file

00070     def handle_save_action(self, action, data):
00071         self.createAndAdd(data)

Definition at line 58 of file

00059     def nextURL(self):
00060         referer = self.request.form.get('referer')
00061         if referer:
00062             return referer
00063         else:
00064             addview = aq_parent(aq_inner(self.context))
00065             context = aq_parent(aq_inner(addview))
00066             url = str(getMultiAdapter((context, self.request), name=u"absolute_url"))
00067             return url + '/@@manage-portlets'

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 55 of file

00056     def referer(self):
00057         return self.request.get('referer', '')

Member Data Documentation

tuple = _(u"Configure portlet") [static]

Definition at line 49 of file

Definition at line 74 of file

Definition at line 73 of file

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