Logo Search packages:      
Sourcecode: zope-cmfmember version File versions  Download package

def CMFMember::tools::memberdatacontainer::MemberDataContainer::folder_delete (   self,
  REQUEST,
  RESPONSE 
)

Override the delete method to enable confirmation
    before deletion. 

Definition at line 291 of file memberdatacontainer.py.

00291                                               :
        """ Override the delete method to enable confirmation
            before deletion. """
        prefs_users_overview = self.restrictedTraverse('prefs_users_overview')
        if REQUEST.get('folder_confirm_delete'): 
            from Products.CMFPlone import transaction_note
            ids=REQUEST.get('ids', [])
            titles=[]
            titles_and_ids=[]
            
            status='failure'
            message='Please select one or more items to delete.'
            
            for id in ids:
                obj=self.restrictedTraverse(id)
                titles.append(obj.title_or_id())
                titles_and_ids.append('%s (%s)' % (obj.title_or_id(), obj.getId()))
            
            if ids:
                status='success'
                message=', '.join(titles)+' has been deleted.'
                transaction_note('Deleted %s from %s' % (', '.join(titles_and_ids), self.absolute_url()))
                self.manage_delObjects(ids)
            REQUEST['portal_status_message'] = message
            return prefs_users_overview(REQUEST, RESPONSE)
        else:
            REQUEST['folder_confirm_delete'] = True
            REQUEST['portal_status_message'] ='Confirm deletion by pressing the delete button again. %s' % REQUEST.get('ids')
            REQUEST['ids_checked'] = REQUEST.get('ids')
            return prefs_users_overview(REQUEST, RESPONSE)
           
    security.declarePrivate('_deleteMember')
    def _deleteMember(self, id):


Generated by  Doxygen 1.6.0   Back to index