Commit 426e1749 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add more fields to myfiles; make intermediate directory links work

parent 831d84ea
......@@ -42,7 +42,9 @@ var filelist = new TableRenderer(
'myfiles.json.php',
[
formatname,
function (r) { return TD(null, '[' + r.artefacttype + ']'); },
'size',
'mtime',
function () {return TD(null)},
]
);
......@@ -63,6 +65,7 @@ function formatname(r) {
}
function changedir(path) {
alert(path);
cwd = path;
linked_path(path);
uploader.updatedestination(paths[path], path);
......@@ -73,15 +76,13 @@ function changedir(path) {
function linked_path(path) {
var dirs = cwd.split('/');
var homedir = A({'href':''}, get_string('home'));
homedir.onclick = function () { stop(); return changedir('/'); };
var homedir = A({'href':'', 'onclick':"return changedir('/')"}, get_string('home'));
var sofar = '/';
var folders = [homedir];
for (i=0; i<dirs.length; i++) {
if (dirs[i] != '') {
sofar = sofar + dirs[i] + '/';
var dir = A({'href':'bar'}, dirs[i]);
dir.onclick = function () { stop(); return changedir(sofar);};
var dir = A({'href':'', 'onclick':'return changedir(\'' + sofar + '\')'}, dirs[i]);
folders.push(' / ');
folders.push(dir);
}
......@@ -101,6 +102,7 @@ var uploader = new FileUploader('uploader', 'upload.json.php', filelist.doupdate
JAVASCRIPT;
$smarty = smarty(array('tablerenderer','fileuploader'));
$smarty->assign('INLINEJAVASCRIPT', $javascript);
......
......@@ -40,7 +40,7 @@ else {
}
$prefix = get_config('dbprefix');
$filedata = get_records_sql_array('SELECT a.id, a.artefacttype, a.title, f.name, f.size
$filedata = get_records_sql_array('SELECT a.id, a.artefacttype, a.title, a.mtime, f.name, f.size
FROM ' . $prefix . 'artefact_file_files f
INNER JOIN ' . $prefix . 'artefact a ON f.artefact = a.id
WHERE a.owner = ' . $userid . '
......@@ -60,7 +60,7 @@ $result = array(
'message' => get_string('filelistloaded'),
);
log_debug($result);
//log_debug($result);
json_headers();
print json_encode($result);
......
Supports Markdown
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