|
@@ -14,6 +14,7 @@ $work = get_work_data_by_id($id);
|
|
|
if (empty($id) || empty($work)) {
|
|
|
api_not_allowed();
|
|
|
}
|
|
|
+
|
|
|
$interbreadcrumb[] = array ('url' => 'work.php', 'name' => get_lang('StudentPublications'));
|
|
|
|
|
|
$my_folder_data = get_work_data_by_id($work['parent_id']);
|
|
@@ -29,6 +30,7 @@ if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] ==
|
|
|
}
|
|
|
$interbreadcrumb[] = array('url' => $url_dir, 'name' => $my_folder_data['title']);
|
|
|
$interbreadcrumb[] = array('url' => '#','name' => $work['title']);
|
|
|
+
|
|
|
if (($course_info['show_score'] == 0 && $work['active'] == 1 && $work['accepted'] == 1) ||
|
|
|
api_is_allowed_to_edit() || user_is_author($id)
|
|
|
) {
|
|
@@ -39,20 +41,19 @@ if (user_is_author($id) || $course_info['show_score'] == 0 && $work['active'] ==
|
|
|
header('Location: '.$url);
|
|
|
exit;
|
|
|
}
|
|
|
- $tpl = new Template();
|
|
|
- $tpl->assign('work', $work);
|
|
|
-
|
|
|
- $tpl->assign('work_comment_enabled', ALLOW_USER_COMMENTS);
|
|
|
|
|
|
$comments = getWorkComments($work);
|
|
|
$commentForm = getWorkCommentForm($work);
|
|
|
+
|
|
|
+ $tpl = new Template();
|
|
|
+ $tpl->assign('work', $work);
|
|
|
+ $tpl->assign('work_comment_enabled', ALLOW_USER_COMMENTS);
|
|
|
$tpl->assign('comments', $comments);
|
|
|
$tpl->assign('form', $commentForm);
|
|
|
|
|
|
$template = $tpl->get_template('work/view.tpl');
|
|
|
$content = $tpl->fetch($template);
|
|
|
$tpl->assign('content', $content);
|
|
|
-
|
|
|
$tpl->display_one_col_template();
|
|
|
} else {
|
|
|
api_not_allowed(true);
|