diff --git a/main/work/student_work.php b/main/work/student_work.php
index bd5044b868..1d689f0cfd 100644
--- a/main/work/student_work.php
+++ b/main/work/student_work.php
@@ -54,13 +54,44 @@ if (!empty($group_id)) {
}
}
+$action = isset($_GET['action']) ? $_GET['action'] : null;
+
+switch ($action) {
+ case 'delete_all':
+ if (api_is_allowed_to_edit()) {
+ $deletedItems = deleteAllWorkPerUser($studentId, $courseInfo);
+ if (!empty($deletedItems)) {
+ $message = get_lang('DocDel').'
';
+ foreach ($deletedItems as $item) {
+ $message .= $item['title'].'
';
+ }
+ $message = Display::return_message($message, 'info', false);
+ Session::write('message', $message);
+ }
+ header('Location: '.api_get_self().'?studentId='.$studentId.'&'.api_get_cidreq());
+ exit;
+ }
+ break;
+}
+
$interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'work/work.php?'.api_get_cidreq(), 'name' => get_lang('StudentPublications'));
$interbreadcrumb[] = array ('url' => '#', 'name' => $userInfo['complete_name']);
Display :: display_header(null);
+echo Session::read('message');
+Session::erase('message');
+
echo '