}
$client_id = uniqid();
- $repo_info = repository_get_client($context, $client_id, $this->filetypes, $this->returnvalue);
+ $repo_info = repository_get_client($context, $client_id, $this->_options['filetypes'], $this->_options['returnvalue']);
$html = $this->_get_draftfiles($draftitemid, $client_id);
$str .= <<<EOD
<script type="text/javascript">
//<![CDATA[
-var elitem = null;
+var selected_file = null;
var rm_cb = {
success: function(o) {
if(o.responseText && o.responseText == 200){
- elitem.parentNode.removeChild(elitem);
+ selected_file.parentNode.removeChild(elitem);
}
}
}
-function rm(id, name, context) {
+function rm_file(id, name, context) {
if (confirm('$strdelete')) {
var trans = YAHOO.util.Connect.asyncRequest('POST',
'{$CFG->httpswwwroot}/repository/ws.php?action=delete&itemid='+id,
rm_cb,
'title='+name
);
- elitem = context.parentNode;
+ selected_file = context.parentNode;
}
}
-function uf(obj) {
+function fp_callback(obj) {
var list = document.getElementById('draftfiles-'+obj.client_id);
var html = '<li><a href="'+obj['url']+'"><img src="'+obj['icon']+'" class="icon" /> '+obj['file']+'</a> ';
- html += '<a href="###" onclick=\'rm('+obj['id']+', "'+obj['file']+'", this)\'><img src="{$CFG->pixpath}/t/delete.gif" class="iconsmall" /></a>';;
+ html += '<a href="###" onclick=\'rm_file('+obj['id']+', "'+obj['file']+'", this)\'><img src="{$CFG->pixpath}/t/delete.gif" class="iconsmall" /></a>';;
html += '</li>';
list.innerHTML += html;
}
obj.env = 'filemanager';
obj.itemid = itemid;
obj.target = el;
- obj.callback = uf;
+ obj.callback = fp_callback;
var fp = open_filepicker(client_id, obj);
}
//]]>