## Script (Python) "academics_index" ##bind container=container ##bind context=context ##bind namespace= ##bind script=script ##bind subpath=traverse_subpath ##parameters=batch=None ##title= ## # $Id: student_edit.py 486 2006-09-06 10:09:39Z joachim $ """ return the appropriate page in the academics section """ request = context.REQUEST redirect = request.RESPONSE.redirect pm = context.portal_membership if pm.isAnonymousUser(): return redirect("%s/academics_contents" % context.absolute_url()) campus = context.portal_catalog(meta_type = "University")[-1].getObject() member = pm.getAuthenticatedMember() roles = member.getRoles() isManager = "Manager" in roles or "SectionManager" in roles isStudent = "Student" in roles if isManager: if context.portal_type == 'AcademicsFolder': return context.academics.academics_index_view() elif context.portal_type == 'Faculty': return context.faculty_index_view() elif context.portal_type == 'Department': return context.department_index_view() elif context.portal_type == 'CoursesFolder': return context.courses_index_view() elif context.portal_type == 'Certificate': return context.certificate_index_view() elif context.portal_type == 'StudyLevel': return context.level_index_view() elif context.portal_type in ('CertificateCourse','Course'): return context.academics_document_view() return redirect("%s/academics_contents" % context.absolute_url()) if isStudent: return redirect("%s/academics_contents" % context.absolute_url())