Skip to content
Snippets Groups Projects
Commit cd05dfb9 authored by Bartek Przybylski's avatar Bartek Przybylski
Browse files

adding icons to filepicker

parent dd4e577f
No related branches found
No related tags found
No related merge requests found
...@@ -204,7 +204,7 @@ OCdialogs = { ...@@ -204,7 +204,7 @@ OCdialogs = {
var entry_template = '<div onclick="javascript:OC.dialogs.handlePickerClick(this, \'*ENTRYNAME*\',\''+dialog_content_id+'\')" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span id="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>'; var entry_template = '<div onclick="javascript:OC.dialogs.handlePickerClick(this, \'*ENTRYNAME*\',\''+dialog_content_id+'\')" data="*ENTRYTYPE*"><img src="*MIMETYPEICON*" style="margin-right:1em;"><span id="filename">*NAME*</span><div style="float:right;margin-right:1em;">*LASTMODDATE*</div></div>';
var names = ''; var names = '';
for (var a in r.data) { for (var a in r.data) {
names += entry_template.replace('*LASTMODDATE*', OC.mtime2date(r.data[a].mtime)).replace('*NAME*', r.data[a].name).replace('*MIMETYPEICON*', OC.webroot+'/core/img/filetypes/'+(r.data[a].type=='dir'?'folder':r.data[a].mimetype.replace('/','-'))+'.png').replace('*ENTRYNAME*', r.data[a].name).replace('*ENTRYTYPE*', r.data[a].type); names += entry_template.replace('*LASTMODDATE*', OC.mtime2date(r.data[a].mtime)).replace('*NAME*', r.data[a].name).replace('*MIMETYPEICON*', r.data[a].mimetype_icon).replace('*ENTRYNAME*', r.data[a].name).replace('*ENTRYTYPE*', r.data[a].type);
} }
$(dialog_content_id + ' #filelist').html(names); $(dialog_content_id + ' #filelist').html(names);
}, },
......
...@@ -5,6 +5,7 @@ $RUNTIME_APPTYPES=array('filesystem'); ...@@ -5,6 +5,7 @@ $RUNTIME_APPTYPES=array('filesystem');
// Init owncloud // Init owncloud
require_once('../../lib/base.php'); require_once('../../lib/base.php');
require_once('../../lib/template.php');
OC_JSON::checkLoggedIn(); OC_JSON::checkLoggedIn();
...@@ -15,6 +16,7 @@ $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : ''; ...@@ -15,6 +16,7 @@ $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
$files = array(); $files = array();
foreach( OC_Files::getdirectorycontent( $dir ) as $i ){ foreach( OC_Files::getdirectorycontent( $dir ) as $i ){
$i["date"] = OC_Util::formatDate($i["mtime"] ); $i["date"] = OC_Util::formatDate($i["mtime"] );
$i['mimetype_icon'] = $i['type'] == 'dir' ? mimetype_icon('dir'): mimetype_icon($i['mimetype']);
$files[] = $i; $files[] = $i;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment