[CMF-checkins] CVS: Products/CMFDefault/skins/zpt_control - folder_bottom_control.py:1.1 folder_copy_control.py:1.1 folder_cut_control.py:1.1 folder_delete_control.py:1.1 folder_down_control.py:1.1 folder_paste_control.py:1.1 folder_rename_control.py:1.1 folder_sort_control.py:1.1 folder_top_control.py:1.1 folder_up_control.py:1.1 folder_bottom.py:NONE folder_copy.py:NONE folder_cut.py:NONE folder_delete.py:NONE folder_down.py:NONE folder_paste.py:NONE folder_rename.py:NONE folder_sort.py:NONE folder_top.py:NONE folder_up.py:NONE

Yvo Schubbe y.2004_ at wcm-solutions.de
Tue Jul 6 16:34:17 EDT 2004


Update of /cvs-repository/Products/CMFDefault/skins/zpt_control
In directory cvs.zope.org:/tmp/cvs-serv28233/CMFDefault/skins/zpt_control

Added Files:
	folder_bottom_control.py folder_copy_control.py 
	folder_cut_control.py folder_delete_control.py 
	folder_down_control.py folder_paste_control.py 
	folder_rename_control.py folder_sort_control.py 
	folder_top_control.py folder_up_control.py 
Removed Files:
	folder_bottom.py folder_copy.py folder_cut.py folder_delete.py 
	folder_down.py folder_paste.py folder_rename.py folder_sort.py 
	folder_top.py folder_up.py 
Log Message:
- renamed folder_contents.pt and folder_rename_form.pt to folder_*_template.pt
- renamed folder_*_control.py to folder_contents.py and folder_rename_form.py: these scripts are now called directly
- renamed folder controllers to folder_*_control.py
- modified kw handling a bit to work with the new calling order


=== Added File Products/CMFDefault/skins/zpt_control/folder_bottom_control.py ===
##parameters=ids, **kw
##
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
    try:
        attempt = context.moveObjectsToBottom(ids, subset_ids=subset_ids)
    except TypeError:
        # Zope 2.7.0
        attempt = context.moveObjectsToBottom(ids)
    if attempt:
        return context.setStatus( True, '%d item%s moved to bottom.' %
                                    ( attempt, (attempt != 1 and 's' or '') ) )
    else:
        return context.setStatus(False, 'Nothing to change.')
except ValueError, errmsg:
    return context.setStatus(False, 'ValueError: %s' % errmsg)


=== Added File Products/CMFDefault/skins/zpt_control/folder_copy_control.py ===
##parameters=ids, **kw
##title=Copy objects from a folder to the clipboard
##
context.manage_copyObjects(ids, context.REQUEST)

return context.setStatus( True, 'Item%s copied.' %
                                ( len(ids) != 1 and 's' or '' ) )


=== Added File Products/CMFDefault/skins/zpt_control/folder_cut_control.py ===
##parameters=ids, **kw
##title=Cut objects from a folder and copy to the clipboard
##
context.manage_cutObjects(ids, context.REQUEST)

return context.setStatus( True, 'Item%s cut.' %
                                ( len(ids) != 1 and 's' or '' ) )


=== Added File Products/CMFDefault/skins/zpt_control/folder_delete_control.py ===
##parameters=ids, **kw
##title=Delete objects from a folder
##
context.manage_delObjects( list(ids) )

return context.setStatus( True, 'Item%s deleted.' %
                                ( len(ids) != 1 and 's' or '' ) )


=== Added File Products/CMFDefault/skins/zpt_control/folder_down_control.py ===
##parameters=ids, delta, **kw
##
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
    try:
        attempt = context.moveObjectsDown(ids, delta, subset_ids=subset_ids)
    except TypeError:
        # Zope 2.7.0
        attempt = context.moveObjectsDown(ids, delta)
    if attempt:
        return context.setStatus( True, '%d item%s moved down.' %
                                    ( attempt, (attempt != 1 and 's' or '') ) )
    else:
        return context.setStatus(False, 'Nothing to change.')
except ValueError, errmsg:
    return context.setStatus(False, 'ValueError: %s' % errmsg)


=== Added File Products/CMFDefault/skins/zpt_control/folder_paste_control.py ===
##parameters=**kw
##title=Paste objects to a folder from the clipboard
##
from Products.CMFDefault.exceptions import CopyError
from Products.CMFDefault.exceptions import zExceptions_Unauthorized

if context.cb_dataValid:
    try:
        result = context.manage_pasteObjects(context.REQUEST['__cp'])
        return context.setStatus( True, 'Item%s pasted.' %
                                        ( len(result) != 1 and 's' or '' ) )
    except CopyError:
        return context.setStatus(False, 'CopyError: Paste failed.')
    except zExceptions_Unauthorized:
        return context.setStatus(False, 'Unauthorized: Paste failed.')
else:
    return context.setStatus(False, 'Please copy or cut one or more items to'
                                    'paste first.')


=== Added File Products/CMFDefault/skins/zpt_control/folder_rename_control.py ===
##parameters=ids, new_ids, **kw
##title=Rename objects in a folder
##
from Products.CMFDefault.exceptions import CopyError

if not ids == new_ids:
    try:
        context.manage_renameObjects(ids, new_ids)
        return context.setStatus(True, 'Item%s renamed.' %
                                       ( len(ids) != 1 and 's' or '' ) )
    except CopyError:
        return context.setStatus(False, 'CopyError: Rename failed.')
else:
    return context.setStatus(False, 'Nothing to change.')


=== Added File Products/CMFDefault/skins/zpt_control/folder_sort_control.py ===
##parameters=key='position', reverse=0, **kw
##title=Sort objects in a folder
##
context.setDefaultSorting(key, reverse)

return context.setStatus(True)


=== Added File Products/CMFDefault/skins/zpt_control/folder_top_control.py ===
##parameters=ids, **kw
##
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
    try:
        attempt = context.moveObjectsToTop(ids, subset_ids=subset_ids)
    except TypeError:
        # Zope 2.7.0
        attempt = context.moveObjectsToTop(ids)
    if attempt:
        return context.setStatus( True, '%d item%s moved to top.' %
                                    ( attempt, (attempt != 1 and 's' or '') ) )
    else:
        return context.setStatus(False, 'Nothing to change.')
except ValueError, errmsg:
    return context.setStatus(False, 'ValueError: %s' % errmsg)


=== Added File Products/CMFDefault/skins/zpt_control/folder_up_control.py ===
##parameters=ids, delta, **kw
##
subset_ids = [ obj.getId() for obj in context.listFolderContents() ]
try:
    try:
        attempt = context.moveObjectsUp(ids, delta, subset_ids=subset_ids)
    except TypeError:
        # Zope 2.7.0
        attempt = context.moveObjectsUp(ids, delta)
    if attempt:
        return context.setStatus( True, '%d item%s moved up.' %
                                    ( attempt, (attempt != 1 and 's' or '') ) )
    else:
        return context.setStatus(False, 'Nothing to change.')
except ValueError, errmsg:
    return context.setStatus(False, 'ValueError: %s' % errmsg)

=== Removed File Products/CMFDefault/skins/zpt_control/folder_bottom.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_copy.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_cut.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_delete.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_down.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_paste.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_rename.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_sort.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_top.py ===

=== Removed File Products/CMFDefault/skins/zpt_control/folder_up.py ===



More information about the CMF-checkins mailing list