// The tutor might not have access to the view any more; send // them back to the group page. redirect(group_homepage_url($submittedgroup)); } redirect($view->get_url()); } $javascript = array('paginator', 'viewmenu', 'author'); $blocktype_js = $view->get_all_blocktype_javascript(); $javascript = array_merge($javascript, $blocktype_js['jsfiles']); $inlinejs = "addLoadEvent( function() {\n" . join("\n", $blocktype_js['initjs']) . "\n});"; // If the view has comments turned off, tutors can still leave // comments if the view is submitted to their group. if (!empty($releaseform) || ($commenttype = $view->user_comments_allowed($USER))) { $defaultprivate = !empty($releaseform); $moderate = isset($commenttype) && $commenttype === 'private'; $addfeedbackform = pieform(ArtefactTypeComment::add_comment_form($defaultprivate, $moderate)); } if ($USER->is_logged_in()) { $objectionform = pieform(objection_form()); if ($notrudeform = notrude_form()) { $notrudeform = pieform($notrudeform); } } $viewbeingwatched = (int) record_exists('usr_watchlist_view', 'usr', $USER->get('id'), 'view', $viewid); $commentoptions = ArtefactTypeComment::get_comment_options(); $commentoptions->limit = $limit; $commentoptions->offset = $offset; $commentoptions->showcomment = $showcomment; $commentoptions->view = $view; $feedback = ArtefactTypeComment::get_comments($commentoptions); // Set up theme
array_unshift($artefactpath, array('url' => get_config('wwwroot') . 'view/artefact.php?artefact=' . $parent . '&view=' . $viewid, 'title' => $parentobj->display_title())); } $parent = $parentobj->get('parent'); } $artefactpath[] = array('url' => '', 'title' => $artefact->display_title()); // Feedback $feedback = ArtefactTypeComment::get_comments($limit, $offset, $showcomment, $view, $artefact); $javascript = <<<EOF var viewid = {$viewid}; addLoadEvent(function () { paginator = {$feedback->pagination_js} }); EOF; if ($artefact->get('allowcomments')) { $anonfeedback = !$USER->is_logged_in() && view_has_token($viewid, get_cookie('viewaccess:' . $viewid)); $addfeedbackform = pieform(ArtefactTypeComment::add_comment_form(false, $artefact->get('approvecomments'))); } $objectionform = pieform(objection_form()); if ($notrudeform = $view->notrude_form()) { $notrudeform = pieform($notrudeform); } $viewbeingwatched = (int) record_exists('usr_watchlist_view', 'usr', $USER->get('id'), 'view', $viewid); $headers = array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'); $hasfeed = false; $feedlink = ''; // add a link to the ATOM feed in the header if the view is public if ($artefact->get('artefacttype') == 'blog' && $view->is_public()) { $hasfeed = true; $feedlink = get_config('wwwroot') . 'artefact/blog/atom.php?artefact=' . $artefactid . '&view=' . $viewid; $headers[] = '<link rel="alternate" type="application/atom+xml" href="' . $feedlink . '" />'; }