mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-22 16:03:47 +01:00
Use filemanager popup to allow linking to already existing files
This commit is contained in:
parent
235d9b3285
commit
ff19062265
@ -230,6 +230,9 @@ class etemplate_widget_link extends etemplate_widget
|
|||||||
$link = egw_vfs::concat($app_path,egw_vfs::basename($target));
|
$link = egw_vfs::concat($app_path,egw_vfs::basename($target));
|
||||||
egw_vfs::symlink($target,$link);
|
egw_vfs::symlink($target,$link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Return js to refresh opener and close popup
|
||||||
|
return 'window.close();';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function ajax_delete($value) {
|
public function ajax_delete($value) {
|
||||||
|
@ -129,6 +129,7 @@ var et2_link_to = et2_inputWidget.extend({
|
|||||||
et2_link_entry.prototype.set_blur(this.egw().lang("Comment..."),this.comment);
|
et2_link_entry.prototype.set_blur(this.egw().lang("Comment..."),this.comment);
|
||||||
|
|
||||||
// Filemanager link popup
|
// Filemanager link popup
|
||||||
|
var self = this;
|
||||||
this.filemanager_button = $j(document.createElement("img"))
|
this.filemanager_button = $j(document.createElement("img"))
|
||||||
.attr("src", this.egw().image("filemanager/navbar"))
|
.attr("src", this.egw().image("filemanager/navbar"))
|
||||||
.addClass("et2_button et2_button_icon")
|
.addClass("et2_button et2_button_icon")
|
||||||
@ -136,11 +137,30 @@ var et2_link_to = et2_inputWidget.extend({
|
|||||||
.click(this, function(e) {
|
.click(this, function(e) {
|
||||||
// Open the filemanager select in a popup
|
// Open the filemanager select in a popup
|
||||||
var values = e.data.options.value;
|
var values = e.data.options.value;
|
||||||
e.data.egw().open_link(
|
var popup = e.data.egw().open_link(
|
||||||
'/index.php?menuaction=filemanager.filemanager_select.select&mode=open-multiple&method=etemplate_widget_link::link_existing&label=link&id=' + values.to_app + ":" + values.to_id,
|
'/index.php?menuaction=filemanager.filemanager_select.select&mode=open-multiple&method=etemplate_widget_link::link_existing&label=link&id=' + values.to_app + ":" + values.to_id,
|
||||||
false,
|
'link_existing',
|
||||||
'640x580'
|
'640x580'
|
||||||
);
|
);
|
||||||
|
if(popup)
|
||||||
|
{
|
||||||
|
// Update on close doesn't always (ever, in chrome) work, so poll
|
||||||
|
var poll = self.egw().window.setInterval(
|
||||||
|
function() {
|
||||||
|
if(popup.closed) {
|
||||||
|
self.getRoot().iterateOver(
|
||||||
|
function(widget) {
|
||||||
|
if(widget.id == self.id) {
|
||||||
|
widget._get_links();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
self, et2_link_list
|
||||||
|
)
|
||||||
|
self.egw().window.clearInterval(poll);
|
||||||
|
}
|
||||||
|
},1000);
|
||||||
|
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Need a div for file upload widget
|
// Need a div for file upload widget
|
||||||
|
@ -540,6 +540,7 @@ ul.et2_link_string {
|
|||||||
*/
|
*/
|
||||||
ul.et2_vfs {
|
ul.et2_vfs {
|
||||||
padding-left: 0px;
|
padding-left: 0px;
|
||||||
|
margin: 1px;
|
||||||
}
|
}
|
||||||
.et2_vfs li.vfsFilename {
|
.et2_vfs li.vfsFilename {
|
||||||
display: inline;
|
display: inline;
|
||||||
|
Loading…
Reference in New Issue
Block a user