Пример #1
0
 def get_fs_template_content(self, id, portal):
     """
         return the content of the filesystem template
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.forms is not None:
         return readFile(join(portal_path, 'skel', 'forms', '%s.zpt' % id), 'r')
Пример #2
0
 def get_fs_layout_content(self, portal, skin_id, scheme_id, file_id, rtype='r'):
     """
         return the content of the filesystem layout file
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         if scheme_id:
             file_ext = ''
             if rtype == 'r': file_ext = '.css'
             return readFile(join(portal_path, 'skel', 'layout', skin_id, scheme_id, '%s%s' % (file_id, file_ext)), rtype)
         else:
             return readFile(join(portal_path, 'skel', 'layout', skin_id, '%s.zpt' % file_id), 'r')
Пример #3
0
 def list_fs_templates(self, portal):
     """
         return the list of the filesystem templates
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.forms is not None:
         return [f.id for f in skel_handler.root.forms.forms]
Пример #4
0
 def get_fs_layout_content(self,
                           portal,
                           skin_id,
                           scheme_id,
                           file_id,
                           rtype='r'):
     """
         return the content of the filesystem layout file
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(
         readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         if scheme_id:
             file_ext = ''
             if rtype == 'r': file_ext = '.css'
             return readFile(
                 join(portal_path, 'skel', 'layout', skin_id, scheme_id,
                      '%s%s' % (file_id, file_ext)), rtype)
         else:
             return readFile(
                 join(portal_path, 'skel', 'layout', skin_id,
                      '%s.zpt' % file_id), 'r')
Пример #5
0
 def list_fs_skinfiles(self, portal, skin_id, schemes=False):
     """
         return the list of the filesystem templates
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         for skin in skel_handler.root.layout.skins:
             if skin.id == skin_id:
                 if schemes:
                     return [s.id for s in skin.schemes]
                 else:
                     return [f.id for f in skin.templates]
     return []
Пример #6
0
 def list_fs_skinfiles(self, portal, skin_id, schemes=False):
     """
         return the list of the filesystem templates
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(
         readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         for skin in skel_handler.root.layout.skins:
             if skin.id == skin_id:
                 if schemes:
                     return [s.id for s in skin.schemes]
                 else:
                     return [f.id for f in skin.templates]
     return []
Пример #7
0
 def list_fs_schemefiles(self, portal, skin_id, scheme_id, ftype='styles'):
     """
         return the list of the filesystem templates
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         for skin in skel_handler.root.layout.skins:
             if skin.id == skin_id:
                 for scheme in skin.schemes:
                     if scheme.id == scheme_id:
                         if ftype == 'styles':
                             return [s.id for s in scheme.styles]
                         else:
                             return [i.id for i in scheme.images]
Пример #8
0
 def list_fs_schemefiles(self, portal, skin_id, scheme_id, ftype='styles'):
     """
         return the list of the filesystem templates
     """
     portal_path = get_portal_path(self, portal)
     skel_handler, error = skel_parser().parse(
         readFile(join(portal_path, 'skel', 'skel.xml'), 'r'))
     if skel_handler.root.layout is not None:
         for skin in skel_handler.root.layout.skins:
             if skin.id == skin_id:
                 for scheme in skin.schemes:
                     if scheme.id == scheme_id:
                         if ftype == 'styles':
                             return [s.id for s in scheme.styles]
                         else:
                             return [i.id for i in scheme.images]