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 | """ |
---|
12 | return the appropriate page in the academics section |
---|
13 | """ |
---|
14 | try: |
---|
15 | from Products.zdb import set_trace |
---|
16 | except: |
---|
17 | def set_trace(): |
---|
18 | pass |
---|
19 | |
---|
20 | request = context.REQUEST |
---|
21 | redirect = request.RESPONSE.redirect |
---|
22 | pm = context.portal_membership |
---|
23 | |
---|
24 | if pm.isAnonymousUser(): |
---|
25 | return redirect("%s/srp_anonymous_view" % context.portal_url()) |
---|
26 | else: |
---|
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 | |
---|