Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
637f4493
Commit
637f4493
authored
Dec 21, 2006
by
Richard Mansfield
Browse files
Only show delete button for empty folders
parent
4f4550a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/js/file.js
View file @
637f4493
...
...
@@ -32,7 +32,7 @@ function FileBrowser(element, source, changedircallback, actionname, actioncallb
this
.
lastcolumnfunc
=
function
(
r
)
{
var
editb
=
INPUT
({
'
type
'
:
'
button
'
,
'
value
'
:
get_string
(
'
edit
'
)});
editb
.
onclick
=
function
()
{
self
.
openeditform
(
r
);
};
if
(
r
.
emptyfolder
)
{
if
(
r
.
childcount
>
0
)
{
return
TD
(
null
,
editb
);
}
var
deleteb
=
INPUT
({
'
type
'
:
'
button
'
,
'
value
'
:
get_string
(
'
delete
'
)});
...
...
htdocs/artefact/file/lib.php
View file @
637f4493
...
...
@@ -158,12 +158,16 @@ class ArtefactTypeFileBase extends ArtefactType {
}
$filetypesql
=
"('"
.
join
(
"','"
,
PluginArtefactFile
::
get_artefact_types
())
.
"')"
;
$prefix
=
get_config
(
'dbprefix'
);
$filedata
=
get_records_sql_array
(
'SELECT a.id, a.artefacttype, a.mtime, f.size, a.title, a.description
$filedata
=
get_records_sql_array
(
'SELECT
a.id, a.artefacttype, a.mtime, f.size, a.title, a.description, COUNT(c.*) AS childcount
FROM '
.
$prefix
.
'artefact a
LEFT OUTER JOIN '
.
$prefix
.
'artefact_file_files f ON f.artefact = a.id
LEFT OUTER JOIN '
.
$prefix
.
'artefact_file_files f ON f.artefact = a.id
LEFT OUTER JOIN '
.
$prefix
.
'artefact c ON c.parent = a.id
WHERE a.owner = '
.
$userid
.
'
AND a.parent'
.
$foldersql
.
"
AND a.artefacttype IN "
.
$filetypesql
,
''
);
AND a.parent'
.
$foldersql
.
'
AND a.artefacttype IN '
.
$filetypesql
.
'
GROUP BY
1, 2, 3, 4, 5, 6;'
,
''
);
if
(
!
$filedata
)
{
$filedata
=
array
();
...
...
Write
Preview
Supports
Markdown
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