Commit 3ef0cb00 authored by Richard Mansfield's avatar Richard Mansfield

Fix unzip progress bar for group files

Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent f320b394
......@@ -76,6 +76,9 @@ function unzip_iframe_progress_handler($artefacts) {
}
$file = artefact_instance_from_id($unzip['file']);
if ($file->get('group')) {
require_once(get_config('libroot') . 'group.php');
}
$file->set_archive_info($unzip['zipinfo']);
$status = $file->extract('unzip_iframe_progress_handler');
......
......@@ -72,32 +72,34 @@ if ($fileid) {
$message = get_string('invalidarchive', 'artefact.file');
}
if ($zipinfo && !$file->get('owner') || $USER->quota_allowed($zipinfo->totalsize)) {
$name = $file->unzip_directory_name();
$message = get_string('fileswillbeextractedintofolder', 'artefact.file', $name['fullname']);
$goto = files_page($file);
if ($parent = $file->get('parent')) {
$goto .= (strpos($goto, '?') === false ? '?' : '&') . 'folder=' . $parent;
}
$form = pieform(array(
'name' => 'unzip_artefact',
'elements' => array(
'fileid' => array(
'type' => 'hidden',
'value' => $fileid,
if ($zipinfo) {
if (!$file->get('owner') || $USER->quota_allowed($zipinfo->totalsize)) {
$name = $file->unzip_directory_name();
$message = get_string('fileswillbeextractedintofolder', 'artefact.file', $name['fullname']);
$goto = files_page($file);
if ($parent = $file->get('parent')) {
$goto .= (strpos($goto, '?') === false ? '?' : '&') . 'folder=' . $parent;
}
$form = pieform(array(
'name' => 'unzip_artefact',
'elements' => array(
'fileid' => array(
'type' => 'hidden',
'value' => $fileid,
),
'submit' => array(
'type' => 'submitcancel',
'value' => array(get_string('Unzip', 'artefact.file'), get_string('cancel')),
'goto' => $goto,
)
),
'submit' => array(
'type' => 'submitcancel',
'value' => array(get_string('Unzip', 'artefact.file'), get_string('cancel')),
'goto' => $goto,
)
),
));
}
else {
$message = get_string('insufficientquotaforunzip', 'artefact.file');
));
}
else {
$message = get_string('insufficientquotaforunzip', 'artefact.file');
}
}
$smarty = smarty(array(), array(), array(), $smartyconfig);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment