* @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 * @category Stud.IP * @since 2.2 */ class Course_ChangeViewController extends AuthenticatedController { public function before_filter(&$action, &$args) { parent::before_filter($action, $args); $this->course_id = Course::findCurrent()->id; } /** * Sets the current course into participant view. * Only available for tutor upwards. * * @throws Trails\Exception Someone with unfitting rights tried to call here. */ public function set_changed_view_action() { if (!$GLOBALS['perm']->have_studip_perm('tutor', $this->course_id)) { throw new AccessDeniedException(); } $_SESSION["seminar_change_view_{$this->course_id}"] = 'autor'; $this->relocate('course/overview'); } /** * Resets a course currently in participant view to normal view * with real rights. * * @throws Trails\Exception Someone with unfitting rights tried to call here. */ public function reset_changed_view_action() { unset($_SESSION["seminar_change_view_{$this->course_id}"]); $this->relocate('course/contentmodules'); } }