$string['noenter'] = 'Nothing entered';
$string['nofilesattached'] = 'No files attached';
$string['nopermissiontoaccess'] = 'No permission to access this repository';
+$string['nomorefiles'] = 'No more attachments allowed';
$string['notyourinstances'] = 'You can not view/edit repository instances of another user';
$string['noresult'] = 'No search result';
$string['operation'] = 'Operation';
var html = '<li><a href="'+obj['url']+'"><img src="'+obj['icon']+'" class="icon" /> '+obj['file']+'</a> ';
html += '<a href="###" onclick=\'rm_file('+obj['id']+', "'+obj['file']+'", this)\'><img src="'+filemanager.deleteicon+'" class="iconsmall" /></a>';
html += '</li>';
+ if(obj.maxfileslimit){
+ var btn = document.getElementById('btnadd-'+obj.client_id);
+ btn.onclick = function(){return false;};
+ btn.innerHTML = mstr.repository.nomorefiles;
+ }
list.innerHTML += html;
}
function callpicker(el_id, client_id, itemid) {
params.callback = fp_callback;
var fp = open_filepicker(client_id, params);
return false;
-}
\ No newline at end of file
+}
<a href="###" id="btnadd-{$client_id}" class="btnaddfile" onclick="return callpicker('$id', '$client_id', '$draftitemid')">$straddfile</a>
EOD;
$PAGE->requires->yui_lib('dom');
+ $PAGE->requires->string_for_js('nomorefiles', 'repository');
$PAGE->requires->js_function_call('YAHOO.util.Dom.setStyle', Array("btnadd-{$client_id}", 'display', 'inline'));
if (empty($CFG->filemanagerjsloaded)) {
$jsvars = Array('clientid' => $client_id,
}
repository_client.end = function(client_id, obj) {
var fp = repository_client.fp[client_id];
+ if (repository_client.files[client_id] == undefined) {
+ repository_client.files[client_id] = 0;
+ }
if(fp.env=='filepicker') {
fp.target.value = obj['id'];
}else if(fp.env=='editor'){
}
fp.target.onchange();
}
+ obj.maxfileslimit = (repository_client.files[client_id]>=fp.maxfiles);
fp.formcallback(obj);
fp.hide();
repository_client.viewfiles(client_id);