diff --git a/files/renderer.php b/files/renderer.php index 0bb2d1c4aeb..c523f1b14d1 100644 --- a/files/renderer.php +++ b/files/renderer.php @@ -306,7 +306,7 @@ class core_files_renderer extends plugin_renderer_base { * The elements will be assign with class 'uneditable' and input/select element will become * disabled if they are not applicable for the particular file; * - * There may be present elements with classes 'fp-origpath', 'fp-datemodified', 'fp-datecreated', + * There may be present elements with classes 'fp-original', 'fp-datemodified', 'fp-datecreated', * 'fp-size', 'fp-dimensions'. They will receive additional class 'fp-unknown' if information * is unavailable. If there is information available, the content of embedded element * with class 'fp-value' will be substituted with the value; @@ -342,7 +342,7 @@ class core_files_renderer extends plugin_renderer_base { : -: +:

diff --git a/lang/en/repository.php b/lang/en/repository.php index ca806a3c83b..9f4a2a9b333 100644 --- a/lang/en/repository.php +++ b/lang/en/repository.php @@ -148,6 +148,7 @@ $string['norepositoriesavailable'] = 'Sorry, none of your current repositories c $string['norepositoriesexternalavailable'] = 'Sorry, none of your current repositories can return external files.'; $string['notyourinstances'] = 'You can not view/edit repository instances of another user'; $string['off'] = 'Enabled but hidden'; +$string['original'] = 'Original'; $string['openpicker'] = 'Choose a file...'; $string['operation'] = 'Operation'; $string['on'] = 'Enabled and visible'; diff --git a/lib/form/filemanager.js b/lib/form/filemanager.js index c9199589aca..59333038f33 100644 --- a/lib/form/filemanager.js +++ b/lib/form/filemanager.js @@ -402,6 +402,13 @@ M.form_filemanager.init = function(Y, options) { retrieved_children[node.children[i].path] = node.children[i]; } } + if (!node.path || node.path == '/') { + // this is a root pseudo folder + node.fileinfo.filepath = '/'; + node.fileinfo.type = 'folder'; + node.fileinfo.fullname = node.fileinfo.title; + node.fileinfo.filename = '.'; + } this.request({ action:'list', params: {filepath:node.path?node.path:''}, @@ -474,8 +481,12 @@ M.form_filemanager.init = function(Y, options) { }, classnamecallback : function(node) { var classname = ''; - if (node.type == 'folder') { classname = classname + ' fp-folder';} - if (node.filepath) { classname = classname + ' fp-hascontextmenu';} + if (node.type == 'folder' || (!node.type && !node.filename)) { + classname = classname + ' fp-folder'; + } + if (node.filename || node.filepath || (node.path && node.path != '/')) { + classname = classname + ' fp-hascontextmenu'; + } if (node.sortorder == 1) { classname = classname + ' fp-mainfile';} return Y.Lang.trim(classname); } @@ -501,7 +512,7 @@ M.form_filemanager.init = function(Y, options) { // save current path and filelist (in case we want to jump to other viewmode) this.options.path = e.node.origpath; this.options.list = e.node.origlist; - this.currentpath = e.node.path; + this.currentpath = node.filepath; this.print_path(); //this.content_scrolled(); } @@ -740,7 +751,6 @@ M.form_filemanager.init = function(Y, options) { this.selectui.fileinfo = node; selectnode.one('.fp-saveas input').set('value', node.fullname); var foldername = this.get_parent_folder_name(node); - selectnode.all('.fp-origpath .fp-value').setContent(foldername); selectnode.all('.fp-author input').set('value', node.author); selectnode.all('.fp-license select option[selected]').set('selected', false); selectnode.all('.fp-license select option[value='+node.license+']').set('selected', true); @@ -750,7 +760,7 @@ M.form_filemanager.init = function(Y, options) { }); selectnode.all('.fp-author input, .fp-license select').set('disabled',(node.type == 'folder')?'disabled':''); // display static information about a file (when known) - var attrs = ['datemodified','datecreated','size','dimensions']; + var attrs = ['datemodified','datecreated','size','dimensions','original']; for (var i in attrs) { if (selectnode.one('.fp-'+attrs[i])) { var value = (node[attrs[i]+'_f']) ? node[attrs[i]+'_f'] : (node[attrs[i]] ? node[attrs[i]] : '');