Skip to content

Commit

Permalink
REPOSITORY/MDL-13766
Browse files Browse the repository at this point in the history
display repository name in search form.
  • Loading branch information
dongsheng committed Nov 20, 2008
1 parent 80483d7 commit 448b49e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lang/en_utf8/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
$string['saving'] = 'Saving';
$string['settings'] = 'Settings';
$string['search'] = 'Search ';
$string['searching'] = 'What are you searching for?';
$string['searching'] = 'Search in ';
$string['siteinstances'] = 'Repositories instances of the site';
$string['size'] = 'Size';
$string['submit'] = 'Submit';
Expand Down
17 changes: 10 additions & 7 deletions repository/javascript.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function _client() {
var k1 = new YAHOO.util.KeyListener(scope, {keys:13}, {fn:function(){this.fnSearch()},scope:searchbtn, correctScope: true});
k1.enable();
});
for(var i=0; i<_client.repos.length; i++) {
for(var i in _client.repos) {
var repo = _client.repos[i];
var li = document.createElement('li');
li.id = 'repo-$suffix-'+repo.id;
Expand Down Expand Up @@ -852,6 +852,7 @@ function _client() {
}
_client.search_form_cb = {
success: function(o) {
var _r = repository_client_$suffix;
var el = document.getElementById('fp-search-dlg');
if(el) {
el.innerHTML = '';
Expand All @@ -861,7 +862,7 @@ function _client() {
}
var div1 = document.createElement('DIV');
div1.className = 'hd';
div1.innerHTML = "$strsearching";
div1.innerHTML = "$strsearching\"" + _r.repos[_r.repositoryid].name + '"';
var div2 = document.createElement('DIV');
div2.className = 'bd';
var sform = document.createElement('FORM');
Expand All @@ -875,21 +876,21 @@ function _client() {
document.body.appendChild(el);
var dlg = new YAHOO.widget.Dialog("fp-search-dlg",{
postmethod: 'async',
draggable: true,
width : "30em",
fixedcenter : true,
zindex: 766667,
visible : false,
constraintoviewport : true,
buttons : [
{ text:"Submit",handler: function() {
{ text:"$strsubmit",handler: function() {
_client.viewbar.set('disabled', false); _client.loading('load');
YAHOO.util.Connect.setForm('fp-search-form', false, false);
this.cancel();
var trans = YAHOO.util.Connect.asyncRequest('POST',
'$CFG->httpswwwroot/repository/ws.php?action=search&env='+_client.env, _client.req_cb);
},isDefault:true
},
{text:"Cancel",handler:function() {this.cancel()}}
},isDefault:true},
{text:"$strcancel",handler:function() {this.cancel()}}
]
});
dlg.render();
Expand Down Expand Up @@ -957,8 +958,10 @@ function _client() {
$user_context = get_context_instance(CONTEXT_USER, $USER->id);
$repos = repository_get_instances(array($user_context, $context, get_system_context()));
foreach ($repos as $repo) {
$info = $repo->ajax_info();
$js .= "\r\n";
$js .= 'repository_client_'.$suffix.'.repos.push('.json_encode($repo->ajax_info()).');'."\n";
$js .= 'repository_client_'.$suffix.'repos=[];';
$js .= 'repository_client_'.$suffix.'.repos['.$info->id.']='.json_encode($repo->ajax_info()).';'."\n";
}
$js .= "\r\n";

Expand Down

0 comments on commit 448b49e

Please sign in to comment.