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
055058f1
Commit
055058f1
authored
Dec 05, 2006
by
Richard Mansfield
Browse files
Sort my files listing
parent
c23d6dc9
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/artefact/file/myfiles.json.php
View file @
055058f1
...
...
@@ -46,8 +46,7 @@ $filedata = get_records_sql_array('SELECT a.id, a.artefacttype, a.mtime, f.size,
FROM '
.
$prefix
.
'artefact a
INNER JOIN '
.
$prefix
.
'artefact_file_files f ON f.artefact = a.id
WHERE a.owner = '
.
$userid
.
'
AND a.parent'
.
$infolder
.
'
ORDER BY a.artefacttype DESC'
,
''
);
AND a.parent'
.
$infolder
,
''
);
if
(
!
$filedata
)
{
$filedata
=
array
();
...
...
@@ -58,6 +57,13 @@ else {
}
}
// Sort folders before files; then use nat sort order on title.
function
fileobjcmp
(
$a
,
$b
)
{
return
strnatcasecmp
((
$a
->
artefacttype
==
'folder'
)
.
$a
->
title
,
(
$b
->
artefacttype
==
'folder'
)
.
$b
->
title
);
}
usort
(
$filedata
,
"fileobjcmp"
);
$result
=
array
(
'count'
=>
count
(
$filedata
),
'limit'
=>
$limit
,
...
...
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