Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
mahara
mahara
Commits
93e03f8e
Commit
93e03f8e
authored
Aug 02, 2016
by
Robert Lyon
Committed by
Gerrit Code Review
Aug 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Bug #1298144 Don't show "Download as zip file" link when not needed"
parents
83069d9e
52ab75a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
htdocs/lib/form/elements/filebrowser.php
htdocs/lib/form/elements/filebrowser.php
+16
-1
htdocs/theme/raw/plugintype/artefact/file/templates/form/filelist.tpl
.../raw/plugintype/artefact/file/templates/form/filelist.tpl
+1
-1
No files found.
htdocs/lib/form/elements/filebrowser.php
View file @
93e03f8e
...
...
@@ -158,7 +158,14 @@ function pieform_element_filebrowser(Pieform $form, $element) {
$filters
=
isset
(
$element
[
'filters'
])
?
$element
[
'filters'
]
:
null
;
$filedata
=
ArtefactTypeFileBase
::
get_my_files_data
(
$folder
,
$userid
,
$group
,
$institution
,
$filters
);
$smarty
->
assign
(
'filelist'
,
$filedata
);
// Only allow 'Download folder content as zip' link if theres some kind of content (file or subfolder with content)
$addzipdownloadlink
=
false
;
foreach
(
$filedata
as
$k
=>
$v
)
{
if
(
empty
(
$v
->
isparent
)
&&
(
$v
->
artefacttype
!=
'folder'
||
(
$v
->
artefacttype
==
'folder'
&&
!
empty
(
$v
->
childcount
))))
{
$addzipdownloadlink
=
true
;
}
}
$smarty
->
assign
(
'downloadfolderaszip'
,
$addzipdownloadlink
);
$configstr
=
json_encode
(
$config
);
$fileliststr
=
json_encode
(
$filedata
);
...
...
@@ -311,6 +318,14 @@ function pieform_element_filebrowser_build_filelist($form, $element, $folder, $h
$filters
=
isset
(
$element
[
'filters'
])
?
$element
[
'filters'
]
:
null
;
$filedata
=
ArtefactTypeFileBase
::
get_my_files_data
(
$folder
,
$userid
,
$group
,
$institution
,
$filters
);
// Only allow 'Download folder content as zip' link if theres some kind of content (file or subfolder with content)
$addzipdownloadlink
=
false
;
foreach
(
$filedata
as
$k
=>
$v
)
{
if
(
empty
(
$v
->
isparent
)
&&
(
$v
->
artefacttype
!=
'folder'
||
(
$v
->
artefacttype
==
'folder'
&&
!
empty
(
$v
->
childcount
))))
{
$addzipdownloadlink
=
true
;
}
}
$smarty
->
assign
(
'downloadfolderaszip'
,
$addzipdownloadlink
);
$switchwidth
=
ArtefactTypeFileBase
::
get_switch_width
();
...
...
htdocs/theme/raw/plugintype/artefact/file/templates/form/filelist.tpl
View file @
93e03f8e
...
...
@@ -177,7 +177,7 @@
</tbody>
</table>
</div>
{
if
!
$selectable
}
{
if
!
$selectable
&&
$downloadfolderaszip
}
<a
id=
"downloadfolder"
class=
"panel-footer text-small"
href=
"
{
$WWWROOT
}
artefact/file/downloadfolder.php?
{
$folderparams
|
safe
}
"
>
<span
class=
"icon icon-download"
role=
"presentation"
aria-hidden=
"true"
></span>
<span>
{
str
tag
=
downloadfolderziplink
section
=
artefact
.
file
}
</span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment