from Globals import package_home from Products.Archetypes.public import process_types, listTypes from Products.CMFCore import utils from Products.CMFCore.DirectoryView import registerDirectory import os, os.path from config import SKINS_DIR, GLOBALS, PROJECTNAME from config import ADD_CURRICULUM_PERMISSION from Globals import InitializeClass registerDirectory(SKINS_DIR, GLOBALS) def initialize(context): ##Import Types here to register them import Curriculum import Chapter content_types, constructors, ftis = process_types( listTypes(PROJECTNAME), PROJECTNAME) #folderIndex = getTypeIndex(content_types, 'CurriculumFolder') curriculum_constructor = [] curriculum_constructor.append(constructors[1]) chapter_constructor = [] chapter_constructor.append(constructors[0]) curriculum_type = [] curriculum_type.append(content_types[1]) chapter_type = [] chapter_type.append(content_types[0]) utils.ContentInit( PROJECTNAME + ' Content', content_types = tuple(curriculum_type), permission = ADD_CURRICULUM_PERMISSION, extra_constructors = tuple(curriculum_constructor), fti = ftis, ).initialize(context) utils.ContentInit( PROJECTNAME + ' FolderContent', content_types = tuple(chapter_type), permission = ADD_CURRICULUM_PERMISSION, extra_constructors = tuple(chapter_constructor), fti = ftis, ).initialize(context) # entry_contstructor = [] # entry_contstructor.append(constructors[0]) # entry_type = [] # entry_type.append(content_types[0]) # # utils.ContentInit( # PROJECTNAME + ' Content', # content_types = tuple(entry_type), # permission = ADD_CURRICULUM_PERMISSION, # extra_constructors = tuple(entry_contstructor), # fti = ftis, # ).initialize(context)