| 1 | from Products.Archetypes.public import process_types, listTypes |
|---|
| 2 | from Products.CMFCore import utils |
|---|
| 3 | from Products.CMFCore.DirectoryView import registerDirectory |
|---|
| 4 | |
|---|
| 5 | from Products.ShoeBox.config import PROJECTNAME, \ |
|---|
| 6 | ADD_ACCOUNT_PERMISSION, ADD_ENTRY_PERMISSION, \ |
|---|
| 7 | ADD_SHOEBOX_PERMISSION, SKINS_DIR, GLOBALS |
|---|
| 8 | |
|---|
| 9 | ## Add each skin folder here |
|---|
| 10 | #registerDirectory(SKINS_DIR + '/newdir', GLOBALS) |
|---|
| 11 | registerDirectory(SKINS_DIR + '/ShoeBox', GLOBALS) |
|---|
| 12 | |
|---|
| 13 | def initialize(context): |
|---|
| 14 | ## |
|---|
| 15 | ## Adds validation |
|---|
| 16 | ## |
|---|
| 17 | # import ShoeBoxValidation |
|---|
| 18 | # from Products.validation import validation |
|---|
| 19 | |
|---|
| 20 | # AllowedUrl = ShoeBoxValidation.AllowedUrl("isAllowedUrl", PROTOCOLS,) |
|---|
| 21 | # validation.register(AllowedUrl) |
|---|
| 22 | |
|---|
| 23 | ## Import Types here to register them |
|---|
| 24 | import ShoeBox, ShoeBoxAccount, ShoeBoxEntry |
|---|
| 25 | |
|---|
| 26 | ## |
|---|
| 27 | ## Adds the new content type |
|---|
| 28 | ## |
|---|
| 29 | content_types, constructors, ftis = process_types( |
|---|
| 30 | listTypes(PROJECTNAME), PROJECTNAME) |
|---|
| 31 | |
|---|
| 32 | utils.ContentInit( |
|---|
| 33 | PROJECTNAME + ' Content', |
|---|
| 34 | content_types = content_types, |
|---|
| 35 | permission = ADD_SHOEBOX_PERMISSION, |
|---|
| 36 | extra_constructors = constructors, |
|---|
| 37 | fti = ftis, |
|---|
| 38 | ).initialize(context) |
|---|
| 39 | # utils.ContentInit( |
|---|
| 40 | # PROJECTNAME + ' Content', |
|---|
| 41 | # content_types = content_types, |
|---|
| 42 | # permission = ADD_ACCOUNT_PERMISSION, |
|---|
| 43 | # extra_constructors = constructors, |
|---|
| 44 | # fti = ftis, |
|---|
| 45 | # ).initialize(context) |
|---|
| 46 | # utils.ContentInit( |
|---|
| 47 | # PROJECTNAME + ' Content', |
|---|
| 48 | # content_types = content_types, |
|---|
| 49 | # permission = ADD_ENTRY_PERMISSION, |
|---|
| 50 | # extra_constructors = constructors, |
|---|
| 51 | # fti = ftis, |
|---|
| 52 | # ).initialize(context) |
|---|
| 53 | |
|---|
| 54 | ## |
|---|
| 55 | ## Adds the Tool |
|---|
| 56 | ## |
|---|
| 57 | # import ShoeBoxTool |
|---|
| 58 | # tools = (ShoeBoxTool.ShoeBoxTool, ) |
|---|
| 59 | # utils.ToolInit( |
|---|
| 60 | # 'ShoeBox', |
|---|
| 61 | # tools=tools, |
|---|
| 62 | # product_name='ShoeBox', |
|---|
| 63 | # icon = 'tool.png', |
|---|
| 64 | # ).initialize(context) |
|---|
| 65 | |
|---|
| 66 | |
|---|