Skip to content
This repository has been archived by the owner on Sep 28, 2020. It is now read-only.

Commit

Permalink
Merged yuppie-ordersupport-branch:
Browse files Browse the repository at this point in the history
- Added OrderSupport and OrderedFolder.
- Added optional 'id' argument to Folder constructor.
- Modified main.dtml to play well with Folder and OrderedFolder.
  • Loading branch information
Unknown committed Jun 12, 2003
1 parent 379a1ce commit d642da4
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 10 deletions.
28 changes: 18 additions & 10 deletions __init__.py
Expand Up @@ -11,13 +11,16 @@
#
##############################################################################
__doc__='''Object system core
$Id: __init__.py,v 1.37 2002/08/14 22:16:04 mj Exp $'''
__version__='$Revision: 1.37 $'[11:-2]
$Id: __init__.py,v 1.38 2003/06/12 10:21:01 yuppie Exp $'''
__version__='$Revision: 1.38 $'[11:-2]

import Version, OFS.Image, OFS.Folder, AccessControl.User
import OFS.DTMLMethod, OFS.DTMLDocument, OFS.PropertySheets
import OFS.OrderedFolder
import ZClasses.ObjectManager

from AccessControl.Permissions import add_documents_images_and_files
from AccessControl.Permissions import add_folders
from ZClasses import createZClassForBase

createZClassForBase( OFS.DTMLMethod.DTMLMethod, globals()
Expand All @@ -30,6 +33,7 @@
, 'ZFile', 'File' )
createZClassForBase( OFS.Folder.Folder, globals()
, 'ZFolder', 'Folder' )
createZClassForBase( OFS.OrderedFolder.OrderedFolder, globals() )
createZClassForBase( AccessControl.User.UserFolder, globals()
, 'ZUserFolder', 'User Folder' )
createZClassForBase( AccessControl.User.User, globals()
Expand All @@ -39,11 +43,9 @@
# that this more direct mechanism will be more understandable.
def initialize(context):

perm='Add Documents, Images, and Files'

context.registerClass(
OFS.DTMLMethod.DTMLMethod,
permission=perm,
permission=add_documents_images_and_files,
constructors=(OFS.DTMLMethod.addForm, OFS.DTMLMethod.addDTMLMethod,),
icon='images/dtmlmethod.gif',
legacy=(
Expand All @@ -54,27 +56,25 @@ def initialize(context):

context.registerClass(
OFS.DTMLDocument.DTMLDocument,
permission=perm,
permission=add_documents_images_and_files,
constructors=(OFS.DTMLDocument.addForm,
OFS.DTMLDocument.addDTMLDocument),
icon='images/dtmldoc.gif',
legacy=(('manage_addDTMLDocument', OFS.DTMLDocument.addDTMLDocument),),
)


context.registerClass(
OFS.Image.Image,
permission=perm,
permission=add_documents_images_and_files,
constructors=(('imageAdd',OFS.Image.manage_addImageForm),
OFS.Image.manage_addImage),
icon='images/Image_icon.gif',
legacy=(OFS.Image.manage_addImage,),
)


context.registerClass(
OFS.Image.File,
permission=perm,
permission=add_documents_images_and_files,
constructors=(('fileAdd',OFS.Image.manage_addFileForm),
OFS.Image.manage_addFile),
icon='images/File_icon.gif',
Expand All @@ -89,6 +89,14 @@ def initialize(context):
legacy=(OFS.Folder.manage_addFolder,),
)

context.registerClass(
OFS.OrderedFolder.OrderedFolder,
permission=add_folders,
constructors=(OFS.OrderedFolder.manage_addOrderedFolderForm,
OFS.OrderedFolder.manage_addOrderedFolder),
icon='images/Folder_icon.gif',
legacy=(OFS.OrderedFolder.manage_addOrderedFolder,),
)

context.registerClass(
AccessControl.User.UserFolder,
Expand Down
89 changes: 89 additions & 0 deletions help/OrderSupport_Contents.stx
@@ -0,0 +1,89 @@
ObjectManager with OrderSupport - Contents: Edit contained objects.

Description

This view displays the contained objects and allows you to add,
delete, change and order them.

Each contained object is displayed on a line and is identified by
an icon, an id and a title in parenthesis. Additionally, the size
(if applicable) and the date during which the object was last modified
are displayed. You can manage an object by clicking on its identifying
link.

Sorting vs. Ordering

You can sort contained objects by type, name (id), size,
modification date or by position (fixed order, see below). To do so,
click on the appropriate column heading. Clicking a second time
on any column heading (except position) will reverse the sort
on that field. Sorting takes no actions on the contained
objects, but will only change the users personal point of view.

You can order contained objects with the controls on the bottom
of the page. The order of objects ('sort by position') is stored
in the database and remains fixed until it is changed by another
user.

Versions

If you are currently working in a version there will be a
notice at the top of the list of objects indicating this.

If there is a red diamond following the name of an object this
indicates that the object has been modified in the version you
are currently working in. If there is a red diamond with a lock
after an object, this indicates the the object has been modified
in another version.

Controls

'[Checkbox]' -- Selects the object in order to perform operations
on it. The operations you can perform are rename, cut, copy,
delete, and export. Some operations may not be visible if they are
not allowed.

'Rename' -- Changes the ids of the selected objects.

'Cut' -- Cuts selected objects and place them into the
clipboard. This is similar to cut in most file managers. Cut
objects can be pasted in a new location. When cut objects are
pasted into another location the old objects are deleted.

'Copy' -- Copies selected objects and place them in the
clipboard. This is similar to copy in most file managers. Copied
objects can be pasted in a new location.

'Paste' -- Allows you to paste objects from the clipboard into
this object. **Note: This option will only appear if objects have
previously been copied or cut.**

'Delete' -- Deletes the selected objects. Deleted objects are
*not* placed in the clipboard.

'Import/Export' -- Imports or exports a Zope object.

'Available Objects' -- Selects a type of object to add.

'Add' -- Adds an object specified in 'Available Objects'.

'Select All (Deselect All)' -- Toggles between selecting and
deselecting each item currently displayed in the contents view.
**Note: This control will only appear if your browser is
javascript-enabled.**

'Set View as Default' -- Sets current sorted view as default contents view
for this folder. **Note: This option will only appear if your current
sorted view is not the default view.**

**The following options will only appear in Position view:**

'Up' -- Moves selected objects up by the selected amount of steps
(default is 1).

'Down' -- Moves selected objects down by the selected amount of steps
(default is 1).

'Top' -- Moves selected objects to the top of the page.

'Bottom' -- Moves selected objects to the bottom of the page.

0 comments on commit d642da4

Please sign in to comment.