source: WAeUP_SRP/branches/joachim-azax-branch/skins/waeup_academics/academics_index.py @ 11156

Last change on this file since 11156 was 1988, checked in by joachim, 17 years ago

merged r1979:r1987 from trunk

  • Property svn:keywords set to Id
File size: 1.3 KB
Line 
1## Script (Python) "academics_index"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind subpath=traverse_subpath
7##parameters=batch=None
8##title=
9##
10# $Id: academics_index.py 1988 2007-07-05 11:14:12Z joachim $
11"""
12return the appropriate page in the academics section
13"""
14try:
15    from Products.zdb import set_trace
16except:
17    def set_trace():
18        pass
19
20request = context.REQUEST
21redirect = request.RESPONSE.redirect
22pm = context.portal_membership
23
24if pm.isAnonymousUser():
25    return redirect("%s/srp_anonymous_view" % context.portal_url())
26else:
27    if context.portal_type == 'AcademicsFolder':
28        return context.academics_view()
29    elif context.portal_type == 'Faculty':
30        return context.faculty_view()
31    elif context.portal_type == 'Department':
32        return context.department_view()
33    elif context.portal_type == 'CoursesFolder':
34        return context.courses_view()
35    elif context.portal_type == 'CertificatesFolder':
36        return context.certificates_view()
37    elif context.portal_type == 'Certificate':
38        return context.certificate_view()
39    elif context.portal_type == 'StudyLevel':
40        return context.level_view()
41    elif context.portal_type in ('CertificateCourse','Course'):
42        return context.waeup_document_view()
43    return redirect("%s/srp_view" % context.portal_url())
44
Note: See TracBrowser for help on using the repository browser.